Workflow Artifact Info Hover (#37100)
Add expiry metadata to action artifacts in the run view and show it on hover. --------- Signed-off-by: Nicolas <bircni@icloud.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import {
|
||||
dirname, basename, extname, isObject, stripTags, parseIssueHref,
|
||||
dirname, basename, extname, formatBytes, isObject, stripTags, parseIssueHref,
|
||||
translateMonth, translateDay, blobToDataURI,
|
||||
toAbsoluteUrl, encodeURLEncodedBase64, decodeURLEncodedBase64, isImageFile, isVideoFile, parseRepoOwnerPathInfo,
|
||||
urlQueryEscape,
|
||||
@@ -122,6 +122,17 @@ test('encodeURLEncodedBase64, decodeURLEncodedBase64', () => {
|
||||
expect(new Uint8Array(decodeURLEncodedBase64('YQ=='))).toEqual(uint8array('a'));
|
||||
});
|
||||
|
||||
test('formatBytes', () => {
|
||||
expect(formatBytes(-1)).toBe('0 B');
|
||||
expect(formatBytes(0)).toBe('0 B');
|
||||
expect(formatBytes(512)).toBe('512 B');
|
||||
expect(formatBytes(1024)).toBe('1.0 KiB');
|
||||
expect(formatBytes(1536)).toBe('1.5 KiB');
|
||||
expect(formatBytes(10 * 1024)).toBe('10 KiB');
|
||||
expect(formatBytes(1024 * 1024)).toBe('1.0 MiB');
|
||||
expect(formatBytes(1024 * 1024 * 1024)).toBe('1.0 GiB');
|
||||
});
|
||||
|
||||
test('file detection', () => {
|
||||
for (const name of ['a.avif', 'a.jpg', '/a.jpeg', '.file.png', '.webp', 'file.svg']) {
|
||||
expect(isImageFile({name})).toBeTruthy();
|
||||
|
||||
Reference in New Issue
Block a user