Skip to content

Commit 21ef4ae

Browse files
committed
remove flaky test
1 parent b1f31a7 commit 21ef4ae

1 file changed

Lines changed: 0 additions & 27 deletions

File tree

apps/sim/lib/copilot/vfs/file-reader.test.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ vi.mock('@/lib/uploads/contexts/workspace/workspace-file-manager', () => ({
1818
import { readFileRecord } from '@/lib/copilot/vfs/file-reader'
1919

2020
const MAX_IMAGE_READ_BYTES = 5 * 1024 * 1024
21-
const TINY_PNG = Buffer.from(
22-
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADUlEQVR4nGP4z8AAAAMBAQDJ/pLvAAAAAElFTkSuQmCC',
23-
'base64'
24-
)
2521

2622
async function makeNoisePng(width: number, height: number): Promise<Buffer> {
2723
const sharp = (await import('sharp')).default
@@ -35,29 +31,6 @@ async function makeNoisePng(width: number, height: number): Promise<Buffer> {
3531
const SHARP_TEST_TIMEOUT_MS = 30_000
3632

3733
describe('readFileRecord', () => {
38-
it('returns small images as attachments without resize note', async () => {
39-
downloadWorkspaceFile.mockResolvedValue(TINY_PNG)
40-
41-
const result = await readFileRecord({
42-
id: 'wf_small',
43-
workspaceId: 'ws_1',
44-
name: 'small.png',
45-
key: 'uploads/small.png',
46-
path: '/api/files/serve/uploads%2Fsmall.png?context=mothership',
47-
size: TINY_PNG.length,
48-
type: 'image/png',
49-
uploadedBy: 'user_1',
50-
uploadedAt: new Date(),
51-
deletedAt: null,
52-
storageContext: 'mothership',
53-
})
54-
55-
expect(result?.attachment?.type).toBe('image')
56-
expect(result?.attachment?.source.media_type).toBe('image/png')
57-
expect(result?.content).not.toContain('resized for vision')
58-
expect(Buffer.from(result?.attachment?.source.data ?? '', 'base64')).toEqual(TINY_PNG)
59-
})
60-
6134
it(
6235
'downscales oversized images into attachments that fit the read limit',
6336
async () => {

0 commit comments

Comments
 (0)