mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-06 21:13:24 +09:00
enhance(web): show attachment URL and UUID in dropzone preview (#39203)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
co-authored by
wxiaoguang
parent
eb501f6b19
commit
bde1af541c
@@ -126,16 +126,17 @@ test('formatBytes', () => {
|
||||
});
|
||||
|
||||
test('file detection', () => {
|
||||
const type = null;
|
||||
for (const name of ['a.avif', 'a.jpg', '/a.jpeg', '.file.png', '.webp', 'file.svg']) {
|
||||
expect(isImageFile({name})).toBeTruthy();
|
||||
expect(isImageFile({name, type})).toBeTruthy();
|
||||
}
|
||||
for (const name of ['', 'a.jpg.x', '/path.png/x', 'webp']) {
|
||||
expect(isImageFile({name})).toBeFalsy();
|
||||
expect(isImageFile({name, type})).toBeFalsy();
|
||||
}
|
||||
for (const name of ['a.mpg', '/a.mpeg', '.file.mp4', '.webm', 'file.mkv']) {
|
||||
expect(isVideoFile({name})).toBeTruthy();
|
||||
expect(isVideoFile({name, type})).toBeTruthy();
|
||||
}
|
||||
for (const name of ['', 'a.mpg.x', '/path.mp4/x', 'webm']) {
|
||||
expect(isVideoFile({name})).toBeFalsy();
|
||||
expect(isVideoFile({name, type})).toBeFalsy();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user