Download apps/vis/web/test/zip-drop.test.ts from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 920 Bytes
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/apps/vis/web/test/zip-drop.test.ts
- Command line
-
hf download hf://SaylorTwift/kimi-code/apps/vis/web/test/zip-drop.test.ts
-
curl -L -o zip-drop.test.ts https://huggingface.co/SaylorTwift/kimi-code/resolve/main/apps/vis/web/test/zip-drop.test.ts
920 Bytes
| import { describe, expect, it } from 'vitest'; | |
| import { isZipFile } from '../src/components/shared/ZipDropOverlay'; | |
| describe('isZipFile', () => { | |
| it('accepts a .zip extension regardless of declared type', () => { | |
| expect(isZipFile({ name: 'session.zip', type: '' })).toBe(true); | |
| expect(isZipFile({ name: 'SESSION.ZIP', type: 'application/octet-stream' })).toBe(true); | |
| }); | |
| it('accepts zip MIME types even without a .zip name', () => { | |
| expect(isZipFile({ name: 'bundle', type: 'application/zip' })).toBe(true); | |
| expect(isZipFile({ name: 'bundle', type: 'application/x-zip-compressed' })).toBe(true); | |
| }); | |
| it('rejects non-zip files', () => { | |
| expect(isZipFile({ name: 'notes.txt', type: 'text/plain' })).toBe(false); | |
| expect(isZipFile({ name: 'image.png', type: 'image/png' })).toBe(false); | |
| expect(isZipFile({ name: 'archive.tar.gz', type: 'application/gzip' })).toBe(false); | |
| }); | |
| }); | |