tldraw/apps/examples/e2e/tests/test-api.spec.ts
alex 16a28bfd90
Fix jpg export and tests (#3198)
Fix a bug that was preventing JPG and webp exports from working. Also:
- Re-enable our export snapshot tests which got commented out again
- Fix some react act errors when running tests

### Change Type

- [x] `sdk` — Changes the tldraw SDK
- [x] `bugfix` — Bug fix
2024-03-18 15:08:09 +00:00

14 lines
406 B
TypeScript

import { setupWithShapes } from '../shared-e2e'
import test from './fixtures/fixtures'
test.beforeEach(setupWithShapes)
test.describe('api', () => {
for (const format of ['svg', 'png', 'jpeg', 'webp', 'json'] as const) {
test(`export as ${format}`, async ({ page, api }) => {
const downloadEvent = page.waitForEvent('download')
await api.exportAsFormat(format)
await downloadEvent
})
}
})