Remove obsolete tag support test from DragDropUpload
The tag functionality was removed in the previous commit, so this test that expected a 'tag' field in the upload FormData is no longer valid.
This commit is contained in:
@@ -504,42 +504,4 @@ describe('DragDropUpload', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Tag Support', () => {
|
|
||||||
it('includes tag in upload request', async () => {
|
|
||||||
let capturedFormData: FormData | null = null;
|
|
||||||
|
|
||||||
class MockXHR {
|
|
||||||
status = 200;
|
|
||||||
responseText = JSON.stringify({ artifact_id: 'abc123', size: 100 });
|
|
||||||
timeout = 0;
|
|
||||||
upload = { addEventListener: vi.fn() };
|
|
||||||
addEventListener = vi.fn((event: string, handler: () => void) => {
|
|
||||||
if (event === 'load') setTimeout(handler, 10);
|
|
||||||
});
|
|
||||||
open = vi.fn();
|
|
||||||
send = vi.fn((data: FormData) => {
|
|
||||||
capturedFormData = data;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
vi.stubGlobal('XMLHttpRequest', MockXHR);
|
|
||||||
|
|
||||||
render(<DragDropUpload {...defaultProps} />);
|
|
||||||
|
|
||||||
const input = document.querySelector('input[type="file"]') as HTMLInputElement;
|
|
||||||
const file = createMockFile('test.txt', 100, 'text/plain');
|
|
||||||
|
|
||||||
Object.defineProperty(input, 'files', {
|
|
||||||
value: Object.assign([file], { item: (i: number) => [file][i] }),
|
|
||||||
});
|
|
||||||
|
|
||||||
fireEvent.change(input);
|
|
||||||
|
|
||||||
await vi.advanceTimersByTimeAsync(100);
|
|
||||||
|
|
||||||
await waitFor(() => {
|
|
||||||
expect(capturedFormData?.get('tag')).toBe('v1.0.0');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user