Tldraw/apps/examples/e2e/tests/test-api.spec.ts

15 wiersze
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
})
}
})