mirror of
https://github.com/MoonshotAI/kimi-code.git
synced 2026-07-10 01:39:25 +00:00
Some checks are pending
CI / build (push) Waiting to run
CI / test (push) Waiting to run
CI / test-windows (push) Waiting to run
CI / lint (push) Waiting to run
CI / typecheck (push) Waiting to run
Nix Build / Check flake.nix workspace sync (push) Waiting to run
Nix Build / nix build .#kimi-code (push) Blocked by required conditions
Release / Release (push) Waiting to run
Release / Deploy docs (push) Blocked by required conditions
Release / Native release artifact (push) Blocked by required conditions
Release / Desktop release artifact (push) Blocked by required conditions
Release / Publish native release assets (push) Blocked by required conditions
* feat(vis): support importing debug zips via drag and drop Add a window-level drop target so a /export-debug-zip bundle can be imported by dragging it anywhere into the vis UI, alongside the existing file-picker button. A full-screen overlay gives feedback during the drag and while the upload is in flight, and non-zip files are rejected with a hint. * fix(vis): gate drop handler to file drags Match the other drag handlers by checking dataTransfer.types before calling preventDefault, so non-file drops (selected text or a URL into the search input) keep their native behavior instead of being swallowed by the window-level listener.
21 lines
920 B
TypeScript
21 lines
920 B
TypeScript
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);
|
|
});
|
|
});
|