feat: add shared decks and multi-account Mastodon OAuth
This commit is contained in:
+25
-1
@@ -1,7 +1,31 @@
|
||||
import { basename, dirname, isAbsolute } from 'node:path'
|
||||
import AxeBuilder from '@axe-core/playwright'
|
||||
import { test as base } from '@playwright/test'
|
||||
import { openDatabase } from '../src/features/storage/database.server'
|
||||
|
||||
export const test = base.extend<{ a11y: () => AxeBuilder }>({
|
||||
export const test = base.extend<{
|
||||
a11y: () => AxeBuilder
|
||||
resetDecks: undefined
|
||||
}>({
|
||||
resetDecks: [
|
||||
// biome-ignore lint/correctness/noEmptyPattern: Playwright requires destructured fixture arguments.
|
||||
async ({}, use) => {
|
||||
const path = process.env.TWITTER_LITE_E2E_DB_PATH
|
||||
if (
|
||||
!path ||
|
||||
!isAbsolute(path) ||
|
||||
!basename(dirname(path)).startsWith('twitter-lite-e2e-') ||
|
||||
basename(path) !== 'workspace.sqlite'
|
||||
)
|
||||
throw new Error('Isolated E2E database is required.')
|
||||
const database = openDatabase(path).$client
|
||||
database.pragma('foreign_keys = ON')
|
||||
database.exec('DELETE FROM decks; DELETE FROM legacy_imports;')
|
||||
database.close()
|
||||
await use(undefined)
|
||||
},
|
||||
{ auto: true },
|
||||
],
|
||||
a11y: async ({ page }, use) => {
|
||||
await use(() =>
|
||||
new AxeBuilder({ page })
|
||||
|
||||
Reference in New Issue
Block a user