diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac6407e327..293cf80824 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,23 +3,23 @@ name: CI # The gate every change goes through, on every push and every pull request, so a branch that cannot # merge says so before anybody reviews it. # -# Two stages. Build compiles every package something else depends on, exactly once, and saves what -# turbo produced. Lint, typecheck and every test job then restore that and run against it. The -# `^build` each of their tasks depends on is answered from the cache rather than compiled again, so -# nothing after the build stage rebuilds anything. -# -# One build job rather than one per package, deliberately. The packages form a chain — contracts, -# then core, then client, then screens — and a job per link would wait on the link before it, paying -# a runner's checkout and install at every step of a graph that compiles end to end in seconds. Each -# package's build is still its own turbo task with its own block in the log; they share a runner -# because splitting them would cost minutes to save seconds. +# One stage. Every job starts as soon as the changes are known, rather than waiting on a build job +# first: each restores the newest turbo cache an earlier run left, and the `^build` its tasks depend +# on is answered from it for every package that has not changed, so a job builds only what this +# change touched — seconds, where waiting on a build job of its own cost the whole run a minute and a +# half. Lint and typecheck build every package anyway, so that job leaves this commit's builds in the +# cache for the runs after it. # # The large suites are sharded, each shard on a runner of its own: @valence/screens six ways, -# @valence/server four and @valence/client three, with @valence/ui as a single shard in the same -# matrix. The small packages share one runner, two at a time, because each of -# them spends longer installing than testing and a runner apiece queued the large shards behind -# them. Two at a time rather than all at once: turbo and vitest each size their worker pool to the -# machine's CPU count, and every package at once on a handful of cores thrashes. +# @valence/server four and @valence/client three, with @valence/ui, @valence/mobile and @valence/tv +# as single shards in the same matrix. The phone and the television are not split further: most of +# their time is Babel compiling React Native, which a second shard would only do again, so instead +# Jest's compiled files are kept between runs. The small packages share two runners, two at a +# time, because each of them spends longer installing than testing: @valence/landing, the slowest of +# them, with the quick ones, and the rest on the other. Two at a time rather than all at once: turbo +# and vitest each size their worker pool to the machine's CPU count, and every package at once on a +# handful of cores thrashes. The split keeps a full run within the twenty jobs GitHub runs at once, +# so no shard waits for a runner. # # Test results outlive the run. Turbo already caches a passing test task by its inputs, and each # test job keeps those results in the Actions cache and restores them next time, so a package or a @@ -56,7 +56,9 @@ jobs: # The workspace answers which packages are affected, counting the ones that depend on a changed # one, so this file holds no list of who depends on whom to keep in step with the packages. It # needs the history to compare against but not an install, which is what makes it cheap enough - # to be worth asking. A change to a file at the root, other than the notes and the workflows that + # to be worth asking. The history comes without the contents of any file: which files changed is + # read from the trees alone, and a full clone spent most of this job's time fetching blobs it never + # read. A change to a file at the root, other than the notes and the workflows that # belong to other pipelines, reads as touching the workspace itself, and that runs everything. changes: name: Detect changed areas @@ -73,6 +75,7 @@ jobs: with: persist-credentials: false fetch-depth: 0 + filter: blob:none - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 @@ -148,60 +151,28 @@ jobs: fi # The large suites, each split into the shards its size calls for, and the rest for the - # one runner the small packages share. + # two runners the small packages share: the slowest of them with the quick ones, and the + # others together. sharded='{"@valence/server":4,"@valence/client":3,"@valence/ui":1,"@valence/mobile":1,"@valence/tv":1}' + beside_landing='["@valence/landing","@valence/web","@valence/brand","@valence/lint","@valence/plugin-sdk","@valence/i18n","@valence/transcoder"]' { - echo "light=$(echo "$packages" | jq -c --argjson sharded "$sharded" '[.[] | select(. as $name | $sharded | has($name) | not)]')" + echo "light=$(echo "$packages" | jq -c --argjson sharded "$sharded" --argjson beside "$beside_landing" ' + [.[] | select(. as $name | $sharded | has($name) | not)] as $light + | [ {group: "landing", packages: [$light[] | select(. as $name | $beside | index($name))]}, + {group: "rest", packages: [$light[] | select(. as $name | $beside | index($name) | not)]} ] + | map(select(.packages | length > 0))')" echo "shards=$(echo "$packages" | jq -c --argjson sharded "$sharded" --arg screens "$screens" ' [ (.[] | select(. as $name | $sharded | has($name)) | . as $name | range(1; $sharded[$name] + 1) | {package: $name, shard: ., of: $sharded[$name]}), (if $screens == "true" then range(1; 7) | {package: "@valence/screens", shard: ., of: 6} else empty end) ]')" } >> "$GITHUB_OUTPUT" - build: - name: Build shared packages - needs: changes - if: needs.changes.outputs.code == 'true' - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - - uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 - - - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 - with: - node-version-file: .nvmrc - cache: pnpm - - - run: pnpm install --frozen-lockfile - - # Every package some other package's typecheck or test task needs as a `^build` dependency. - # Never a leaf app: nothing depends on one, and building one here would be waste (for - # `apps/web` today it would also surface a real but unrelated strictness gap between its own - # build and its typecheck script, worth its own fix). - - run: >- - pnpm turbo run build - --filter=@valence/i18n - --filter=@valence/contracts - --filter=@valence/core - --filter=@valence/plugin-sdk - --filter=@valence/ui - --filter=@valence/client - --filter=@valence/screens - - # Keyed on the commit rather than on source hashes: this cache only has to outlive the jobs in - # this one run, every one of which wants exactly what this commit built. - - uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 - with: - path: .turbo/cache - key: turbo-build-${{ github.sha }} - # Lint and typecheck share a runner. Lint needs no build and could start sooner, but a runner of - # its own held a slot through the minute the test shards all want one at once. + # its own held a slot through the minute the test shards all want one at once. Typecheck builds + # every package, so this job is also the one that leaves this commit's builds in the cache. typecheck: name: Lint, typecheck and migration check - needs: [changes, build] + needs: changes + if: needs.changes.outputs.code == 'true' runs-on: ubuntu-24.04 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -221,7 +192,7 @@ jobs: with: path: .turbo/cache key: turbo-build-${{ github.sha }} - fail-on-cache-miss: true + restore-keys: turbo-build- - run: pnpm lint @@ -233,14 +204,25 @@ jobs: - run: pnpm typecheck - # Every small package on one runner, two at a time. + # Keyed on the commit: the next run on this branch, or on a branch cut from it, restores the + # newest of these and rebuilds only what changed since. + - uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + with: + path: .turbo/cache + key: turbo-build-${{ github.sha }} + + # The small packages on two runners, two at a time on each. test: - name: Test the smaller packages - needs: [changes, build] + name: Test the smaller packages (${{ matrix.group }}) + needs: changes if: needs.changes.outputs.light != '[]' runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(needs.changes.outputs.light) }} env: - PACKAGES: ${{ needs.changes.outputs.light }} + PACKAGES: ${{ toJSON(matrix.packages) }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -259,13 +241,13 @@ jobs: with: path: .turbo/cache key: turbo-build-${{ github.sha }} - fail-on-cache-miss: true + restore-keys: turbo-build- - uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: .turbo/test-results - key: turbo-tests-light-${{ github.sha }} - restore-keys: turbo-tests-light- + key: turbo-tests-light-${{ matrix.group }}-${{ github.sha }} + restore-keys: turbo-tests-light-${{ matrix.group }}- - run: cp -n .turbo/test-results/* .turbo/cache/ 2>/dev/null || true @@ -283,7 +265,7 @@ jobs: - uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: .turbo/test-results - key: turbo-tests-light-${{ github.sha }} + key: turbo-tests-light-${{ matrix.group }}-${{ github.sha }} # Each shard is its own turbo task, told which shard it is through VITEST_SHARD, which turbo # folds into that task's hash alone. Passing the shard as an argument instead put it into the @@ -291,7 +273,7 @@ jobs: # them from the build job's cache. test-shards: name: Test ${{ matrix.package }} (${{ matrix.shard }} of ${{ matrix.of }}) - needs: [changes, build] + needs: changes if: needs.changes.outputs.shards != '[]' runs-on: ubuntu-24.04 strategy: @@ -318,7 +300,7 @@ jobs: with: path: .turbo/cache key: turbo-build-${{ github.sha }} - fail-on-cache-miss: true + restore-keys: turbo-build- - uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: @@ -328,6 +310,15 @@ jobs: - run: cp -n .turbo/test-results/* .turbo/cache/ 2>/dev/null || true + # What Babel made of React Native and the rest of node_modules, which is most of what the + # phone's and the television's Jest spend their time on. Keyed on what decides it, so it is + # made once per lockfile and read by every run after. + - if: matrix.package == '@valence/mobile' || matrix.package == '@valence/tv' + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + with: + path: apps/${{ matrix.package == '@valence/mobile' && 'mobile' || 'tv' }}/.jest-cache + key: jest-${{ matrix.package }}-${{ hashFiles('pnpm-lock.yaml', 'apps/mobile/jest.config.ts', 'apps/tv/jest.config.ts') }} + - run: pnpm turbo run test:shard --filter=${{ matrix.package }} - name: Keep the test results @@ -462,7 +453,7 @@ jobs: # on the pull requests that could change them. Every config plugin runs, so a broken one fails here # in review rather than on a macOS runner at release. Linux only: nothing is compiled. expo-prebuild: - name: Native config of the ${{ matrix.name }} (${{ matrix.platform }}) + name: Native config of the ${{ matrix.name }} runs-on: ubuntu-24.04 needs: changes if: needs.changes.outputs.expo == 'true' @@ -472,7 +463,6 @@ jobs: fail-fast: false matrix: name: [phone app, television app] - platform: [ios, android] include: - name: phone app app: mobile @@ -494,10 +484,13 @@ jobs: - run: pnpm install --frozen-lockfile - - name: Generate the native project + # Both platforms on one runner: generating each takes seconds, and a runner apiece spent a + # minute installing for every one of them while the test shards waited for a slot. + - name: Generate the native projects working-directory: apps/${{ matrix.app }} - run: npx expo prebuild --platform "$PLATFORM" --no-install --clean + run: | + npx expo prebuild --platform ios --no-install --clean + npx expo prebuild --platform android --no-install --clean env: - PLATFORM: ${{ matrix.platform }} EXPO_TV: ${{ matrix.tv }} CI: '1' diff --git a/.github/workflows/metrics.yml b/.github/workflows/metrics.yml index 4c2b195e6a..91fe6aab17 100644 --- a/.github/workflows/metrics.yml +++ b/.github/workflows/metrics.yml @@ -53,8 +53,10 @@ jobs: org.opencontainers.image.description=The public statistics site at metrics.getvalence.app org.opencontainers.image.licenses=MIT org.opencontainers.image.source=https://github.com/${{ github.repository }} - cache-from: type=gha,scope=valence-metrics - cache-to: type=gha,mode=max,scope=valence-metrics + # Kept in the registry beside the image rather than in the Actions cache, which every + # workflow shares and which this image's layers crowded the CI's dependencies out of. + cache-from: type=registry,ref=ghcr.io/valenceoss/valence-metrics:buildcache + cache-to: type=registry,ref=ghcr.io/valenceoss/valence-metrics:buildcache,mode=max,image-manifest=true,oci-mediatypes=true provenance: false deploy: diff --git a/.gitignore b/.gitignore index 73e93b5294..a4619aac29 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ node_modules/ dist/ coverage/ .turbo/ +.jest-cache/ *.tsbuildinfo target/ diff --git a/apps/docs/src/components/DocsSearch/DocsSearch.test.tsx b/apps/docs/src/components/DocsSearch/DocsSearch.test.tsx index fbd67e4a97..e0fc32cb4e 100644 --- a/apps/docs/src/components/DocsSearch/DocsSearch.test.tsx +++ b/apps/docs/src/components/DocsSearch/DocsSearch.test.tsx @@ -21,7 +21,7 @@ describe('DocsSearch', () => { }); it('opens a palette listing every page from the button', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); await renderInDocsRouter(() => ( @@ -36,7 +36,7 @@ describe('DocsSearch', () => { }); it('opens from Ctrl and K', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); await renderInDocsRouter(() => ( @@ -48,7 +48,7 @@ describe('DocsSearch', () => { it('reads the pages on first use and finds a match in their text', async () => { const read = vi.fn(() => Promise.resolve('---\ntitle: X\n---\nPut nginx in front of it.')); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); await renderInDocsRouter(() => ( { const [search] = await screen.findAllByRole('searchbox', { name: 'Find a component' }); - await userEvent.type(search ?? document.body, 'spinn'); + await userEvent.type(search ?? document.body, 'spinn', { delay: null }); const [list] = screen.getAllByRole('navigation', { name: 'Components' }); diff --git a/apps/landing/src/components/UiLibraryPage/components/UiLibrarySidebar/UiLibrarySidebar.test.tsx b/apps/landing/src/components/UiLibraryPage/components/UiLibrarySidebar/UiLibrarySidebar.test.tsx index 30d8e64edf..3cc34ccf78 100644 --- a/apps/landing/src/components/UiLibraryPage/components/UiLibrarySidebar/UiLibrarySidebar.test.tsx +++ b/apps/landing/src/components/UiLibraryPage/components/UiLibrarySidebar/UiLibrarySidebar.test.tsx @@ -29,7 +29,9 @@ describe('UiLibrarySidebar', () => { )); - await userEvent.type(screen.getByRole('searchbox', { name: 'Find a component' }), 'b'); + await userEvent.type(screen.getByRole('searchbox', { name: 'Find a component' }), 'b', { + delay: null, + }); expect(onQueryChange).toHaveBeenCalledWith('b'); }); diff --git a/apps/landing/src/components/UiLibraryPage/examples/demos/CommandPaletteDemo.test.tsx b/apps/landing/src/components/UiLibraryPage/examples/demos/CommandPaletteDemo.test.tsx index 66fa062594..f5bf3737b4 100644 --- a/apps/landing/src/components/UiLibraryPage/examples/demos/CommandPaletteDemo.test.tsx +++ b/apps/landing/src/components/UiLibraryPage/examples/demos/CommandPaletteDemo.test.tsx @@ -12,7 +12,9 @@ describe('CommandPaletteDemo', () => { render(); await userEvent.click(screen.getByRole('button', { name: 'Open the command palette' })); - await userEvent.type(await screen.findByPlaceholderText('Search commands'), 'scan'); + await userEvent.type(await screen.findByPlaceholderText('Search commands'), 'scan', { + delay: null, + }); expect(await screen.findByText('Scan every library')).toBeInTheDocument(); expect(screen.queryByText('Films')).not.toBeInTheDocument(); diff --git a/apps/mobile/jest.config.ts b/apps/mobile/jest.config.ts index 6658ab6cf3..f5741ea4c0 100644 --- a/apps/mobile/jest.config.ts +++ b/apps/mobile/jest.config.ts @@ -97,6 +97,7 @@ const config: Config = { '/../../packages/native/src/**/*.test.tsx', ], testTimeout: 20_000, + cacheDirectory: '/.jest-cache', coverageReporters: ['text', 'json-summary'], }; diff --git a/apps/tv/jest.config.ts b/apps/tv/jest.config.ts index ec319ae5cf..5d9723ac27 100644 --- a/apps/tv/jest.config.ts +++ b/apps/tv/jest.config.ts @@ -47,6 +47,7 @@ const whatNeedsCompiling = (): string[] => ); const EACH_TELEVISION: Config = { + cacheDirectory: '/.jest-cache', moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'mjs', 'json', 'node'], transform: { '^.+\\.[jt]sx?$': ['babel-jest', { presets: ['babel-preset-expo'] }], diff --git a/packages/client/vitest.config.ts b/packages/client/vitest.config.ts index 232ddb2e9d..c802437ecd 100644 --- a/packages/client/vitest.config.ts +++ b/packages/client/vitest.config.ts @@ -4,6 +4,7 @@ export default defineConfig({ resolve: { tsconfigPaths: true }, test: { environment: 'jsdom', + pool: 'threads', setupFiles: ['./vitest.setup.ts'], sequence: { hooks: 'list' }, testTimeout: 20_000, diff --git a/packages/screens/src/components/AccountArea/components/DeviceList/DeviceList.test.tsx b/packages/screens/src/components/AccountArea/components/DeviceList/DeviceList.test.tsx index 84c1e75621..8402edd775 100644 --- a/packages/screens/src/components/AccountArea/components/DeviceList/DeviceList.test.tsx +++ b/packages/screens/src/components/AccountArea/components/DeviceList/DeviceList.test.tsx @@ -104,7 +104,7 @@ describe('DeviceList', () => { }); it('signs one out on request, and asks again afterwards', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); fetchDevices.mockResolvedValue([device()]); @@ -118,7 +118,7 @@ describe('DeviceList', () => { }); it('offers to rename the device being used, but not to sign it out', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); fetchDevices.mockResolvedValue([device({ isCurrent: true })]); @@ -143,7 +143,7 @@ describe('DeviceList', () => { }); it('renames a device on request, and asks again afterwards', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); fetchDevices.mockResolvedValue([device()]); @@ -158,7 +158,7 @@ describe('DeviceList', () => { }); it('starts the rename with what the device was renamed to, and says what emptying it goes back to', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); fetchDevices.mockResolvedValue([ device({ @@ -182,7 +182,7 @@ describe('DeviceList', () => { }); it('gives a device back its own name when the name is emptied', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); fetchDevices.mockResolvedValue([device({ renamed: 'Work laptop' })]); @@ -195,7 +195,7 @@ describe('DeviceList', () => { }); it('says so when a device could not be renamed', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renameDevice.mockResolvedValue(false); fetchDevices.mockResolvedValue([device()]); @@ -236,7 +236,7 @@ describe('DeviceList', () => { }); it('signs out everywhere else on request', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); fetchDevices.mockResolvedValue([device({ isCurrent: true }), device({ id: 'session-2' })]); diff --git a/packages/screens/src/components/AccountArea/components/DeviceList/components/RenameDeviceDialog/RenameDeviceDialog.test.tsx b/packages/screens/src/components/AccountArea/components/DeviceList/components/RenameDeviceDialog/RenameDeviceDialog.test.tsx index a776f875a8..7a84fdbfd0 100644 --- a/packages/screens/src/components/AccountArea/components/DeviceList/components/RenameDeviceDialog/RenameDeviceDialog.test.tsx +++ b/packages/screens/src/components/AccountArea/components/DeviceList/components/RenameDeviceDialog/RenameDeviceDialog.test.tsx @@ -18,7 +18,7 @@ const draw = ( />, ); - return { onRename, onClose, actor: userEvent.setup() }; + return { onRename, onClose, actor: userEvent.setup({ delay: null }) }; }; describe('RenameDeviceDialog', () => { diff --git a/packages/screens/src/components/AddLibraryDialog/AddLibraryDialog.test.tsx b/packages/screens/src/components/AddLibraryDialog/AddLibraryDialog.test.tsx index 71f08b57cf..8a496f2836 100644 --- a/packages/screens/src/components/AddLibraryDialog/AddLibraryDialog.test.tsx +++ b/packages/screens/src/components/AddLibraryDialog/AddLibraryDialog.test.tsx @@ -48,7 +48,7 @@ const fillForm = async (actor: ReturnType) => { describe('AddLibraryDialog', () => { it('fills the path with a folder found by browsing the server', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); fetchFoldersMock.mockImplementation((path: string | null) => Promise.resolve( @@ -95,7 +95,7 @@ describe('AddLibraryDialog', () => { }); it('offers music, now that a music library is read from its tags', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await actor.click(screen.getByRole('button', { name: 'Music' })); @@ -104,7 +104,7 @@ describe('AddLibraryDialog', () => { }); it('switches kind on request', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await actor.click(screen.getByRole('button', { name: 'Shows' })); @@ -114,7 +114,7 @@ describe('AddLibraryDialog', () => { }); it('rejects an empty submission', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await actor.click(screen.getByRole('button', { name: 'Add library' })); @@ -125,7 +125,7 @@ describe('AddLibraryDialog', () => { it('creates the library and reports it', async () => { const onCreated = vi.fn(); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await fillForm(actor); @@ -143,7 +143,7 @@ describe('AddLibraryDialog', () => { }); it('adds anime as a library of its own kind', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await actor.click(screen.getByRole('button', { name: 'Anime' })); @@ -160,7 +160,7 @@ describe('AddLibraryDialog', () => { }); it('adds manga as a library of books under its own name', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await actor.click(screen.getByRole('button', { name: 'Manga' })); @@ -178,7 +178,7 @@ describe('AddLibraryDialog', () => { }); it('adds a custom type, read like one of the built-in kinds', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await actor.click(screen.getByRole('button', { name: 'Custom' })); @@ -198,7 +198,7 @@ describe('AddLibraryDialog', () => { }); it('asks for a name for a custom type before adding it', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await actor.click(screen.getByRole('button', { name: 'Custom' })); @@ -218,7 +218,7 @@ describe('AddLibraryDialog', () => { it('shows the server error and keeps the dialog open', async () => { createLibraryMock.mockRejectedValue(new Error('The path is not a readable directory.')); const onCreated = vi.fn(); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await fillForm(actor); @@ -229,7 +229,7 @@ describe('AddLibraryDialog', () => { }); it('resets the form on cancel', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await fillForm(actor); diff --git a/packages/screens/src/components/AdminArea/AdminArea.test.tsx b/packages/screens/src/components/AdminArea/AdminArea.test.tsx index a073bb5703..7d39d4abae 100644 --- a/packages/screens/src/components/AdminArea/AdminArea.test.tsx +++ b/packages/screens/src/components/AdminArea/AdminArea.test.tsx @@ -793,7 +793,7 @@ describe('AdminArea', () => { }); it('says the VPN is down above everything else', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); await openTheBell(actor); @@ -844,7 +844,7 @@ describe('AdminArea', () => { return otherwise(input, init); }); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); await openTheBell(actor); @@ -867,7 +867,7 @@ describe('AdminArea', () => { }); it('tells the address when the panel changes, so a reload can return to it', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onPanel = vi.fn(); renderInAnAddress(); @@ -905,7 +905,7 @@ describe('AdminArea', () => { : otherwise(input, init), ); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -942,7 +942,7 @@ describe('AdminArea', () => { : otherwise(input, init), ); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onPanel = vi.fn<(panel: string, search?: ObservabilitySearch) => void>(); renderInAnAddress(); @@ -960,7 +960,7 @@ describe('AdminArea', () => { }); it('lets an admin start any job on demand from the Work tab', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -988,7 +988,7 @@ describe('AdminArea', () => { : respondWith()(input, init), ); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1014,7 +1014,7 @@ describe('AdminArea', () => { }); it('asks for confirmation before running Reset and rebuild from the Work tab', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1031,7 +1031,7 @@ describe('AdminArea', () => { }); it('opens a job schedule over the list from its schedule button', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1046,7 +1046,7 @@ describe('AdminArea', () => { }); it('adds a trigger to a job from its own schedule page', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1072,7 +1072,7 @@ describe('AdminArea', () => { }); it('removes a trigger from a job schedule page', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1094,7 +1094,7 @@ describe('AdminArea', () => { }); it('closes a schedule without leaving the job list', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1109,7 +1109,7 @@ describe('AdminArea', () => { }); it('lets an operator set the catalogue key', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1133,7 +1133,7 @@ describe('AdminArea', () => { }); it('keeps who has an account out of settings, since Accounts is where they live', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1210,7 +1210,7 @@ describe('AdminArea', () => { fetchMock.mockImplementation(respondWith(OVERVIEW, [session])); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); await actor.click(await screen.findByRole('button', { name: /^Actions for/ })); @@ -1225,7 +1225,7 @@ describe('AdminArea', () => { }); it('lists the library roots', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1236,7 +1236,7 @@ describe('AdminArea', () => { }); it("opens a library's settings from its name", async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1248,7 +1248,7 @@ describe('AdminArea', () => { }); it('adds a library from the dialog', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1269,7 +1269,7 @@ describe('AdminArea', () => { }); it('scans a library on request', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1284,7 +1284,7 @@ describe('AdminArea', () => { }); it('offers to scan every library at once, forcing a fresh probe of each', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1300,7 +1300,7 @@ describe('AdminArea', () => { }); it('marks every library in one press as the same scan, so it is reported once', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1323,7 +1323,7 @@ describe('AdminArea', () => { }); it('asks before resetting every library', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1340,7 +1340,7 @@ describe('AdminArea', () => { }); it('clears and rebuilds every library once the operator confirms', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1361,7 +1361,7 @@ describe('AdminArea', () => { }); it('does nothing when the operator backs out of the reset', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1391,7 +1391,7 @@ describe('AdminArea', () => { input === scanUrl ? new Promise(() => undefined) : respondWith()(input, init), ); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1404,7 +1404,7 @@ describe('AdminArea', () => { it('reports how many files have actually been probed as the scan goes', async () => { vi.useFakeTimers({ shouldAdvanceTime: true }); - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); const scanUrl = `/api/libraries/${MOVIES_LIBRARY_ID}/scan`; let readings = 0; @@ -1464,7 +1464,7 @@ describe('AdminArea', () => { it('moves the label on to the next stage once probing finishes', async () => { vi.useFakeTimers({ shouldAdvanceTime: true }); - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); const scanUrl = `/api/libraries/${MOVIES_LIBRARY_ID}/scan`; let readings = 0; @@ -1544,7 +1544,7 @@ describe('AdminArea', () => { return respondWith()(input, init); }); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1563,7 +1563,7 @@ describe('AdminArea', () => { : respondWith()(input, init), ); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1632,7 +1632,7 @@ describe('AdminArea', () => { withNoLibraries(); window.localStorage.setItem('valence.setupGuideVisited', 'true'); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1644,7 +1644,7 @@ describe('AdminArea', () => { }); it('opens the settings from the guide, where the key is entered', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1654,7 +1654,7 @@ describe('AdminArea', () => { }); it('can be put away, and stays away', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1699,7 +1699,7 @@ describe('AdminArea', () => { }; it('reports what was found when nobody has insisted', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); await openGraphicsInfo(actor); @@ -1709,7 +1709,7 @@ describe('AdminArea', () => { it('stops claiming hardware once software only is forced', async () => { fetchMock.mockImplementation(withAccel('none')); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); await openGraphicsInfo(actor); @@ -1720,7 +1720,7 @@ describe('AdminArea', () => { it('reports the forced backend rather than the automatic pick', async () => { fetchMock.mockImplementation(withAccel('nvenc')); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); renderInAnAddress(); await openGraphicsInfo(actor); @@ -1759,7 +1759,7 @@ describe('steering somebody else’s stream', () => { }; const onTheSessionsTab = async (session: FakeSession = WATCHING) => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); fetchMock.mockImplementation(respondWith(OVERVIEW, [session])); diff --git a/packages/screens/src/components/AdminArea/components/AccountsPanel/AccountsPanel.test.tsx b/packages/screens/src/components/AdminArea/components/AccountsPanel/AccountsPanel.test.tsx index 652705adb9..0063cd96d8 100644 --- a/packages/screens/src/components/AdminArea/components/AccountsPanel/AccountsPanel.test.tsx +++ b/packages/screens/src/components/AdminArea/components/AccountsPanel/AccountsPanel.test.tsx @@ -326,7 +326,7 @@ describe('AccountsPanel', () => { describe('banning', () => { it('bans somebody', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await confirm(user, 'Dan', /^Ban$/, 'Ban'); @@ -348,7 +348,7 @@ describe('AccountsPanel', () => { it('offers to let a banned account back in rather than banning it again', async () => { accountMocks.fetchAccounts.mockResolvedValue([account({ isBanned: true })]); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await choose(user, 'Dan', /Unban/); @@ -362,7 +362,7 @@ describe('AccountsPanel', () => { message: 'That would leave no administrators on this server.', }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await confirm(user, 'Dan', /^Ban$/, 'Ban'); @@ -375,7 +375,7 @@ describe('AccountsPanel', () => { describe('adding somebody', () => { it('will not add without a name', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await openInvite(user); @@ -385,7 +385,7 @@ describe('AccountsPanel', () => { }); it('adds somebody with only a name and hands over their setup link', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await openInvite(user); @@ -406,7 +406,7 @@ describe('AccountsPanel', () => { }), ); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await openInvite(user); @@ -428,7 +428,7 @@ describe('AccountsPanel', () => { }); it('keeps the link it just made to copy again from the list', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); accountMocks.fetchAccounts.mockResolvedValue([ ...ACCOUNTS, @@ -476,7 +476,7 @@ describe('AccountsPanel', () => { it('shows only those waiting when asked', async () => { accountMocks.fetchAccounts.mockResolvedValue([...ACCOUNTS, WAITING]); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await user.click(await screen.findByRole('button', { name: 'Filter accounts' })); @@ -491,7 +491,7 @@ describe('AccountsPanel', () => { account({ ...WAITING, setup: { state: 'expired', expiresAt: '2026-01-01T00:00:00.000Z' } }), ]); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); expect(await screen.findByText('Link expired')).toBeInTheDocument(); @@ -503,7 +503,7 @@ describe('AccountsPanel', () => { }); it('offers an account in use a link to choose a new password', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await choose(user, 'Dan', /Send a setup link/); @@ -515,7 +515,7 @@ describe('AccountsPanel', () => { linkMocks.canEmailSetupLinks = true; accountMocks.fetchAccounts.mockResolvedValue([...ACCOUNTS, WAITING]); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await choose(user, 'Dan', /Send by email/); @@ -537,7 +537,7 @@ describe('AccountsPanel', () => { }); it('changes a username from the editor', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await choose(user, 'Dan', /Edit account/); @@ -555,7 +555,7 @@ describe('AccountsPanel', () => { describe('removing', () => { it('removes somebody', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await confirm(user, 'Dan', /Delete account/, 'Delete account'); @@ -568,7 +568,7 @@ describe('AccountsPanel', () => { message: 'You can’t do that to your own account.', }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await confirm(user, 'Dan', /Delete account/, 'Delete account'); @@ -578,7 +578,7 @@ describe('AccountsPanel', () => { }); it('opens somebody for editing, named as theirs', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await choose(user, 'Dan', /Edit account/); @@ -587,7 +587,7 @@ describe('AccountsPanel', () => { }); it('closes the editor without having to pick another account', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await choose(user, 'Dan', /Edit account/); @@ -599,7 +599,7 @@ describe('AccountsPanel', () => { }); it('keeps what is being changed when the account is read again behind it', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await editRoles(user); @@ -643,7 +643,7 @@ describe('AccountsPanel', () => { it('reads the account again when a save stops part-way, so what did land shows', async () => { mocks.assignRole.mockResolvedValue({ message: 'That role is equal to or higher than yours.' }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await editRoles(user); @@ -672,7 +672,7 @@ describe('AccountsPanel', () => { message: 'That role is equal to or higher than yours.', }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await editRoles(user); @@ -709,7 +709,7 @@ describe('AccountsPanel', () => { it('offers no roles to somebody who may not give them', async () => { granted.withheld.add('account.roles'); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await choose(user, 'Dan', /Edit account/); @@ -723,7 +723,7 @@ describe('AccountsPanel', () => { it('offers no ban to somebody who may not ban', async () => { granted.withheld.add('account.manage'); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await user.click(await screen.findByRole('button', { name: 'Actions for Dan' })); @@ -733,7 +733,7 @@ describe('AccountsPanel', () => { }); it('will not save until something has changed', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await editRoles(user); @@ -743,7 +743,7 @@ describe('AccountsPanel', () => { describe('roles', () => { it('marks the ones they hold', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await editRoles(user); @@ -755,7 +755,7 @@ describe('AccountsPanel', () => { }); it('gives one they do not hold', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await editRoles(user); @@ -768,7 +768,7 @@ describe('AccountsPanel', () => { }); it('takes back one they do', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await editRoles(user); @@ -781,7 +781,7 @@ describe('AccountsPanel', () => { }); it('changes nothing until saved', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await editRoles(user); @@ -791,7 +791,7 @@ describe('AccountsPanel', () => { }); it('reads their permissions again once a change lands', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await editRoles(user); @@ -810,7 +810,7 @@ describe('AccountsPanel', () => { message: 'That role is equal to or higher than yours.', }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await editRoles(user); @@ -825,7 +825,7 @@ describe('AccountsPanel', () => { message: 'That would leave no administrators on this server.', }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await editRoles(user); @@ -838,7 +838,7 @@ describe('AccountsPanel', () => { }); it('says nothing when the server was happy', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await editRoles(user); @@ -883,7 +883,7 @@ describe('which libraries an account may see', () => { }); it('shows each one, and whether it may be seen', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -897,7 +897,7 @@ describe('which libraries an account may see', () => { }); it('says plainly that an untouched account sees everything', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -909,7 +909,7 @@ describe('which libraries an account may see', () => { }); it('takes one away when asked', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -923,7 +923,7 @@ describe('which libraries an account may see', () => { }); it('gives one back when asked', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); accessMocks.fetchLibraryAccess.mockResolvedValue([ { id: FILMS, name: 'Films', mayView: false, maximumAge: null, allowsUnrated: false }, @@ -942,7 +942,7 @@ describe('which libraries an account may see', () => { }); it('warns where an account has been left able to reach nothing', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); accessMocks.fetchLibraryAccess.mockResolvedValue([ { id: FILMS, name: 'Films', mayView: false, maximumAge: null, allowsUnrated: false }, @@ -957,7 +957,7 @@ describe('which libraries an account may see', () => { }); it('says nothing of the sort while they can still reach one', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -968,7 +968,7 @@ describe('which libraries an account may see', () => { }); it('copes with a server that has no libraries yet', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); accessMocks.fetchLibraryAccess.mockResolvedValue([]); @@ -1005,7 +1005,7 @@ describe('the age an account is limited to', () => { }); it('says there is no ceiling until somebody sets one', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1015,7 +1015,7 @@ describe('the age an account is limited to', () => { }); it('sets one for that library alone', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1035,7 +1035,7 @@ describe('the age an account is limited to', () => { }); it('lifts one again', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); accessMocks.fetchLibraryAccess.mockResolvedValue([ { id: FILMS, name: 'Films', mayView: true, maximumAge: 12, allowsUnrated: false }, @@ -1056,7 +1056,7 @@ describe('the age an account is limited to', () => { }); it('offers the unrated escape only once a ceiling exists', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -1067,7 +1067,7 @@ describe('the age an account is limited to', () => { }); it('turns the unrated escape on without losing the ceiling', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); accessMocks.fetchLibraryAccess.mockResolvedValue([ { id: FILMS, name: 'Films', mayView: true, maximumAge: 15, allowsUnrated: false }, @@ -1088,7 +1088,7 @@ describe('the age an account is limited to', () => { }); it('says a limit reaches every profile on the account, and to narrow a profile instead', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); accessMocks.fetchLibraryAccess.mockResolvedValue([ { id: FILMS, name: 'Films', mayView: true, maximumAge: 12, allowsUnrated: false }, @@ -1103,7 +1103,7 @@ describe('the age an account is limited to', () => { }); it('says nothing of the sort while no limit is set', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); diff --git a/packages/screens/src/components/AdminArea/components/AccountsPanel/components/AddAccountDialog/AddAccountDialog.test.tsx b/packages/screens/src/components/AdminArea/components/AccountsPanel/components/AddAccountDialog/AddAccountDialog.test.tsx index 0c154e8ae7..f95211cfde 100644 --- a/packages/screens/src/components/AdminArea/components/AccountsPanel/components/AddAccountDialog/AddAccountDialog.test.tsx +++ b/packages/screens/src/components/AdminArea/components/AccountsPanel/components/AddAccountDialog/AddAccountDialog.test.tsx @@ -58,7 +58,7 @@ describe('AddAccountDialog', () => { const told = open(); - await userEvent.type(screen.getByLabelText('Name'), 'Ada'); + await userEvent.type(screen.getByLabelText('Name'), 'Ada', { delay: null }); await userEvent.click(screen.getByRole('button', { name: '30 days' })); await userEvent.click(screen.getByRole('button', { name: 'Add' })); @@ -85,14 +85,18 @@ describe('AddAccountDialog', () => { const told = open(); - await userEvent.type(screen.getByLabelText('Name'), 'Ada'); - await userEvent.type(screen.getByLabelText('Email (optional)'), 'ada@example.com'); + await userEvent.type(screen.getByLabelText('Name'), 'Ada', { delay: null }); + await userEvent.type(screen.getByLabelText('Email (optional)'), 'ada@example.com', { + delay: null, + }); await userEvent.click(screen.getByRole('button', { name: 'Set a password for them' })); await userEvent.click(screen.getByRole('button', { name: 'Add' })); expect(inviteAccount).not.toHaveBeenCalled(); - await userEvent.type(screen.getByLabelText('Password'), 'a-long-enough-password'); + await userEvent.type(screen.getByLabelText('Password'), 'a-long-enough-password', { + delay: null, + }); await userEvent.click(screen.getByRole('button', { name: 'Add' })); expect(inviteAccount).toHaveBeenCalledWith({ @@ -111,8 +115,8 @@ describe('AddAccountDialog', () => { open(); - await userEvent.type(screen.getByLabelText('Name'), 'Ada'); - await userEvent.type(screen.getByLabelText('Username (optional)'), 'sam'); + await userEvent.type(screen.getByLabelText('Name'), 'Ada', { delay: null }); + await userEvent.type(screen.getByLabelText('Username (optional)'), 'sam', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Add' })); expect(await screen.findByText('That username is already in use.')).toBeInTheDocument(); @@ -128,7 +132,7 @@ describe('AddAccountDialog', () => { open(true); - await userEvent.type(screen.getByLabelText('Name'), 'Ada'); + await userEvent.type(screen.getByLabelText('Name'), 'Ada', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Add' })); await userEvent.click(await screen.findByRole('button', { name: /Send by email/ })); @@ -143,7 +147,7 @@ describe('AddAccountDialog', () => { const told = open(); - await userEvent.type(screen.getByLabelText('Name'), 'Ada'); + await userEvent.type(screen.getByLabelText('Name'), 'Ada', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Add' })); await userEvent.click(await screen.findByRole('button', { name: 'Edit account' })); diff --git a/packages/screens/src/components/AdminArea/components/AccountsPanel/components/BanDialog/BanDialog.test.tsx b/packages/screens/src/components/AdminArea/components/AccountsPanel/components/BanDialog/BanDialog.test.tsx index e690127709..18e5b26e0f 100644 --- a/packages/screens/src/components/AdminArea/components/AccountsPanel/components/BanDialog/BanDialog.test.tsx +++ b/packages/screens/src/components/AdminArea/components/AccountsPanel/components/BanDialog/BanDialog.test.tsx @@ -12,7 +12,7 @@ describe('BanDialog', () => { const reason = screen.getByLabelText('Reason shown to them'); await userEvent.clear(reason); - await userEvent.type(reason, 'Sharing the password around'); + await userEvent.type(reason, 'Sharing the password around', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Ban' })); expect(onBan).toHaveBeenCalledWith('Sharing the password around'); diff --git a/packages/screens/src/components/AdminArea/components/AddTriggerDialog/AddTriggerDialog.test.tsx b/packages/screens/src/components/AdminArea/components/AddTriggerDialog/AddTriggerDialog.test.tsx index 81bd3d0f54..2f6c4c0d3a 100644 --- a/packages/screens/src/components/AdminArea/components/AddTriggerDialog/AddTriggerDialog.test.tsx +++ b/packages/screens/src/components/AdminArea/components/AddTriggerDialog/AddTriggerDialog.test.tsx @@ -20,7 +20,7 @@ const pick = async ( describe('AddTriggerDialog', () => { it('offers every trigger type Valence can schedule on', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(build()); await user.click(screen.getByRole('button', { name: 'Trigger type' })); @@ -32,7 +32,7 @@ describe('AddTriggerDialog', () => { it('adds a daily trigger at the time given', async () => { const onAdd = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(build({ onAdd })); await user.clear(screen.getByLabelText('Time')); @@ -44,7 +44,7 @@ describe('AddTriggerDialog', () => { it('asks for a day only once the trigger is weekly', async () => { const onAdd = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(build({ onAdd })); expect(screen.queryByRole('button', { name: 'Day' })).toBeNull(); @@ -58,7 +58,7 @@ describe('AddTriggerDialog', () => { it('adds an interval in hours', async () => { const onAdd = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(build({ onAdd })); await pick(user, 'Trigger type', 'On an interval'); @@ -71,7 +71,7 @@ describe('AddTriggerDialog', () => { it('adds an interval in minutes when the unit is switched', async () => { const onAdd = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(build({ onAdd })); await pick(user, 'Trigger type', 'On an interval'); @@ -85,7 +85,7 @@ describe('AddTriggerDialog', () => { it('will not add an interval cron could not express', async () => { const onAdd = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(build({ onAdd })); await pick(user, 'Trigger type', 'On an interval'); @@ -100,7 +100,7 @@ describe('AddTriggerDialog', () => { it('adds a startup trigger with nothing else to answer', async () => { const onAdd = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(build({ onAdd })); await pick(user, 'Trigger type', 'On application startup'); @@ -114,7 +114,7 @@ describe('AddTriggerDialog', () => { it('will not add a trigger whose time has been cleared', async () => { const onAdd = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(build({ onAdd })); await user.clear(screen.getByLabelText('Time')); @@ -126,7 +126,7 @@ describe('AddTriggerDialog', () => { it('closes when Cancel is pressed', async () => { const onClose = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(build({ onClose })); await user.click(screen.getByRole('button', { name: 'Cancel' })); diff --git a/packages/screens/src/components/AdminArea/components/AnnouncementCard/AnnouncementCard.test.tsx b/packages/screens/src/components/AdminArea/components/AnnouncementCard/AnnouncementCard.test.tsx index 770b0835c6..070f194862 100644 --- a/packages/screens/src/components/AdminArea/components/AnnouncementCard/AnnouncementCard.test.tsx +++ b/packages/screens/src/components/AdminArea/components/AnnouncementCard/AnnouncementCard.test.tsx @@ -16,7 +16,7 @@ beforeEach(() => { describe('AnnouncementCard', () => { it('posts what was written, as serious as chosen, for as long as chosen', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -32,7 +32,7 @@ describe('AnnouncementCard', () => { }); it('sets an end where it is to stay up for a while', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -59,7 +59,7 @@ describe('AnnouncementCard', () => { endsAt: null, postedAt: '2026-10-15T09:00:00.000Z', }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); diff --git a/packages/screens/src/components/AdminArea/components/ArrAppDialog/ArrAppDialog.test.tsx b/packages/screens/src/components/AdminArea/components/ArrAppDialog/ArrAppDialog.test.tsx index 12059e359a..88ef0efd2c 100644 --- a/packages/screens/src/components/AdminArea/components/ArrAppDialog/ArrAppDialog.test.tsx +++ b/packages/screens/src/components/AdminArea/components/ArrAppDialog/ArrAppDialog.test.tsx @@ -57,7 +57,7 @@ const open = (app: ArrApp | null = null) => { describe('ArrAppDialog', () => { it('connects a Sonarr, named and addressed for what it is, with its key', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onSaved, onClose } = open(); await user.click(screen.getByRole('button', { name: 'Sonarr' })); @@ -80,7 +80,7 @@ describe('ArrAppDialog', () => { }); it('asks a Prowlarr nothing of where its library is', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -93,7 +93,7 @@ describe('ArrAppDialog', () => { }); it('says what is missing before connecting', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -104,7 +104,7 @@ describe('ArrAppDialog', () => { }); it('changes an app, keeping its key, and tries it with the key it has', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onSaved } = open(KEPT); await user.click(screen.getByRole('button', { name: /^Test/ })); @@ -126,7 +126,7 @@ describe('ArrAppDialog', () => { }); it('says nothing of a try still answering once another app is opened', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); let answer: (given: Awaited>) => void = () => undefined; tryArrApp.mockReturnValue( @@ -158,7 +158,7 @@ describe('ArrAppDialog', () => { }); it('says nothing of a try left running when it was closed, once the same app opens again', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); let answer: (given: Awaited>) => void = () => undefined; tryArrApp.mockReturnValueOnce( @@ -185,7 +185,7 @@ describe('ArrAppDialog', () => { }); it('says why a try or a save did not go through', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); tryArrApp.mockResolvedValue({ value: { diff --git a/packages/screens/src/components/AdminArea/components/AskForMediaDialog/AskForMediaDialog.test.tsx b/packages/screens/src/components/AdminArea/components/AskForMediaDialog/AskForMediaDialog.test.tsx index 1e869639f1..67ac3cb3cf 100644 --- a/packages/screens/src/components/AdminArea/components/AskForMediaDialog/AskForMediaDialog.test.tsx +++ b/packages/screens/src/components/AdminArea/components/AskForMediaDialog/AskForMediaDialog.test.tsx @@ -138,7 +138,7 @@ describe('AskForMediaDialog', () => { it('searches the indexers instead, for something no catalogue knows', async () => { open(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); await user.click(await screen.findByRole('button', { name: 'Search the indexers' })); @@ -151,7 +151,7 @@ describe('AskForMediaDialog', () => { }); it('finds a film in the catalogue and asks for it in the quality chosen', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onAsked, onClose } = open(); await user.type(screen.getByRole('searchbox', { name: 'Search for a film' }), 'Dune'); @@ -178,7 +178,7 @@ describe('AskForMediaDialog', () => { }); it('watches an artist found in MusicBrainz for the kinds of release ticked', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onAsked } = open(); await pickKind(user, 'Artists'); @@ -213,7 +213,7 @@ describe('AskForMediaDialog', () => { }); it('asks for one album, with no kinds of release to choose', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -236,7 +236,7 @@ describe('AskForMediaDialog', () => { }); it('asks for every season once each regular one is ticked, leaving Specials out', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -267,7 +267,7 @@ describe('AskForMediaDialog', () => { }); it('finds releases before asking, and asks only once one is picked', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onAsked } = open(); await user.type(screen.getByRole('searchbox', { name: 'Search for a film' }), 'Dune'); @@ -295,7 +295,7 @@ describe('AskForMediaDialog', () => { }); it('says why releases could not be found, making nothing', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); findReleasesFor.mockResolvedValue({ value: null, @@ -314,7 +314,7 @@ describe('AskForMediaDialog', () => { }); it('says why it could not be asked for, and lets another be chosen', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); askForMedia.mockResolvedValue({ value: null, @@ -337,7 +337,7 @@ describe('AskForMediaDialog', () => { }); it('says when the catalogue has nothing under a name', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); searchCatalogue.mockResolvedValue([]); open(); @@ -349,7 +349,7 @@ describe('AskForMediaDialog', () => { }); it('says why the catalogue could not be searched', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); searchCatalogue.mockResolvedValue({ problem: 'TMDB is limiting how often Valence can ask. Try again in a minute.', @@ -366,7 +366,7 @@ describe('AskForMediaDialog', () => { }); it('says why MusicBrainz could not be searched, rather than that it knows nothing', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); searchMusicCatalogue.mockRejectedValue( new RequestFailed('/api/requests/catalogue/music', 503, false, 'Couldn’t reach MusicBrainz.'), diff --git a/packages/screens/src/components/AdminArea/components/AuditPanel/AuditPanel.test.tsx b/packages/screens/src/components/AdminArea/components/AuditPanel/AuditPanel.test.tsx index 9298f99f2b..78eff82f1e 100644 --- a/packages/screens/src/components/AdminArea/components/AuditPanel/AuditPanel.test.tsx +++ b/packages/screens/src/components/AdminArea/components/AuditPanel/AuditPanel.test.tsx @@ -137,6 +137,7 @@ describe('AuditPanel', () => { await userEvent.type( await screen.findByRole('searchbox', { name: 'Search the audit log' }), 'tom', + { delay: null }, ); await waitFor(() => { @@ -202,7 +203,11 @@ describe('AuditPanel', () => { await userEvent.click(await screen.findByRole('button', { name: 'Next page' })); expect(await screen.findByText('Person 26')).toBeInTheDocument(); - await userEvent.type(screen.getByRole('searchbox', { name: 'Search the audit log' }), 'Person'); + await userEvent.type( + screen.getByRole('searchbox', { name: 'Search the audit log' }), + 'Person', + { delay: null }, + ); expect(await screen.findByText('Person 1')).toBeInTheDocument(); expect(screen.queryByText('Person 26')).not.toBeInTheDocument(); diff --git a/packages/screens/src/components/AdminArea/components/CataloguePanel/CataloguePanel.test.tsx b/packages/screens/src/components/AdminArea/components/CataloguePanel/CataloguePanel.test.tsx index 78d97a5e56..790dba0842 100644 --- a/packages/screens/src/components/AdminArea/components/CataloguePanel/CataloguePanel.test.tsx +++ b/packages/screens/src/components/AdminArea/components/CataloguePanel/CataloguePanel.test.tsx @@ -119,13 +119,13 @@ describe('CataloguePanel', () => { expect(screen.getByRole('radio', { name: /Everything\s*2/ })).toBeChecked(); expect(screen.getByRole('radio', { name: /To approve\s*1/ })).toBeInTheDocument(); - await userEvent.setup().click(screen.getByRole('button', { name: /Held Film/ })); + await userEvent.setup({ delay: null }).click(screen.getByRole('button', { name: /Held Film/ })); expect(onOpen).toHaveBeenCalledWith('film:1'); }); it('narrows to a status from its tile', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); aPanel(); @@ -136,7 +136,7 @@ describe('CataloguePanel', () => { }); it('switches to another kind of library', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onTab } = aPanel(); await user.click(await screen.findByRole('button', { name: 'Kind of library' })); @@ -146,7 +146,7 @@ describe('CataloguePanel', () => { }); it('says which kind of library holds failed requests, counted as the badge counts them', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const lost = aMediaRequest({ id: '6ba7b810-9dad-11d1-80b4-00c04fd43004', state: 'failed' }); const gone = aMediaRequest({ id: '6ba7b810-9dad-11d1-80b4-00c04fd43005', state: 'failed' }); @@ -217,7 +217,7 @@ describe('CataloguePanel', () => { }); it('approves several titles waiting on approval at once', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); aPanel(); @@ -231,7 +231,7 @@ describe('CataloguePanel', () => { }); it('leaves out of a decision a chosen title the search has since hidden', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); aPanel(); @@ -245,7 +245,7 @@ describe('CataloguePanel', () => { it('searches for everything missing', async () => { aPanel(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); await user.click(await screen.findByRole('button', { name: 'Search all missing' })); await user.click(await screen.findByRole('button', { name: 'Search' })); @@ -256,7 +256,7 @@ describe('CataloguePanel', () => { }); it('finds titles by name', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); aPanel(); @@ -267,7 +267,7 @@ describe('CataloguePanel', () => { }); it('narrows a tab to one library where the server has several of its kind', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); held.kinds = ['movies', 'movies', 'shows']; catalogue.entries = [ @@ -292,7 +292,7 @@ describe('CataloguePanel', () => { }); it('offers no kind of library the server lacks', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); aPanel(); diff --git a/packages/screens/src/components/AdminArea/components/CorrectionPicker/CorrectionPicker.test.tsx b/packages/screens/src/components/AdminArea/components/CorrectionPicker/CorrectionPicker.test.tsx index cb76791889..4be8bd2098 100644 --- a/packages/screens/src/components/AdminArea/components/CorrectionPicker/CorrectionPicker.test.tsx +++ b/packages/screens/src/components/AdminArea/components/CorrectionPicker/CorrectionPicker.test.tsx @@ -67,7 +67,7 @@ describe('CorrectionPicker', () => { await screen.findByRole('button', { name: 'The Black Parade' }); await userEvent.clear(screen.getByLabelText('Album')); - await userEvent.type(screen.getByLabelText('Album'), 'Danger Days'); + await userEvent.type(screen.getByLabelText('Album'), 'Danger Days', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Search' })); await waitFor(() => { diff --git a/packages/screens/src/components/AdminArea/components/DownloadClientDialog/DownloadClientDialog.test.tsx b/packages/screens/src/components/AdminArea/components/DownloadClientDialog/DownloadClientDialog.test.tsx index a67c9eb06d..4228964869 100644 --- a/packages/screens/src/components/AdminArea/components/DownloadClientDialog/DownloadClientDialog.test.tsx +++ b/packages/screens/src/components/AdminArea/components/DownloadClientDialog/DownloadClientDialog.test.tsx @@ -78,7 +78,7 @@ const fillIn = async (user: ReturnType) => { describe('DownloadClientDialog', () => { it('adds a qBittorrent client, named for what it is, with its login', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onSaved, onClose } = open(); await user.click(screen.getByRole('button', { name: 'qBittorrent' })); @@ -118,7 +118,7 @@ describe('DownloadClientDialog', () => { }); it('opens empty to add another, not on the one last added', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const handlers = { onClose: vi.fn(), onSaved: vi.fn() }; const { rerender } = renderInAnAddress( , @@ -132,7 +132,7 @@ describe('DownloadClientDialog', () => { }); it('says nothing of a test left running when it was closed, once it opens again', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const handlers = { onClose: vi.fn(), onSaved: vi.fn() }; let answer: (value: Awaited>) => void = () => {}; @@ -164,7 +164,7 @@ describe('DownloadClientDialog', () => { }); it('asks SABnzbd for its API key instead of a login', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -185,7 +185,7 @@ describe('DownloadClientDialog', () => { }); it('keeps a name somebody typed when the kind changes', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -199,7 +199,7 @@ describe('DownloadClientDialog', () => { }); it('shows a tick once it answered', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -224,7 +224,7 @@ describe('DownloadClientDialog', () => { refusal: null, }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -251,7 +251,7 @@ describe('DownloadClientDialog', () => { }); tryDownloadClient.mockResolvedValueOnce({ value: null, refusal: null }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -271,7 +271,7 @@ describe('DownloadClientDialog', () => { }); it('forgets how the last try went once something changes', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -285,7 +285,7 @@ describe('DownloadClientDialog', () => { }); it('says what is wrong before trying or saving anything', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -307,7 +307,7 @@ describe('DownloadClientDialog', () => { }); addDownloadClient.mockResolvedValueOnce({ value: null, refusal: null }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onSaved } = open(); await user.click(screen.getByRole('button', { name: 'qBittorrent' })); @@ -323,7 +323,7 @@ describe('DownloadClientDialog', () => { }); it('changes a kept client, keeping its password unless a new one is typed', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(KEPT); @@ -409,7 +409,7 @@ describe('DownloadClientDialog', () => { somePluginContributions({ downloadClients: [OFFERED] }), ); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); diff --git a/packages/screens/src/components/AdminArea/components/EmailCard/EmailCard.test.tsx b/packages/screens/src/components/AdminArea/components/EmailCard/EmailCard.test.tsx index 1cac3b0f2a..e53f9203c1 100644 --- a/packages/screens/src/components/AdminArea/components/EmailCard/EmailCard.test.tsx +++ b/packages/screens/src/components/AdminArea/components/EmailCard/EmailCard.test.tsx @@ -99,7 +99,9 @@ describe('EmailCard', () => { fetchEmailSetup.mockResolvedValue({ ...SETUP, isEnabled: true }); renderInAnAddress(); - await userEvent.type(await screen.findByLabelText('Send test email to'), 'ada@example.com'); + await userEvent.type(await screen.findByLabelText('Send test email to'), 'ada@example.com', { + delay: null, + }); await userEvent.click(screen.getByRole('button', { name: 'Send' })); expect( diff --git a/packages/screens/src/components/AdminArea/components/FolderBrowser/FolderBrowser.test.tsx b/packages/screens/src/components/AdminArea/components/FolderBrowser/FolderBrowser.test.tsx index 265037a18c..5d6ac2bc7b 100644 --- a/packages/screens/src/components/AdminArea/components/FolderBrowser/FolderBrowser.test.tsx +++ b/packages/screens/src/components/AdminArea/components/FolderBrowser/FolderBrowser.test.tsx @@ -102,7 +102,7 @@ describe('FolderBrowser', () => { }); it('opens a folder when it is pressed, and goes back up a level', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); draw('/media'); @@ -116,7 +116,7 @@ describe('FolderBrowser', () => { }); it('steps back along the trail to a folder on the way down', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); draw('/media/films'); @@ -128,7 +128,7 @@ describe('FolderBrowser', () => { }); it('chooses the folder it is looking at', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onChoose } = draw('/media'); await user.click(await screen.findByRole('button', { name: 'films' })); @@ -147,7 +147,7 @@ describe('FolderBrowser', () => { }); it('closes without choosing when cancelled', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onChoose, onCancel } = draw(); await user.click(screen.getByRole('button', { name: 'Cancel' })); @@ -167,7 +167,7 @@ describe('making a folder', () => { }); it('makes one inside the folder being looked at, and opens it', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); createFolderMock.mockResolvedValue({ name: 'anime', path: '/media/anime' }); fetchFoldersMock.mockImplementation((path: string | null) => @@ -191,7 +191,7 @@ describe('making a folder', () => { }); it("shows the server's own words where the disk would not allow it, and stays put", async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); createFolderMock.mockRejectedValue(new Error('That disk is read-only to Valence.')); @@ -207,7 +207,7 @@ describe('making a folder', () => { }); it('will not make a folder with no name', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); draw('/media'); @@ -218,7 +218,7 @@ describe('making a folder', () => { }); it('puts the name away on cancel', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); draw('/media'); @@ -232,7 +232,7 @@ describe('making a folder', () => { describe('FolderBrowser, finding a folder', () => { it('finds folders by name below the one it is in, and opens the one chosen', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const { onChoose } = draw('/media'); await screen.findByRole('button', { name: 'films' }); @@ -253,7 +253,7 @@ describe('FolderBrowser, finding a folder', () => { }); it('says so where nothing here is called that', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); searchFoldersMock.mockResolvedValue({ folders: [], isTruncated: false }); draw('/media'); @@ -264,7 +264,7 @@ describe('FolderBrowser, finding a folder', () => { }); it('goes straight to a path typed whole, without searching', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); draw(); @@ -276,7 +276,7 @@ describe('FolderBrowser, finding a folder', () => { }); it('waits for a second letter before it searches', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); draw('/media'); diff --git a/packages/screens/src/components/AdminArea/components/IndexerCatalogueDialog/IndexerCatalogueDialog.test.tsx b/packages/screens/src/components/AdminArea/components/IndexerCatalogueDialog/IndexerCatalogueDialog.test.tsx index 18a3b6a321..5499ed8a7a 100644 --- a/packages/screens/src/components/AdminArea/components/IndexerCatalogueDialog/IndexerCatalogueDialog.test.tsx +++ b/packages/screens/src/components/AdminArea/components/IndexerCatalogueDialog/IndexerCatalogueDialog.test.tsx @@ -84,7 +84,7 @@ describe('IndexerCatalogueDialog', () => { }); it('finds a site by name, and narrows by privacy, category and language', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -113,7 +113,7 @@ describe('IndexerCatalogueDialog', () => { }); it('chooses a site from the catalogue', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onChoose } = open(); await user.click(await screen.findByText('RussianTracker')); @@ -126,7 +126,7 @@ describe('IndexerCatalogueDialog', () => { }); it('chooses a generic Torznab or Newznab indexer', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onChoose } = open(); await user.click(screen.getByRole('button', { name: /Generic Newznab/ })); @@ -135,7 +135,7 @@ describe('IndexerCatalogueDialog', () => { }); it('brings the catalogue up to date', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -153,7 +153,7 @@ describe('IndexerCatalogueDialog', () => { problem: sayVerbatim('The definitions could not be fetched'), }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -185,7 +185,7 @@ describe('IndexerCatalogueDialog', () => { }); it('closes', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onClose } = open(); await user.click(screen.getByRole('button', { name: 'Close' })); diff --git a/packages/screens/src/components/AdminArea/components/IndexerDialog/IndexerDialog.test.tsx b/packages/screens/src/components/AdminArea/components/IndexerDialog/IndexerDialog.test.tsx index 87a138a1cc..9b9c87bc7b 100644 --- a/packages/screens/src/components/AdminArea/components/IndexerDialog/IndexerDialog.test.tsx +++ b/packages/screens/src/components/AdminArea/components/IndexerDialog/IndexerDialog.test.tsx @@ -167,7 +167,7 @@ beforeEach(() => { describe('IndexerDialog', () => { it('adds an indexer, and says it was kept', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onSaved, onClose } = open(); await user.click(screen.getByRole('button', { name: 'Newznab' })); @@ -184,7 +184,7 @@ describe('IndexerDialog', () => { }); it('says what is wrong with the form before sending anything', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -200,7 +200,7 @@ describe('IndexerDialog', () => { refusal: { message: 'That isn’t a valid indexer.' }, }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onSaved } = open(); await fillIn(user); @@ -213,7 +213,7 @@ describe('IndexerDialog', () => { it('still says something where the server gave no reason', async () => { addIndexer.mockResolvedValue({ value: null, refusal: null }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -224,7 +224,7 @@ describe('IndexerDialog', () => { }); it('tries an indexer before it is kept, saying what it can search', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -253,7 +253,7 @@ describe('IndexerDialog', () => { refusal: null, }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -275,7 +275,7 @@ describe('IndexerDialog', () => { }), ); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -304,7 +304,7 @@ describe('IndexerDialog', () => { refusal: null, }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -326,7 +326,7 @@ describe('IndexerDialog', () => { it('says where trying it was refused altogether', async () => { tryIndexer.mockResolvedValue({ value: null, refusal: { message: 'Requests are turned off.' } }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -337,7 +337,7 @@ describe('IndexerDialog', () => { }); it('tries nothing that is not filled in properly', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -347,7 +347,7 @@ describe('IndexerDialog', () => { }); it('changes a kept indexer without sending a key nobody typed', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(KEPT); @@ -369,7 +369,7 @@ describe('IndexerDialog', () => { }); it('sends a new key where somebody typed one', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(KEPT); @@ -385,7 +385,7 @@ describe('IndexerDialog', () => { }); it('tries a change with the key already kept', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(KEPT); @@ -397,7 +397,7 @@ describe('IndexerDialog', () => { }); it('narrows the search to the categories chosen', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(KEPT); @@ -416,7 +416,7 @@ describe('IndexerDialog', () => { }); it('keeps an indexer to the libraries chosen for it', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); fetchLibraries.mockResolvedValue([ aLibrary({ id: 'anime', name: 'Anime', kind: 'shows', takesRequests: true }), @@ -496,7 +496,7 @@ describe('IndexerDialog', () => { }); it('adds it with its definition, the address chosen, and its settings with their defaults', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onSaved } = openSite(); await user.type(await screen.findByRole('textbox', { name: /Username/ }), 'ada'); @@ -531,7 +531,7 @@ describe('IndexerDialog', () => { }), ); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); openSite(); @@ -553,7 +553,7 @@ describe('IndexerDialog', () => { }); it('shows a kept secret as kept, and sends only what was changed', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); openSite(KEPT_SITE); @@ -585,7 +585,7 @@ describe('IndexerDialog', () => { refusal: null, }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); openSite(); diff --git a/packages/screens/src/components/AdminArea/components/IndexerDialog/components/DefinitionSettingsFields/DefinitionSettingsFields.test.tsx b/packages/screens/src/components/AdminArea/components/IndexerDialog/components/DefinitionSettingsFields/DefinitionSettingsFields.test.tsx index 4a891d4a94..a576d11568 100644 --- a/packages/screens/src/components/AdminArea/components/IndexerDialog/components/DefinitionSettingsFields/DefinitionSettingsFields.test.tsx +++ b/packages/screens/src/components/AdminArea/components/IndexerDialog/components/DefinitionSettingsFields/DefinitionSettingsFields.test.tsx @@ -121,7 +121,7 @@ describe('DefinitionSettingsFields', () => { }); it('says what changed', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const onChange = draw({ freeleech: false, sort: 'size' }); await user.type(screen.getByRole('textbox', { name: /Username/ }), 'g'); diff --git a/packages/screens/src/components/AdminArea/components/IndexersPanel/IndexersPanel.test.tsx b/packages/screens/src/components/AdminArea/components/IndexersPanel/IndexersPanel.test.tsx index 32ad036ca7..baca1dd612 100644 --- a/packages/screens/src/components/AdminArea/components/IndexersPanel/IndexersPanel.test.tsx +++ b/packages/screens/src/components/AdminArea/components/IndexersPanel/IndexersPanel.test.tsx @@ -133,7 +133,7 @@ beforeEach(() => { describe('IndexersPanel', () => { it('brings in a connected Prowlarr’s indexers, and says which came from it', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); fetchArrApps.mockResolvedValue([PROWLARR]); fetchIndexers.mockResolvedValue([anIndexer({ sourceAppId: PROWLARR.id, sourceIndexerId: 1 })]); @@ -150,7 +150,7 @@ describe('IndexersPanel', () => { }); it('says why a Prowlarr’s indexers could not be brought in', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); fetchArrApps.mockResolvedValue([PROWLARR]); importArrIndexers.mockResolvedValue({ value: null, refusal: { message: 'Unreachable.' } }); @@ -179,7 +179,7 @@ describe('IndexersPanel', () => { }); it('searches one indexer alone from its menu', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -217,7 +217,7 @@ describe('IndexersPanel', () => { }); it('opens the dialog to add one', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -227,7 +227,7 @@ describe('IndexersPanel', () => { }); it('adds a site chosen from the catalogue, going back to the catalogue from it', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -245,7 +245,7 @@ describe('IndexersPanel', () => { }); it('closes the catalogue without adding anything', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -268,7 +268,7 @@ describe('IndexersPanel', () => { }); it('opens the dialog to change one', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -286,7 +286,7 @@ describe('IndexersPanel', () => { }); it('tests one, and reads the list again', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -312,7 +312,7 @@ describe('IndexersPanel', () => { anIndexer({ id: 'switched-off', name: 'Torrents', isEnabled: false }), ]); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -343,7 +343,7 @@ describe('IndexersPanel', () => { }), ); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -375,7 +375,7 @@ describe('IndexersPanel', () => { }), ); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -396,7 +396,7 @@ describe('IndexersPanel', () => { ); testIndexer.mockImplementation(() => new Promise(() => undefined)); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -436,7 +436,7 @@ describe('IndexersPanel', () => { }), ); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -473,7 +473,7 @@ describe('IndexersPanel', () => { refusal: null, }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -496,7 +496,7 @@ describe('IndexersPanel', () => { refusal: null, }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -511,7 +511,7 @@ describe('IndexersPanel', () => { refusal: { message: 'Requests are turned off.' }, }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -525,7 +525,7 @@ describe('IndexersPanel', () => { .mockResolvedValueOnce([anIndexer()]) .mockResolvedValue([anIndexer({ isEnabled: false })]); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -544,7 +544,7 @@ describe('IndexersPanel', () => { }); it('removes one only once somebody confirms', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -562,7 +562,7 @@ describe('IndexersPanel', () => { it('says why a removal was refused', async () => { removeIndexer.mockResolvedValue({ message: 'No such indexer.' }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -573,7 +573,7 @@ describe('IndexersPanel', () => { }); it('keeps an indexer when the removal is thought better of', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); diff --git a/packages/screens/src/components/AdminArea/components/LeaveOutDialog/LeaveOutDialog.test.tsx b/packages/screens/src/components/AdminArea/components/LeaveOutDialog/LeaveOutDialog.test.tsx index 13aa93754d..3e45c04a0b 100644 --- a/packages/screens/src/components/AdminArea/components/LeaveOutDialog/LeaveOutDialog.test.tsx +++ b/packages/screens/src/components/AdminArea/components/LeaveOutDialog/LeaveOutDialog.test.tsx @@ -43,7 +43,7 @@ describe('LeaveOutDialog', () => { }); it('leaves it out with why, then closes', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); leaveOutMock.mockResolvedValue({ leftOut: {}, jobId: null }); @@ -59,7 +59,7 @@ describe('LeaveOutDialog', () => { }); it('sends no note where none was written', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); leaveOutMock.mockResolvedValue({ leftOut: {}, jobId: null }); open(FILE); @@ -72,7 +72,7 @@ describe('LeaveOutDialog', () => { }); it('says why the server refused, and stays open', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); leaveOutMock.mockRejectedValue(new Error('That isn’t inside this library.')); diff --git a/packages/screens/src/components/AdminArea/components/LibrarySettingsDialog/LibrarySettingsDialog.test.tsx b/packages/screens/src/components/AdminArea/components/LibrarySettingsDialog/LibrarySettingsDialog.test.tsx index 2677964348..b21afedf58 100644 --- a/packages/screens/src/components/AdminArea/components/LibrarySettingsDialog/LibrarySettingsDialog.test.tsx +++ b/packages/screens/src/components/AdminArea/components/LibrarySettingsDialog/LibrarySettingsDialog.test.tsx @@ -128,7 +128,7 @@ describe('LibrarySettingsDialog', () => { }); it('pins the detected browser language to the top of the list', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render( { const onUpdated = vi.fn(); const onClose = vi.fn(); const onRegenerate = vi.fn(); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render( { updateLibraryMock.mockResolvedValue(films()); const onUpdated = vi.fn(); const onRegenerate = vi.fn(); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render( { it('asks before regenerating previews for a library with existing items', async () => { updateLibraryMock.mockResolvedValue(films({ defaultAudioLanguage: 'de' })); const onUpdated = vi.fn(); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render( { const onUpdated = vi.fn(); const onClose = vi.fn(); const onRegenerate = vi.fn(); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render( { const onUpdated = vi.fn(); const onClose = vi.fn(); const onRegenerate = vi.fn(); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render( { it('shows the server error and keeps the dialog open', async () => { updateLibraryMock.mockRejectedValue(new Error('No such library.')); const onUpdated = vi.fn(); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render( { }); it('files requested episodes apart from a show already held once told to', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const shows = films({ kind: 'shows', name: 'Shows', path: '/media/shows' }); updateLibraryMock.mockResolvedValue({ ...shows, keepsShowsTogether: false }); @@ -340,7 +340,7 @@ describe('LibrarySettingsDialog', () => { }); it('makes a series library added as anime an anime library, once told to', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const added = films({ kind: 'shows', name: 'Anime', path: '/media/anime', flavour: 'Anime' }); updateLibraryMock.mockResolvedValue({ ...added, kind: 'anime', flavour: null }); @@ -384,7 +384,7 @@ describe('LibrarySettingsDialog', () => { }); it('says what a later ask at a higher profile does', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); updateLibraryMock.mockResolvedValue(films({ higherProfileAsks: 'upgrade' })); @@ -429,7 +429,7 @@ describe('LibrarySettingsDialog', () => { }); it('asks for one file at a time when a library is told to', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); updateLibraryMock.mockResolvedValue(films({ filesAtOnce: 1 })); @@ -456,7 +456,7 @@ describe('LibrarySettingsDialog', () => { }); it('leaves it to the server unless somebody says otherwise', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); updateLibraryMock.mockResolvedValue(films()); @@ -497,7 +497,7 @@ describe('LibrarySettingsDialog', () => { }); it('says whether a library takes requests, and where they are filed', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); updateLibraryMock.mockResolvedValue(films()); @@ -535,7 +535,7 @@ describe('LibrarySettingsDialog', () => { }); it('puts the request settings away for a library that takes none', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); updateLibraryMock.mockResolvedValue(films()); @@ -566,7 +566,7 @@ describe('LibrarySettingsDialog', () => { }); it('hands a library’s requests to a connected app of its kind, with its folder and profile', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); updateLibraryMock.mockResolvedValue(films()); fetchArrAppChoicesMock.mockResolvedValue({ @@ -630,7 +630,7 @@ describe('LibrarySettingsDialog', () => { }); it('asks Lidarr for a metadata profile too, and says where the choices could not be read', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); fetchArrAppChoicesMock.mockResolvedValue({ rootFolders: [{ id: 1, path: '/music', freeBytes: null, isAccessible: true }], diff --git a/packages/screens/src/components/AdminArea/components/LibrarySettingsDialog/components/LibraryLockRow/LibraryLockRow.test.tsx b/packages/screens/src/components/AdminArea/components/LibrarySettingsDialog/components/LibraryLockRow/LibraryLockRow.test.tsx index 26020d6c76..b094182a94 100644 --- a/packages/screens/src/components/AdminArea/components/LibrarySettingsDialog/components/LibraryLockRow/LibraryLockRow.test.tsx +++ b/packages/screens/src/components/AdminArea/components/LibrarySettingsDialog/components/LibraryLockRow/LibraryLockRow.test.tsx @@ -13,7 +13,7 @@ beforeEach(() => { describe('LibraryLockRow', () => { it('locks the library with the secret typed, relocking after as long as asked', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -26,7 +26,7 @@ describe('LibraryLockRow', () => { }); it('will not lock it with a secret too short to keep anybody out', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -36,7 +36,7 @@ describe('LibraryLockRow', () => { }); it('takes a lock away, where there is one', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); diff --git a/packages/screens/src/components/AdminArea/components/LinkedServersPanel/components/LinkedServerList/LinkedServerList.test.tsx b/packages/screens/src/components/AdminArea/components/LinkedServersPanel/components/LinkedServerList/LinkedServerList.test.tsx index 8195c4d3f8..4fbab70051 100644 --- a/packages/screens/src/components/AdminArea/components/LinkedServersPanel/components/LinkedServerList/LinkedServerList.test.tsx +++ b/packages/screens/src/components/AdminArea/components/LinkedServersPanel/components/LinkedServerList/LinkedServerList.test.tsx @@ -107,7 +107,9 @@ describe('LinkedServerList', () => { const dialog = await screen.findByRole('dialog', { name: 'Use an invite' }); - await userEvent.type(within(dialog).getByRole('textbox'), ' valence-link:xyz '); + await userEvent.type(within(dialog).getByRole('textbox'), ' valence-link:xyz ', { + delay: null, + }); await userEvent.click(within(dialog).getByRole('button', { name: 'Link' })); await waitFor(() => { diff --git a/packages/screens/src/components/AdminArea/components/LinkedServersPanel/components/ThisServerCard/ThisServerCard.test.tsx b/packages/screens/src/components/AdminArea/components/LinkedServersPanel/components/ThisServerCard/ThisServerCard.test.tsx index c2ad335527..5db0e55e37 100644 --- a/packages/screens/src/components/AdminArea/components/LinkedServersPanel/components/ThisServerCard/ThisServerCard.test.tsx +++ b/packages/screens/src/components/AdminArea/components/LinkedServersPanel/components/ThisServerCard/ThisServerCard.test.tsx @@ -64,7 +64,7 @@ describe('ThisServerCard', () => { const name = screen.getByRole('textbox', { name: 'Name' }); await userEvent.clear(name); - await userEvent.type(name, 'Kai’s Valence'); + await userEvent.type(name, 'Kai’s Valence', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Save' })); await waitFor(() => { diff --git a/packages/screens/src/components/AdminArea/components/LiveTvPanel/components/AddLiveSourceDialog/AddLiveSourceDialog.test.tsx b/packages/screens/src/components/AdminArea/components/LiveTvPanel/components/AddLiveSourceDialog/AddLiveSourceDialog.test.tsx index 10c28579ec..3fda5c1c88 100644 --- a/packages/screens/src/components/AdminArea/components/LiveTvPanel/components/AddLiveSourceDialog/AddLiveSourceDialog.test.tsx +++ b/packages/screens/src/components/AdminArea/components/LiveTvPanel/components/AddLiveSourceDialog/AddLiveSourceDialog.test.tsx @@ -37,9 +37,12 @@ const signIn = async (password = 'secret') => { await userEvent.type( screen.getByRole('textbox', { name: 'Server address' }), 'http://line.example.com:8080', + { delay: null }, ); - await userEvent.type(screen.getByRole('textbox', { name: 'Username' }), 'someone'); - await userEvent.type(screen.getByLabelText('Password'), password); + await userEvent.type(screen.getByRole('textbox', { name: 'Username' }), 'someone', { + delay: null, + }); + await userEvent.type(screen.getByLabelText('Password'), password, { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Choose categories' })); }; @@ -133,9 +136,12 @@ describe('AddLiveSourceDialog with an Xtream provider', () => { await userEvent.type( screen.getByRole('textbox', { name: 'Server address' }), 'http://line.example.com:8080', + { delay: null }, ); - await userEvent.type(screen.getByRole('textbox', { name: 'Username' }), 'someone'); - await userEvent.type(screen.getByLabelText('Password'), 'secret'); + await userEvent.type(screen.getByRole('textbox', { name: 'Username' }), 'someone', { + delay: null, + }); + await userEvent.type(screen.getByLabelText('Password'), 'secret', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'User agent' })); await userEvent.click(await screen.findByRole('menuitemradio', { name: /^VLC/u })); await userEvent.click(screen.getByRole('button', { name: 'Choose categories' })); @@ -217,6 +223,7 @@ describe('AddLiveSourceDialog with an Xtream provider', () => { await userEvent.type( screen.getByRole('textbox', { name: 'Server address' }), 'http://line.example.com:8080/get.php?username=someone&password=secret&type=m3u_plus', + { delay: null }, ); await userEvent.click(screen.getByRole('button', { name: 'Choose categories' })); diff --git a/packages/screens/src/components/AdminArea/components/LiveTvPanel/components/EditLiveSourceDialog/EditLiveSourceDialog.test.tsx b/packages/screens/src/components/AdminArea/components/LiveTvPanel/components/EditLiveSourceDialog/EditLiveSourceDialog.test.tsx index f6aab35168..cd6782799e 100644 --- a/packages/screens/src/components/AdminArea/components/LiveTvPanel/components/EditLiveSourceDialog/EditLiveSourceDialog.test.tsx +++ b/packages/screens/src/components/AdminArea/components/LiveTvPanel/components/EditLiveSourceDialog/EditLiveSourceDialog.test.tsx @@ -80,7 +80,9 @@ describe('EditLiveSourceDialog', () => { const { onChanged, onClose } = drawn(SOURCE); await userEvent.clear(screen.getByRole('textbox', { name: 'Name' })); - await userEvent.type(screen.getByRole('textbox', { name: 'Name' }), 'Loft aerial'); + await userEvent.type(screen.getByRole('textbox', { name: 'Name' }), 'Loft aerial', { + delay: null, + }); await userEvent.click(screen.getByRole('button', { name: 'Save' })); await waitFor(() => { @@ -113,7 +115,9 @@ describe('EditLiveSourceDialog', () => { changeLiveSource.mockResolvedValue({ value: null, refusal: { message: 'No such tuner.' } }); const { onChanged } = drawn(SOURCE); - await userEvent.type(screen.getByRole('textbox', { name: 'Tuner address' }), '0'); + await userEvent.type(screen.getByRole('textbox', { name: 'Tuner address' }), '0', { + delay: null, + }); await userEvent.click(screen.getByRole('button', { name: 'Save' })); expect(await screen.findByRole('alert')).toHaveTextContent('No such tuner.'); @@ -135,7 +139,9 @@ describe('EditLiveSourceDialog', () => { expect(screen.getByLabelText('Password')).toHaveValue(''); await userEvent.clear(screen.getByRole('textbox', { name: 'Username' })); - await userEvent.type(screen.getByRole('textbox', { name: 'Username' }), 'another'); + await userEvent.type(screen.getByRole('textbox', { name: 'Username' }), 'another', { + delay: null, + }); await userEvent.click(screen.getByRole('button', { name: 'Save' })); await waitFor(() => { @@ -147,7 +153,7 @@ describe('EditLiveSourceDialog', () => { changeLiveSource.mockResolvedValue({ value: XTREAM, refusal: null }); drawn(XTREAM); - await userEvent.type(screen.getByLabelText('Password'), 'new secret'); + await userEvent.type(screen.getByLabelText('Password'), 'new secret', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Save' })); await waitFor(() => { @@ -189,7 +195,9 @@ describe('EditLiveSourceDialog', () => { await userEvent.click(screen.getByRole('button', { name: 'User agent' })); await userEvent.click(await screen.findByRole('menuitemradio', { name: /^Custom/u })); - await userEvent.type(screen.getByLabelText('User agent to send'), 'SomePlayer/1.0'); + await userEvent.type(screen.getByLabelText('User agent to send'), 'SomePlayer/1.0', { + delay: null, + }); await userEvent.click(screen.getByRole('button', { name: 'Save' })); await waitFor(() => { diff --git a/packages/screens/src/components/AdminArea/components/LiveTvPanel/components/XtreamCategoryPicker/XtreamCategoryPicker.test.tsx b/packages/screens/src/components/AdminArea/components/LiveTvPanel/components/XtreamCategoryPicker/XtreamCategoryPicker.test.tsx index 4147587b11..b00f6b43f4 100644 --- a/packages/screens/src/components/AdminArea/components/LiveTvPanel/components/XtreamCategoryPicker/XtreamCategoryPicker.test.tsx +++ b/packages/screens/src/components/AdminArea/components/LiveTvPanel/components/XtreamCategoryPicker/XtreamCategoryPicker.test.tsx @@ -40,7 +40,9 @@ describe('XtreamCategoryPicker', () => { it('ticks every category the search shows, and only those', async () => { const { onChange } = drawn(new Set(['1'])); - await userEvent.type(screen.getByRole('searchbox', { name: 'Find a category' }), 'sport'); + await userEvent.type(screen.getByRole('searchbox', { name: 'Find a category' }), 'sport', { + delay: null, + }); expect(screen.queryByRole('checkbox', { name: /UK \| News/ })).not.toBeInTheDocument(); @@ -52,7 +54,9 @@ describe('XtreamCategoryPicker', () => { it('says when the search matches nothing', async () => { drawn(new Set()); - await userEvent.type(screen.getByRole('searchbox', { name: 'Find a category' }), 'films'); + await userEvent.type(screen.getByRole('searchbox', { name: 'Find a category' }), 'films', { + delay: null, + }); expect(screen.getByText('No category matches that.')).toBeInTheDocument(); expect(screen.getByRole('checkbox', { name: 'Every category shown' })).toBeDisabled(); diff --git a/packages/screens/src/components/AdminArea/components/LiveTvPanel/components/XtreamUserAgentField/XtreamUserAgentField.test.tsx b/packages/screens/src/components/AdminArea/components/LiveTvPanel/components/XtreamUserAgentField/XtreamUserAgentField.test.tsx index c759877f49..9f0f11c8cd 100644 --- a/packages/screens/src/components/AdminArea/components/LiveTvPanel/components/XtreamUserAgentField/XtreamUserAgentField.test.tsx +++ b/packages/screens/src/components/AdminArea/components/LiveTvPanel/components/XtreamUserAgentField/XtreamUserAgentField.test.tsx @@ -41,7 +41,9 @@ describe('XtreamUserAgentField', () => { expect(onChange).toHaveBeenLastCalledWith(null); - await userEvent.type(screen.getByLabelText('User agent to send'), 'SomePlayer/1.0'); + await userEvent.type(screen.getByLabelText('User agent to send'), 'SomePlayer/1.0', { + delay: null, + }); expect(onChange).toHaveBeenLastCalledWith('SomePlayer/1.0'); }); diff --git a/packages/screens/src/components/AdminArea/components/MediaPanel/MediaPanel.test.tsx b/packages/screens/src/components/AdminArea/components/MediaPanel/MediaPanel.test.tsx index 6d9761e279..34c930f8d3 100644 --- a/packages/screens/src/components/AdminArea/components/MediaPanel/MediaPanel.test.tsx +++ b/packages/screens/src/components/AdminArea/components/MediaPanel/MediaPanel.test.tsx @@ -316,7 +316,7 @@ describe('MediaPanel', () => { }); it('switches to its folders, which the address keeps where it is asked to', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const onView = vi.fn(); served([item()]); @@ -338,7 +338,7 @@ describe('MediaPanel', () => { }); it('narrows to what was searched for', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item(), item({ id: 'item-2', title: 'Heat' })]); @@ -355,7 +355,7 @@ describe('MediaPanel', () => { }); it('says nothing matched, rather than looking like an empty library', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item()]); @@ -370,7 +370,7 @@ describe('MediaPanel', () => { it('asks for the item whose match is wrong', async () => { const onCorrect = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item()]); @@ -386,7 +386,7 @@ describe('MediaPanel', () => { it('offers to choose the artwork of a matched title', async () => { const onChooseArtwork = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item()]); @@ -403,7 +403,7 @@ describe('MediaPanel', () => { }); it('has no artwork to choose for a title the catalogue never matched', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item({ externalId: null })]); @@ -418,7 +418,7 @@ describe('MediaPanel', () => { it('asks for the item whose preview moment is to be chosen', async () => { const onChooseMoment = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item()]); @@ -433,7 +433,7 @@ describe('MediaPanel', () => { }); it('is in order by name, and can be turned the other way', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item({ id: 'z', title: 'Zodiac' }), item({ id: 'a', title: 'Alien' })]); @@ -452,7 +452,7 @@ describe('MediaPanel', () => { it('offers to rebuild one item, for the case where a single preview is wrong', async () => { const onRebuildArtefacts = vi.fn().mockResolvedValue(true); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item()]); @@ -469,7 +469,7 @@ describe('MediaPanel', () => { it('asks before throwing the previews away, and does nothing if told not to', async () => { const onRebuildArtefacts = vi.fn().mockResolvedValue(true); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item()]); @@ -491,7 +491,7 @@ describe('MediaPanel', () => { }); it('says it will rebuild rather than that it has, because nothing is made yet', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item()]); @@ -508,7 +508,7 @@ describe('MediaPanel', () => { }); it('leaves the offer standing when the server would not do it', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item()]); @@ -531,7 +531,7 @@ describe('MediaPanel', () => { }); it('offers no delete to whoever may not delete media', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item()]); @@ -546,7 +546,7 @@ describe('MediaPanel', () => { it('keeps asking where the file could not be deleted, so it can be tried again', async () => { const onDelete = vi.fn().mockResolvedValue(false); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item()]); @@ -568,7 +568,7 @@ describe('MediaPanel', () => { }); it('offers each library of films or series as its own choice', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item(), episode('e1', 1, 1, 'Pilot')]); @@ -586,7 +586,7 @@ describe('MediaPanel', () => { }); it('says which libraries have titles to fix, so each need not be opened to find them', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item(), { ...episode('e1', 1, 1, 'Pilot'), externalId: null, hasPoster: false }]); @@ -602,7 +602,7 @@ describe('MediaPanel', () => { }); it('lists a series once, sized by all its episodes rather than one', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([episode('e1', 1, 1, 'Pilot'), episode('e2', 1, 2, 'Choose Wisely')]); @@ -620,7 +620,7 @@ describe('MediaPanel', () => { }); it('opens a series onto its seasons, and a season onto its episodes, in the table’s own columns', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([ episode('e3', 2, 1, 'Return'), @@ -659,7 +659,7 @@ describe('MediaPanel', () => { }); it('opens a series of one season straight onto its episodes', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([episode('e1', 1, 1, 'Pilot'), episode('e2', 1, 2, 'Choose Wisely')]); @@ -676,7 +676,7 @@ describe('MediaPanel', () => { it('deletes one episode from its own menu without taking the series with it', async () => { const onDelete = vi.fn().mockResolvedValue(true); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([episode('e1', 1, 1, 'Pilot'), episode('e2', 1, 2, 'Choose Wisely')]); @@ -701,7 +701,7 @@ describe('MediaPanel', () => { it('deletes a series only once it has been asked twice, as a whole', async () => { const onDelete = vi.fn().mockResolvedValue(true); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([episode('e1', 1, 1, 'Pilot')]); @@ -728,7 +728,7 @@ describe('MediaPanel', () => { }); it('offers no whole-series delete for episodes that belong to no series', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([{ ...episode('e1', 1, 1, 'Pilot'), seriesId: null }]); @@ -750,7 +750,7 @@ describe('MediaPanel', () => { it('re-encodes every episode of a series from the series’ own menu', async () => { const onReencode = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([episode('e1', 1, 1, 'Pilot'), episode('e2', 1, 2, 'Choose Wisely')]); @@ -776,7 +776,7 @@ describe('MediaPanel', () => { it('opens the copies kept of a film from its own menu', async () => { const onShowCopies = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item()]); @@ -804,7 +804,7 @@ describe('MediaPanel', () => { }); it('narrows to what is unmatched: no match, or no poster', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([ item(), @@ -883,7 +883,7 @@ describe('MediaPanel', () => { it('shows where a film’s file is, and opens its folder in Media’s folders', async () => { const onOpenFolder = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item()], { paths: { 'item-1': '/media/films/Parasite (2019)/Parasite.mkv' } }); @@ -907,7 +907,7 @@ describe('MediaPanel', () => { }); it('offers to leave a film’s file out of the library, and asks first', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item()], { paths: { 'item-1': '/media/films/Parasite (2019)/Parasite.mkv' } }); @@ -930,7 +930,7 @@ describe('MediaPanel', () => { }); it('leaves a whole series out by its folder', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([episode('e1', 1, 1, 'Pilot'), episode('e2', 2, 1, 'Return')], { paths: { @@ -961,7 +961,7 @@ describe('MediaPanel', () => { }); it('offers no way to leave out a file whose place on the disk is not known', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item()]); @@ -976,7 +976,7 @@ describe('MediaPanel', () => { it('shows a series’ own folder, and each episode’s folder from its row', async () => { const onOpenFolder = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([episode('e1', 1, 1, 'Pilot'), episode('e2', 2, 1, 'Return')], { paths: { @@ -1013,7 +1013,7 @@ describe('MediaPanel', () => { it('lists a music library’s albums with their covers, and corrects one', async () => { const onCorrectAlbum = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const blue = { id: '0f8fad5b-d9cb-469f-a165-70867728950e', libraryId: MUSIC.id, @@ -1059,7 +1059,7 @@ describe('MediaPanel', () => { it('lists a book library’s books by title and author, with where each is', async () => { const onOpenFolder = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render( { it('opens a film onto each of its editions, each with its own file actions', async () => { const onDelete = vi.fn().mockResolvedValue(true); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([ item(), @@ -1148,7 +1148,7 @@ describe('MediaPanel', () => { }); it('opens an episode onto its editions where it has more than one file', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([ episode('e1', 1, 1, 'Pilot'), @@ -1226,7 +1226,7 @@ describe('MediaPanel', () => { it('deletes every file of the titles selected, once asked', async () => { const onDelete = vi.fn().mockResolvedValue(true); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item(), item({ id: 'item-2', title: 'Heat' })]); @@ -1258,7 +1258,7 @@ describe('MediaPanel', () => { }); it('selects one title at a time and clears the selection', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item(), item({ id: 'item-2', title: 'Heat' })]); @@ -1277,7 +1277,7 @@ describe('MediaPanel', () => { it('opens a title on a page of its own, from its name or its menu', async () => { const onOpenTitle = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item()]); @@ -1295,7 +1295,7 @@ describe('MediaPanel', () => { it('opens a title from anywhere on its row, as its name does', async () => { const onOpenTitle = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item()]); @@ -1312,7 +1312,7 @@ describe('MediaPanel', () => { it('draws the open title’s page, and goes back to every title', async () => { const onOpenTitle = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item()]); @@ -1326,7 +1326,7 @@ describe('MediaPanel', () => { }); it('asks before deleting a file from a title’s own page', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item()]); @@ -1352,7 +1352,7 @@ describe('MediaPanel', () => { }); it('forgets the titles chosen once the library, search or filter changes', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); served([item(), item({ id: 'item-2', title: 'Heat' })]); diff --git a/packages/screens/src/components/AdminArea/components/MediaPanel/components/AddTagsDialog/AddTagsDialog.test.tsx b/packages/screens/src/components/AdminArea/components/MediaPanel/components/AddTagsDialog/AddTagsDialog.test.tsx index 21c70dd36f..da7eb55204 100644 --- a/packages/screens/src/components/AdminArea/components/MediaPanel/components/AddTagsDialog/AddTagsDialog.test.tsx +++ b/packages/screens/src/components/AdminArea/components/MediaPanel/components/AddTagsDialog/AddTagsDialog.test.tsx @@ -17,7 +17,7 @@ describe('AddTagsDialog', () => { it('adds the tags typed to every title chosen', async () => { editing.mockResolvedValue({ changeSetId: 'set', changed: TARGETS, unchanged: 0, refused: 0 }); const onDone = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(); diff --git a/packages/screens/src/components/AdminArea/components/MediaPanel/components/BulkEditDialog/BulkEditDialog.test.tsx b/packages/screens/src/components/AdminArea/components/MediaPanel/components/BulkEditDialog/BulkEditDialog.test.tsx index 1fea9254d1..55ff5e19e9 100644 --- a/packages/screens/src/components/AdminArea/components/MediaPanel/components/BulkEditDialog/BulkEditDialog.test.tsx +++ b/packages/screens/src/components/AdminArea/components/MediaPanel/components/BulkEditDialog/BulkEditDialog.test.tsx @@ -29,7 +29,7 @@ describe('BulkEditDialog', () => { }); editing.mockResolvedValue({ changeSetId: 'set', changed: TARGETS, unchanged: 0, refused: 0 }); const onDone = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render( { titles: 2, fields: { tagline: { value: 'Same', isMixed: false, titles: 2 } }, }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render( { }, }); editing.mockResolvedValue({ changeSetId: 'set', changed: TARGETS, unchanged: 0, refused: 0 }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render( { it('asks for what was typed, and for nothing once the words to find are emptied', async () => { const onReplace = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render( ) => { describe('FolderView', () => { it('offers to leave a folder out of its library, saying it takes everything in it', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); draw(); await openFilms(actor); @@ -150,7 +150,7 @@ describe('FolderView', () => { }); it('offers to leave a file out even where nothing may be deleted', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); draw(false); await openFilms(actor); @@ -170,7 +170,7 @@ describe('FolderView', () => { }); it('opens a library, walks back along the trail, and says which files Valence knows', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); draw(); await openFilms(actor); @@ -195,7 +195,7 @@ describe('FolderView', () => { }); it('renames a file, and tells the page something changed', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const { onChanged } = draw(); await openFilms(actor); @@ -220,7 +220,7 @@ describe('FolderView', () => { }); it('deletes only after asking, and offers no delete to whoever may not', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); draw(); await openFilms(actor); @@ -239,7 +239,7 @@ describe('FolderView', () => { }); it('deletes everything chosen, then says so once and reads the folder once', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); draw(); await openFilms(actor); @@ -264,7 +264,7 @@ describe('FolderView', () => { .mockResolvedValueOnce(null) .mockRejectedValueOnce(new Error('The file is in use.')); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); draw(); await openFilms(actor); @@ -293,7 +293,7 @@ describe('FolderView', () => { }); it('offers no delete to whoever may not delete media', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); draw(false); await openFilms(actor); @@ -304,7 +304,7 @@ describe('FolderView', () => { }); it('finds files by name in the folder it is in', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); searchLibraryFilesMock.mockResolvedValue({ entries: [ @@ -325,7 +325,7 @@ describe('FolderView', () => { }); it('names the title a file belongs to, opens it, and badges where each file stands', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); fetchLibraryFolderMock.mockImplementation(() => Promise.resolve({ @@ -365,7 +365,7 @@ describe('FolderView', () => { }); it('shows only the files whose video has gone, when asked', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); fetchLibraryFolderMock.mockImplementation(() => Promise.resolve({ diff --git a/packages/screens/src/components/AdminArea/components/MediaPanel/components/FolderView/components/NameEntryDialog/NameEntryDialog.test.tsx b/packages/screens/src/components/AdminArea/components/MediaPanel/components/FolderView/components/NameEntryDialog/NameEntryDialog.test.tsx index 4143a73d90..b382aef2db 100644 --- a/packages/screens/src/components/AdminArea/components/MediaPanel/components/FolderView/components/NameEntryDialog/NameEntryDialog.test.tsx +++ b/packages/screens/src/components/AdminArea/components/MediaPanel/components/FolderView/components/NameEntryDialog/NameEntryDialog.test.tsx @@ -28,7 +28,7 @@ const draw = (onName = vi.fn().mockResolvedValue(null)) => { describe('NameEntryDialog', () => { it('starts on the name it was given, and will not save it unchanged or blank', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const { onName } = draw(); @@ -43,7 +43,7 @@ describe('NameEntryDialog', () => { }); it('says the new name, trimmed', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const { onName } = draw(); await actor.clear(screen.getByLabelText('Name')); @@ -54,7 +54,7 @@ describe('NameEntryDialog', () => { }); it('shows why a name would not do, and keeps asking', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); draw(vi.fn().mockResolvedValue('Something with that name already exists.')); diff --git a/packages/screens/src/components/AdminArea/components/MediaPanel/components/MediaTitlePage/components/EpisodeNumberDialog/EpisodeNumberDialog.test.tsx b/packages/screens/src/components/AdminArea/components/MediaPanel/components/MediaTitlePage/components/EpisodeNumberDialog/EpisodeNumberDialog.test.tsx index 5b4428876f..80e61197de 100644 --- a/packages/screens/src/components/AdminArea/components/MediaPanel/components/MediaTitlePage/components/EpisodeNumberDialog/EpisodeNumberDialog.test.tsx +++ b/packages/screens/src/components/AdminArea/components/MediaPanel/components/MediaTitlePage/components/EpisodeNumberDialog/EpisodeNumberDialog.test.tsx @@ -12,7 +12,7 @@ vi.mock('@ValenceClient/admin/pinEpisode', () => ({ pinEpisode: pinning })); describe('EpisodeNumberDialog', () => { it('says which episodes a file holds, and follows the job reading it again', async () => { const onChanged = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render( { }); it('refuses a last episode before the first, and goes by the file name again', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render( { }); it('sets an intro by hand to the tenth of a second', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(, { wrapper: CacheScope }); @@ -78,7 +78,7 @@ describe('SkipMarkers', () => { }); it('gives an episode’s credits back to detection across its season', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(, { wrapper: CacheScope }); diff --git a/packages/screens/src/components/AdminArea/components/MediaPanel/components/MediaTitlePage/components/SkipMarkers/components/SkipMarkerRow/components/SkipMarkerEditor/SkipMarkerEditor.test.tsx b/packages/screens/src/components/AdminArea/components/MediaPanel/components/MediaTitlePage/components/SkipMarkers/components/SkipMarkerRow/components/SkipMarkerEditor/SkipMarkerEditor.test.tsx index 553550a812..80930c9e5d 100644 --- a/packages/screens/src/components/AdminArea/components/MediaPanel/components/MediaTitlePage/components/SkipMarkers/components/SkipMarkerRow/components/SkipMarkerEditor/SkipMarkerEditor.test.tsx +++ b/packages/screens/src/components/AdminArea/components/MediaPanel/components/MediaTitlePage/components/SkipMarkers/components/SkipMarkerRow/components/SkipMarkerEditor/SkipMarkerEditor.test.tsx @@ -24,7 +24,7 @@ const anEditor = (props: Partial = {}) => { describe('SkipMarkerEditor', () => { it('saves a stretch typed to the tenth of a second', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onSave } = anEditor(); await user.type(screen.getByLabelText('Marker starts at'), '1:02.3'); @@ -38,7 +38,7 @@ describe('SkipMarkerEditor', () => { }); it('will not save a stretch that ends before it starts', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onCancel } = anEditor({ span: { startSeconds: 90, endSeconds: 30 } }); expect( @@ -52,7 +52,7 @@ describe('SkipMarkerEditor', () => { }); it('fills a marker from one of the file’s chapters', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onSave } = anEditor({ chapters: [ { title: 'Prologue', startSeconds: 0, endSeconds: 95 }, @@ -68,7 +68,7 @@ describe('SkipMarkerEditor', () => { }); it('turns a marker off across a season, or gives it back to detection', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onSave, onClear } = anEditor({ span: { startSeconds: 0, endSeconds: 45 }, isEpisode: true, diff --git a/packages/screens/src/components/AdminArea/components/MediaPanel/components/MediaTitlePage/components/TitleDetails/components/ContentRatingField/ContentRatingField.test.tsx b/packages/screens/src/components/AdminArea/components/MediaPanel/components/MediaTitlePage/components/TitleDetails/components/ContentRatingField/ContentRatingField.test.tsx index 59b9b6947f..72ab5af9a6 100644 --- a/packages/screens/src/components/AdminArea/components/MediaPanel/components/MediaTitlePage/components/TitleDetails/components/ContentRatingField/ContentRatingField.test.tsx +++ b/packages/screens/src/components/AdminArea/components/MediaPanel/components/MediaTitlePage/components/TitleDetails/components/ContentRatingField/ContentRatingField.test.tsx @@ -5,7 +5,7 @@ import { ContentRatingField } from './ContentRatingField'; describe('ContentRatingField', () => { it('picks the server’s own country’s rating from those it knows, with the age each is for', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const onRatingsChange = vi.fn(); render( @@ -23,7 +23,7 @@ describe('ContentRatingField', () => { }); it('folds other countries away, takes one’s rating away once emptied, and adds a country', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const onRatingsChange = vi.fn(); render( diff --git a/packages/screens/src/components/AdminArea/components/MediaPanel/components/MediaTitlePage/components/TitleDetails/components/MetadataField/MetadataField.test.tsx b/packages/screens/src/components/AdminArea/components/MediaPanel/components/MediaTitlePage/components/TitleDetails/components/MetadataField/MetadataField.test.tsx index 5577063b6e..5e05ff4654 100644 --- a/packages/screens/src/components/AdminArea/components/MediaPanel/components/MediaTitlePage/components/TitleDetails/components/MetadataField/MetadataField.test.tsx +++ b/packages/screens/src/components/AdminArea/components/MediaPanel/components/MediaTitlePage/components/TitleDetails/components/MetadataField/MetadataField.test.tsx @@ -12,7 +12,7 @@ const saving = () => vi.fn(() => Promise.resolve({ isSaved: true, reason: '' })) describe('MetadataField', () => { it('tells the form of each change rather than saving it', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const change = saving(); const onValueChange = vi.fn(); @@ -34,7 +34,7 @@ describe('MetadataField', () => { }); it('puts an edited field back to what TMDB says', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const change = saving(); render( diff --git a/packages/screens/src/components/AdminArea/components/MediaPanel/components/MediaTitlePage/components/TitlePeople/TitlePeople.test.tsx b/packages/screens/src/components/AdminArea/components/MediaPanel/components/MediaTitlePage/components/TitlePeople/TitlePeople.test.tsx index 329ef8d177..819e0d4a7f 100644 --- a/packages/screens/src/components/AdminArea/components/MediaPanel/components/MediaTitlePage/components/TitlePeople/TitlePeople.test.tsx +++ b/packages/screens/src/components/AdminArea/components/MediaPanel/components/MediaTitlePage/components/TitlePeople/TitlePeople.test.tsx @@ -54,7 +54,7 @@ describe('TitlePeople', () => { }); it('moves somebody down the billing, and takes somebody off', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(, { wrapper: CacheScope }); await user.click(await screen.findByRole('button', { name: 'Move First Person down' })); @@ -71,7 +71,7 @@ describe('TitlePeople', () => { }); it('moves somebody to the top of the billing', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(, { wrapper: CacheScope }); await user.click(await screen.findByRole('button', { name: 'Move Second Person to the top' })); @@ -83,7 +83,7 @@ describe('TitlePeople', () => { }); it('changes a part once typing is done', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(, { wrapper: CacheScope }); @@ -98,7 +98,7 @@ describe('TitlePeople', () => { }); it('adds somebody from the catalogue, or by name alone', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(, { wrapper: CacheScope }); await user.type(await screen.findByLabelText('Add a person'), 'Third'); @@ -123,7 +123,7 @@ describe('TitlePeople', () => { }); it('puts the search away with Escape or Cancel', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(, { wrapper: CacheScope }); await user.type(await screen.findByLabelText('Add a person'), 'Third'); diff --git a/packages/screens/src/components/AdminArea/components/MediaPanel/components/MediaTitlePage/components/TitleVersions/TitleVersions.test.tsx b/packages/screens/src/components/AdminArea/components/MediaPanel/components/MediaTitlePage/components/TitleVersions/TitleVersions.test.tsx index 93e591f984..59ba855221 100644 --- a/packages/screens/src/components/AdminArea/components/MediaPanel/components/MediaTitlePage/components/TitleVersions/TitleVersions.test.tsx +++ b/packages/screens/src/components/AdminArea/components/MediaPanel/components/MediaTitlePage/components/TitleVersions/TitleVersions.test.tsx @@ -38,7 +38,7 @@ const PATHS = { one: '/films/A/a.mkv', two: '/films/A/a.extended.mkv' }; describe('TitleVersions', () => { it('names a version once typing is done, and makes another play by default', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render( { it('splits a version off through Fix match for that file alone', async () => { const onSplit = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const extended = aVersion('two', 'Extended'); render( diff --git a/packages/screens/src/components/AdminArea/components/MediaPanel/components/SaveViewDialog/SaveViewDialog.test.tsx b/packages/screens/src/components/AdminArea/components/MediaPanel/components/SaveViewDialog/SaveViewDialog.test.tsx index 22401642a8..4055ba9034 100644 --- a/packages/screens/src/components/AdminArea/components/MediaPanel/components/SaveViewDialog/SaveViewDialog.test.tsx +++ b/packages/screens/src/components/AdminArea/components/MediaPanel/components/SaveViewDialog/SaveViewDialog.test.tsx @@ -6,7 +6,7 @@ import { SaveViewDialog } from './SaveViewDialog'; describe('SaveViewDialog', () => { it('saves under the name typed, and not with none', async () => { const onSave = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(); diff --git a/packages/screens/src/components/AdminArea/components/MediaPanel/components/WordsManagerDialog/WordsManagerDialog.test.tsx b/packages/screens/src/components/AdminArea/components/MediaPanel/components/WordsManagerDialog/WordsManagerDialog.test.tsx index e7e6d659b8..ade3b271c8 100644 --- a/packages/screens/src/components/AdminArea/components/MediaPanel/components/WordsManagerDialog/WordsManagerDialog.test.tsx +++ b/packages/screens/src/components/AdminArea/components/MediaPanel/components/WordsManagerDialog/WordsManagerDialog.test.tsx @@ -33,7 +33,7 @@ beforeEach(() => { describe('WordsManagerDialog', () => { it('renames a genre on every title in the library that carries it, and on titles scanned later', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(, { wrapper: CacheScope }); @@ -63,7 +63,7 @@ describe('WordsManagerDialog', () => { }); it('takes a tag off every title once asked to, never at the first press', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(, { wrapper: CacheScope }); await user.click(await screen.findByRole('button', { name: 'Tags' })); diff --git a/packages/screens/src/components/AdminArea/components/MediaPanel/components/WordsManagerDialog/components/WordRow/WordRow.test.tsx b/packages/screens/src/components/AdminArea/components/MediaPanel/components/WordsManagerDialog/components/WordRow/WordRow.test.tsx index a4d5bed7ca..871c578af7 100644 --- a/packages/screens/src/components/AdminArea/components/MediaPanel/components/WordsManagerDialog/components/WordRow/WordRow.test.tsx +++ b/packages/screens/src/components/AdminArea/components/MediaPanel/components/WordsManagerDialog/components/WordRow/WordRow.test.tsx @@ -6,7 +6,7 @@ import { WordRow } from './WordRow'; describe('WordRow', () => { it('renames only once the name is changed, and on Enter', async () => { const onRename = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render( , diff --git a/packages/screens/src/components/AdminArea/components/PluginsPanel/components/PluginSettingsDialog/PluginSettingsDialog.test.tsx b/packages/screens/src/components/AdminArea/components/PluginsPanel/components/PluginSettingsDialog/PluginSettingsDialog.test.tsx index e468255c56..6bf5db0ad2 100644 --- a/packages/screens/src/components/AdminArea/components/PluginsPanel/components/PluginSettingsDialog/PluginSettingsDialog.test.tsx +++ b/packages/screens/src/components/AdminArea/components/PluginsPanel/components/PluginSettingsDialog/PluginSettingsDialog.test.tsx @@ -30,7 +30,7 @@ describe('PluginSettingsDialog', () => { expect(screen.getByPlaceholderText('Saved. Type to replace it.')).toBeInTheDocument(); await userEvent.clear(screen.getByLabelText('Client id')); - await userEvent.type(screen.getByLabelText('Client id'), 'new-id'); + await userEvent.type(screen.getByLabelText('Client id'), 'new-id', { delay: null }); await userEvent.click(screen.getByRole('switch', { name: 'Send progress' })); await userEvent.click(screen.getByRole('button', { name: 'Save' })); @@ -103,7 +103,7 @@ describe('PluginSettingsDialog', () => { expect(screen.getByText('From 1 to 100.')).toBeInTheDocument(); await userEvent.clear(screen.getByLabelText('Pages')); - await userEvent.type(screen.getByLabelText('Pages'), '12'); + await userEvent.type(screen.getByLabelText('Pages'), '12', { delay: null }); await userEvent.clear(screen.getByLabelText('Retries')); await userEvent.click(screen.getByRole('button', { name: 'Save' })); @@ -142,7 +142,7 @@ describe('PluginSettingsDialog', () => { />, ); - await userEvent.type(screen.getByLabelText('Client secret'), 's3cret'); + await userEvent.type(screen.getByLabelText('Client secret'), 's3cret', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Save' })); await waitFor(() => { diff --git a/packages/screens/src/components/AdminArea/components/PluginsPanel/components/TrustedKeysCard/TrustedKeysCard.test.tsx b/packages/screens/src/components/AdminArea/components/PluginsPanel/components/TrustedKeysCard/TrustedKeysCard.test.tsx index 92741572ff..0c6e3a6118 100644 --- a/packages/screens/src/components/AdminArea/components/PluginsPanel/components/TrustedKeysCard/TrustedKeysCard.test.tsx +++ b/packages/screens/src/components/AdminArea/components/PluginsPanel/components/TrustedKeysCard/TrustedKeysCard.test.tsx @@ -25,8 +25,8 @@ const KEYS = [ */ const typeAKey = async (id: string, publicKey: string) => { await userEvent.click(screen.getByRole('button', { name: 'Add key' })); - await userEvent.type(await screen.findByLabelText('Key id'), id); - await userEvent.type(screen.getByLabelText('Public key'), publicKey); + await userEvent.type(await screen.findByLabelText('Key id'), id, { delay: null }); + await userEvent.type(screen.getByLabelText('Public key'), publicKey, { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Trust key' })); }; diff --git a/packages/screens/src/components/AdminArea/components/ProfileEditor/ProfileEditor.test.tsx b/packages/screens/src/components/AdminArea/components/ProfileEditor/ProfileEditor.test.tsx index c16650c012..5263e4d37f 100644 --- a/packages/screens/src/components/AdminArea/components/ProfileEditor/ProfileEditor.test.tsx +++ b/packages/screens/src/components/AdminArea/components/ProfileEditor/ProfileEditor.test.tsx @@ -102,7 +102,7 @@ describe('ProfileEditor', () => { }); it('adds a video profile, ranking what it takes and sizing each quality, for the libraries chosen', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onSaved, onClose } = open(); await user.type(screen.getByRole('textbox', { name: 'Name' }), 'UHD'); @@ -158,7 +158,7 @@ describe('ProfileEditor', () => { }); it('prefers releases in the language chosen, and takes the library’s otherwise', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -176,7 +176,7 @@ describe('ProfileEditor', () => { }); it('says how anime is fetched, with subtitles until it is told otherwise', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -194,7 +194,7 @@ describe('ProfileEditor', () => { }); it('leaves a profile naming no library, which offers it for all of them', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -212,7 +212,7 @@ describe('ProfileEditor', () => { }); it('keeps a profile to the roles and people named on it', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -232,7 +232,7 @@ describe('ProfileEditor', () => { }); it('stops asking who a profile is for once everything goes through it', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -255,7 +255,7 @@ describe('ProfileEditor', () => { }); it('asks a music profile for formats, sizes an album, and offers music libraries', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -271,7 +271,7 @@ describe('ProfileEditor', () => { }); it('says there are no libraries of the kind yet', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); fetchLibraries.mockResolvedValue([]); @@ -285,7 +285,7 @@ describe('ProfileEditor', () => { }); it('asks how far to upgrade, from what the profile takes', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(KEPT); @@ -309,7 +309,7 @@ describe('ProfileEditor', () => { }); it('asks a music profile how far to upgrade by format', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open({ ...KEPT, kind: 'music', isUpgrading: true }); @@ -328,7 +328,7 @@ describe('ProfileEditor', () => { }); it('goes back to the tab holding whatever is wrong, so it is not hidden', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); @@ -349,7 +349,7 @@ describe('ProfileEditor', () => { }); addProfile.mockResolvedValueOnce({ value: null, refusal: null }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); open(); diff --git a/packages/screens/src/components/AdminArea/components/ProfileEditor/components/CustomFormats/CustomFormats.test.tsx b/packages/screens/src/components/AdminArea/components/ProfileEditor/components/CustomFormats/CustomFormats.test.tsx index ae8d1c7380..6a8224e500 100644 --- a/packages/screens/src/components/AdminArea/components/ProfileEditor/components/CustomFormats/CustomFormats.test.tsx +++ b/packages/screens/src/components/AdminArea/components/ProfileEditor/components/CustomFormats/CustomFormats.test.tsx @@ -31,7 +31,7 @@ describe('CustomFormats', () => { it('changes a format’s name and score, and adds and removes conditions', async () => { const onChange = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(); @@ -58,7 +58,7 @@ describe('CustomFormats', () => { it('turns a condition round, or makes it required', async () => { const onChange = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(); diff --git a/packages/screens/src/components/AdminArea/components/RefuseRequestDialog/RefuseRequestDialog.test.tsx b/packages/screens/src/components/AdminArea/components/RefuseRequestDialog/RefuseRequestDialog.test.tsx index d56e8edcf8..9cba243e5c 100644 --- a/packages/screens/src/components/AdminArea/components/RefuseRequestDialog/RefuseRequestDialog.test.tsx +++ b/packages/screens/src/components/AdminArea/components/RefuseRequestDialog/RefuseRequestDialog.test.tsx @@ -26,7 +26,7 @@ beforeEach(() => { describe('RefuseRequestDialog', () => { it('refuses a request, saying why to whoever asked', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const handlers = { onClose: vi.fn(), onRefused: vi.fn() }; renderInAnAddress(); @@ -44,7 +44,7 @@ describe('RefuseRequestDialog', () => { }); it('says why it could not be refused', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); refuseMediaRequest.mockResolvedValue({ value: null, refusal: { message: 'Not yours' } }); renderInAnAddress( diff --git a/packages/screens/src/components/AdminArea/components/ReleaseSearchPanel/ReleaseSearchPanel.test.tsx b/packages/screens/src/components/AdminArea/components/ReleaseSearchPanel/ReleaseSearchPanel.test.tsx index 7feea5e37a..e3b9962b35 100644 --- a/packages/screens/src/components/AdminArea/components/ReleaseSearchPanel/ReleaseSearchPanel.test.tsx +++ b/packages/screens/src/components/AdminArea/components/ReleaseSearchPanel/ReleaseSearchPanel.test.tsx @@ -255,7 +255,7 @@ describe('ReleaseSearchPanel', () => { }); it('searches every indexer, listing the most widely shared first', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -273,7 +273,7 @@ describe('ReleaseSearchPanel', () => { }); it('searches one indexer alone, judged against a profile, from words already typed', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress( { />, ); + expect(await screen.findByText('Scored against HD')).toBeInTheDocument(); + await user.click(screen.getByRole('button', { name: 'Search' })); await waitFor(() => { @@ -296,7 +298,7 @@ describe('ReleaseSearchPanel', () => { }); it('says what each indexer found, and why one found nothing', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -309,7 +311,7 @@ describe('ReleaseSearchPanel', () => { }); it('shows a usenet release by how often it was fetched', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -319,7 +321,7 @@ describe('ReleaseSearchPanel', () => { }); it('searches for an episode of a series by season and number', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -339,7 +341,7 @@ describe('ReleaseSearchPanel', () => { }); it('leaves out a season nobody typed', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -352,7 +354,7 @@ describe('ReleaseSearchPanel', () => { }); it('searches nothing for no words', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -362,7 +364,7 @@ describe('ReleaseSearchPanel', () => { }); it('copies a release’s magnet link', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -379,7 +381,7 @@ describe('ReleaseSearchPanel', () => { }); it('saves a release fetched through Valence', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -400,7 +402,7 @@ describe('ReleaseSearchPanel', () => { refusal: null, }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -419,7 +421,7 @@ describe('ReleaseSearchPanel', () => { it('says why a release could not be saved', async () => { fetchRelease.mockResolvedValue({ value: null, refusal: { message: 'The site returned 410' } }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -439,7 +441,7 @@ describe('ReleaseSearchPanel', () => { }); it('sends a release to the first torrent client that is on', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -472,7 +474,7 @@ describe('ReleaseSearchPanel', () => { pickedId: null, }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -490,7 +492,7 @@ describe('ReleaseSearchPanel', () => { }); it('sends what was searched for as that kind', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -527,7 +529,7 @@ describe('ReleaseSearchPanel', () => { pickedId: 'Dune.Part.Two.2024.1080p.BluRay', }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -554,7 +556,7 @@ describe('ReleaseSearchPanel', () => { }); it('asks no running time of a music profile, and leaves out an empty one', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -582,7 +584,7 @@ describe('ReleaseSearchPanel', () => { }); it('offers only the profiles that judge what is being searched for', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -600,7 +602,7 @@ describe('ReleaseSearchPanel', () => { }); it('offers no profile for a book, which none of them judge', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -621,7 +623,7 @@ describe('ReleaseSearchPanel', () => { }); sendRelease.mockResolvedValueOnce({ value: null, refusal: null }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -641,7 +643,7 @@ describe('ReleaseSearchPanel', () => { }); it('offers no client for a release nothing switched on can take', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -660,7 +662,7 @@ describe('ReleaseSearchPanel', () => { vi.stubGlobal('open', open); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -685,7 +687,7 @@ describe('ReleaseSearchPanel', () => { pickedId: null, }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -702,7 +704,7 @@ describe('ReleaseSearchPanel', () => { pickedId: null, }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -714,7 +716,7 @@ describe('ReleaseSearchPanel', () => { it('says it could not search, and offers to try again', async () => { searchReleases.mockRejectedValue(new Error('offline')); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); diff --git a/packages/screens/src/components/AdminArea/components/RolesPanel/RolesPanel.test.tsx b/packages/screens/src/components/AdminArea/components/RolesPanel/RolesPanel.test.tsx index 255ee5071f..3e0b2b6742 100644 --- a/packages/screens/src/components/AdminArea/components/RolesPanel/RolesPanel.test.tsx +++ b/packages/screens/src/components/AdminArea/components/RolesPanel/RolesPanel.test.tsx @@ -241,7 +241,7 @@ describe('RolesPanel', () => { }); it('opens the role that was chosen', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await waitForOpen('Administrator'); @@ -254,7 +254,7 @@ describe('RolesPanel', () => { describe('saving a role', () => { it('shows the save bar once something changes, and sends only what changed', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await choose(user, 'Member'); @@ -277,7 +277,7 @@ describe('RolesPanel', () => { }); it('adds a permission the role did not have, once the change is saved', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await choose(user, 'Member'); @@ -296,7 +296,7 @@ describe('RolesPanel', () => { }); it('gives the role to somebody and sets its limit without touching the rest', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await choose(user, 'Moderator'); @@ -323,7 +323,7 @@ describe('RolesPanel', () => { }); it('reads the roles again once a save lands', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await waitForOpen('Administrator'); @@ -338,7 +338,7 @@ describe('RolesPanel', () => { it('says why the server refused, keeping what was typed', async () => { mocks.updateRole.mockResolvedValue(REFUSED); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await choose(user, 'Member'); @@ -353,7 +353,7 @@ describe('RolesPanel', () => { }); it('drops every change on Reset', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await choose(user, 'Member'); @@ -375,7 +375,7 @@ describe('RolesPanel', () => { describe('switching roles with changes unsaved', () => { it('asks before throwing the changes away', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await choose(user, 'Member'); @@ -389,7 +389,7 @@ describe('RolesPanel', () => { }); it('stays on the role with its changes where the person cancels', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await choose(user, 'Member'); @@ -411,7 +411,7 @@ describe('RolesPanel', () => { }); it('opens the other role, the changes gone, where the person discards', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await choose(user, 'Member'); @@ -434,7 +434,7 @@ describe('RolesPanel', () => { describe('creating a role', () => { it('opens an unsaved New role at the foot of the list', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await waitForOpen('Administrator'); @@ -454,7 +454,7 @@ describe('RolesPanel', () => { }); it('makes the role, then gives it its members and limit, and opens it', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await waitForOpen('Administrator'); @@ -491,7 +491,7 @@ describe('RolesPanel', () => { }); it('drops the role being made on Cancel', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await waitForOpen('Administrator'); @@ -508,7 +508,7 @@ describe('RolesPanel', () => { describe('putting the roles in order', () => { it('moves a role up, sending every role in its new order', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await pickFromMenu(user, 'Member', /Move up/); @@ -519,7 +519,7 @@ describe('RolesPanel', () => { }); it('moves a role down, sending every role in its new order', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await pickFromMenu(user, 'Administrator', /Move down/); @@ -532,7 +532,7 @@ describe('RolesPanel', () => { it('keeps roles out of reach on top of the order it sends', async () => { mocks.fetchRoles.mockResolvedValue({ roles: ROLES, outOfReach: [ADMINISTRATOR.id] }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await pickFromMenu(user, 'Member', /Move up/); @@ -543,7 +543,7 @@ describe('RolesPanel', () => { }); it('reads the roles again once the order is sent', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await pickFromMenu(user, 'Member', /Move up/); @@ -571,7 +571,7 @@ describe('RolesPanel', () => { }); it('open read-only, saying why', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await waitForOpen('Moderator'); @@ -592,7 +592,7 @@ describe('RolesPanel', () => { describe('deleting a role', () => { it('asks first, then deletes it and reads the roles again', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await pickFromMenu(user, 'Moderator', /Delete role/); @@ -613,7 +613,7 @@ describe('RolesPanel', () => { }); it('deletes nothing where the person cancels', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await pickFromMenu(user, 'Moderator', /Delete role/); @@ -631,7 +631,7 @@ describe('RolesPanel', () => { }); it('refuses for a role that grants everything', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); await user.click(await screen.findByRole('button', { name: 'Actions for Administrator' })); diff --git a/packages/screens/src/components/AdminArea/components/RolesPanel/components/PermissionEditor/PermissionEditor.test.tsx b/packages/screens/src/components/AdminArea/components/RolesPanel/components/PermissionEditor/PermissionEditor.test.tsx index 2247633217..72e88ca86b 100644 --- a/packages/screens/src/components/AdminArea/components/RolesPanel/components/PermissionEditor/PermissionEditor.test.tsx +++ b/packages/screens/src/components/AdminArea/components/RolesPanel/components/PermissionEditor/PermissionEditor.test.tsx @@ -127,13 +127,17 @@ describe('PermissionEditor', () => { />, ); - await userEvent.type(screen.getByRole('searchbox', { name: 'Search permissions' }), 'in step'); + await userEvent.type(screen.getByRole('searchbox', { name: 'Search permissions' }), 'in step', { + delay: null, + }); expect(screen.getByText('Sync lists')).toBeInTheDocument(); expect(screen.queryByText('Import playlists')).toBeNull(); await userEvent.clear(screen.getByRole('searchbox', { name: 'Search permissions' })); - await userEvent.type(screen.getByRole('searchbox', { name: 'Search permissions' }), 'zzzz'); + await userEvent.type(screen.getByRole('searchbox', { name: 'Search permissions' }), 'zzzz', { + delay: null, + }); expect(screen.getByText('Nothing matches your search.')).toBeInTheDocument(); }); diff --git a/packages/screens/src/components/AdminArea/components/RolesPanel/components/RoleEditor/RoleEditor.test.tsx b/packages/screens/src/components/AdminArea/components/RolesPanel/components/RoleEditor/RoleEditor.test.tsx index b2fcfb932e..d541417882 100644 --- a/packages/screens/src/components/AdminArea/components/RolesPanel/components/RoleEditor/RoleEditor.test.tsx +++ b/packages/screens/src/components/AdminArea/components/RolesPanel/components/RoleEditor/RoleEditor.test.tsx @@ -153,7 +153,7 @@ describe('RoleEditor', () => { }); it('raises the save bar once something changes, and tells the panel', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const props = draw(); await user.type(screen.getByRole('textbox', { name: 'Name' }), 's'); @@ -164,7 +164,7 @@ describe('RoleEditor', () => { }); it('saves only the name where only the name changed', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const props = draw(); await user.type(screen.getByRole('textbox', { name: 'Name' }), 's'); @@ -180,7 +180,7 @@ describe('RoleEditor', () => { }); it('saves only the permissions where only the permissions changed', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const props = draw(); await user.click(screen.getByRole('switch', { name: 'Run and schedule jobs' })); @@ -195,7 +195,7 @@ describe('RoleEditor', () => { }); it('gives and takes the role as switched on its members tab, and no more', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const props = draw(); await openTab(user, 'Members (1)'); @@ -213,7 +213,7 @@ describe('RoleEditor', () => { }); it('counts members as the draft stands', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); draw(); @@ -224,7 +224,7 @@ describe('RoleEditor', () => { }); it('saves only the streaming limit where only the limit changed', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const props = draw(); await waitFor(() => { @@ -248,7 +248,7 @@ describe('RoleEditor', () => { }); it('counts a limit chosen and then put back as no change', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); draw(); @@ -270,7 +270,7 @@ describe('RoleEditor', () => { }); it('drops every change on Reset', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const props = draw(); await user.type(screen.getByRole('textbox', { name: 'Name' }), 's'); @@ -286,7 +286,7 @@ describe('RoleEditor', () => { }); it('will not save a role with no name', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const props = draw(); await user.clear(screen.getByRole('textbox', { name: 'Name' })); @@ -302,7 +302,7 @@ describe('RoleEditor', () => { it('says why the server refused, keeping what was changed', async () => { mocks.updateRole.mockResolvedValue({ message: 'That role is equal to or higher than yours.' }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const props = draw(); await user.type(screen.getByRole('textbox', { name: 'Name' }), 's'); @@ -318,7 +318,7 @@ describe('RoleEditor', () => { it('stops at the first refusal, saving nothing after it', async () => { mocks.updateRole.mockResolvedValue({ message: 'That role is equal to or higher than yours.' }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); draw(); @@ -345,7 +345,7 @@ describe('RoleEditor', () => { }); it('is abandoned with Cancel', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const props = draw({ role: null }); await user.click(screen.getByRole('button', { name: 'Cancel' })); @@ -355,7 +355,7 @@ describe('RoleEditor', () => { }); it('will not make a role with no name', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); draw({ role: null }); @@ -373,7 +373,7 @@ describe('RoleEditor', () => { refusal: null, }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const props = draw({ role: null }); await user.type(screen.getByRole('textbox', { name: 'Name' }), ' Housemate '); @@ -413,7 +413,7 @@ describe('RoleEditor', () => { refusal: null, }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const props = draw({ role: null }); await user.type(screen.getByRole('textbox', { name: 'Name' }), 'Housemate'); @@ -432,7 +432,7 @@ describe('RoleEditor', () => { refusal: { message: 'That role is equal to or higher than yours.' }, }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const props = draw({ role: null }); await user.type(screen.getByRole('textbox', { name: 'Name' }), 'Housemate'); @@ -463,7 +463,7 @@ describe('RoleEditor', () => { }); it('still lets its tabs be read', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); draw({ role: ADMINISTRATOR, diff --git a/packages/screens/src/components/AdminArea/components/RolesPanel/components/RoleMembers/RoleMembers.test.tsx b/packages/screens/src/components/AdminArea/components/RolesPanel/components/RoleMembers/RoleMembers.test.tsx index 9f3a813f36..803c38b983 100644 --- a/packages/screens/src/components/AdminArea/components/RolesPanel/components/RoleMembers/RoleMembers.test.tsx +++ b/packages/screens/src/components/AdminArea/components/RolesPanel/components/RoleMembers/RoleMembers.test.tsx @@ -79,7 +79,9 @@ describe('RoleMembers', () => { it('finds somebody by their username', async () => { render(); - await userEvent.type(screen.getByRole('searchbox', { name: 'Find someone' }), '@LOVE'); + await userEvent.type(screen.getByRole('searchbox', { name: 'Find someone' }), '@LOVE', { + delay: null, + }); expect(screen.getByText('Ada')).toBeVisible(); expect(screen.queryByText('Bo')).not.toBeInTheDocument(); @@ -91,13 +93,13 @@ describe('RoleMembers', () => { const search = screen.getByRole('searchbox', { name: 'Find someone' }); - await userEvent.type(search, 'example.com'); + await userEvent.type(search, 'example.com', { delay: null }); expect(screen.getByText('Bo')).toBeVisible(); expect(screen.queryByText('Ada')).not.toBeInTheDocument(); await userEvent.clear(search); - await userEvent.type(search, 'cy'); + await userEvent.type(search, 'cy', { delay: null }); expect(screen.getByText('Cy')).toBeVisible(); expect(screen.queryByText('Bo')).not.toBeInTheDocument(); @@ -106,7 +108,9 @@ describe('RoleMembers', () => { it('says when nobody matches', async () => { render(); - await userEvent.type(screen.getByRole('searchbox', { name: 'Find someone' }), 'zed'); + await userEvent.type(screen.getByRole('searchbox', { name: 'Find someone' }), 'zed', { + delay: null, + }); expect(screen.getByText('No one matches your search.')).toBeVisible(); }); diff --git a/packages/screens/src/components/AdminArea/components/SavedText/SavedText.test.tsx b/packages/screens/src/components/AdminArea/components/SavedText/SavedText.test.tsx index e295e47d64..572dc5cc46 100644 --- a/packages/screens/src/components/AdminArea/components/SavedText/SavedText.test.tsx +++ b/packages/screens/src/components/AdminArea/components/SavedText/SavedText.test.tsx @@ -6,7 +6,7 @@ import { SavedText } from './SavedText'; describe('SavedText', () => { it('offers to save only once the value changes, and saves it trimmed', async () => { const onSave = vi.fn(() => Promise.resolve(true)); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(); @@ -20,7 +20,7 @@ describe('SavedText', () => { }); it('says what is wrong with what was typed instead of offering to save it', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render( { }); it('keeps what was typed where the save is refused', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render( Promise.resolve(false)} />); diff --git a/packages/screens/src/components/AdminArea/components/SessionMessageDialog/SessionMessageDialog.test.tsx b/packages/screens/src/components/AdminArea/components/SessionMessageDialog/SessionMessageDialog.test.tsx index db677aebd1..37607e2b1a 100644 --- a/packages/screens/src/components/AdminArea/components/SessionMessageDialog/SessionMessageDialog.test.tsx +++ b/packages/screens/src/components/AdminArea/components/SessionMessageDialog/SessionMessageDialog.test.tsx @@ -25,7 +25,7 @@ describe('SessionMessageDialog', () => { }); it('sends what was typed', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onSend = vi.fn(() => Promise.resolve()); render(); @@ -36,7 +36,7 @@ describe('SessionMessageDialog', () => { }); it('trims what was typed, so a stray space is not the message', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onSend = vi.fn(() => Promise.resolve()); render(); @@ -47,7 +47,7 @@ describe('SessionMessageDialog', () => { }); it('will not send nothing, and says so', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onSend = vi.fn(() => Promise.resolve()); render(); @@ -58,7 +58,7 @@ describe('SessionMessageDialog', () => { }); it('will not send a line of only spaces', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onSend = vi.fn(() => Promise.resolve()); render(); @@ -69,7 +69,7 @@ describe('SessionMessageDialog', () => { }); it('says how much room is left rather than cutting the ending off', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await actor.type(screen.getByLabelText('Message'), 'Tea'); @@ -80,7 +80,7 @@ describe('SessionMessageDialog', () => { }); it('refuses to send one too long for the banner, rather than truncating it', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onSend = vi.fn(() => Promise.resolve()); render(); @@ -92,7 +92,7 @@ describe('SessionMessageDialog', () => { }); it('closes once the message has gone', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onClose = vi.fn(); render(); @@ -105,7 +105,7 @@ describe('SessionMessageDialog', () => { }); it('sends nothing when cancelled', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onSend = vi.fn(() => Promise.resolve()); render(); diff --git a/packages/screens/src/components/AdminArea/components/SettingsPanel/components/ServerCard/ServerCard.test.tsx b/packages/screens/src/components/AdminArea/components/SettingsPanel/components/ServerCard/ServerCard.test.tsx index 49171eb4e0..618117fc54 100644 --- a/packages/screens/src/components/AdminArea/components/SettingsPanel/components/ServerCard/ServerCard.test.tsx +++ b/packages/screens/src/components/AdminArea/components/SettingsPanel/components/ServerCard/ServerCard.test.tsx @@ -30,7 +30,7 @@ describe('ServerCard', () => { it('saves the name once the typing stops, not once a letter', async () => { vi.useFakeTimers({ shouldAdvanceTime: true }); - const user = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const user = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); renderWithAnswers(); @@ -47,7 +47,7 @@ describe('ServerCard', () => { }); it('saves the corners as they are chosen', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderWithAnswers(); @@ -57,7 +57,7 @@ describe('ServerCard', () => { }); it('saves the language the whole server speaks, and lets each device speak its own again', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderWithAnswers(); diff --git a/packages/screens/src/components/AdminArea/components/SettingsPanel/components/ServiceKeyRow/ServiceKeyRow.test.tsx b/packages/screens/src/components/AdminArea/components/SettingsPanel/components/ServiceKeyRow/ServiceKeyRow.test.tsx index f53f6d3ca9..0a247a90a4 100644 --- a/packages/screens/src/components/AdminArea/components/SettingsPanel/components/ServiceKeyRow/ServiceKeyRow.test.tsx +++ b/packages/screens/src/components/AdminArea/components/SettingsPanel/components/ServiceKeyRow/ServiceKeyRow.test.tsx @@ -25,7 +25,7 @@ describe('ServiceKeyRow', () => { }); it('saves a pasted key and says so', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const save = vi.fn(() => Promise.resolve(true)); const onSaved = vi.fn(); @@ -53,7 +53,7 @@ describe('ServiceKeyRow', () => { }); it('keeps the field open and says why where the key could not be saved', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render( Promise.resolve(false)} />); diff --git a/packages/screens/src/components/AdminArea/components/SettingsPanel/components/SignInCard/SignInCard.test.tsx b/packages/screens/src/components/AdminArea/components/SettingsPanel/components/SignInCard/SignInCard.test.tsx index 60d18d149a..859c563bf1 100644 --- a/packages/screens/src/components/AdminArea/components/SettingsPanel/components/SignInCard/SignInCard.test.tsx +++ b/packages/screens/src/components/AdminArea/components/SettingsPanel/components/SignInCard/SignInCard.test.tsx @@ -18,7 +18,7 @@ vi.mock('@ValenceClient/admin/fetchAdmin', () => saved); describe('SignInCard', () => { it('saves whether profiles are listed as it is switched', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderWithAnswers(); @@ -28,7 +28,7 @@ describe('SignInCard', () => { }); it('says why a background picture was refused, under the setting', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderWithAnswers(); @@ -62,7 +62,7 @@ describe('SignInCard', () => { }); it('adds an address and saves the lot', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderWithAnswers(); diff --git a/packages/screens/src/components/AdminArea/components/SettingsPanel/components/SignInCard/components/TrustedOriginsDialog/TrustedOriginsDialog.test.tsx b/packages/screens/src/components/AdminArea/components/SettingsPanel/components/SignInCard/components/TrustedOriginsDialog/TrustedOriginsDialog.test.tsx index 52be249a24..568b30936a 100644 --- a/packages/screens/src/components/AdminArea/components/SettingsPanel/components/SignInCard/components/TrustedOriginsDialog/TrustedOriginsDialog.test.tsx +++ b/packages/screens/src/components/AdminArea/components/SettingsPanel/components/SignInCard/components/TrustedOriginsDialog/TrustedOriginsDialog.test.tsx @@ -33,7 +33,9 @@ describe('TrustedOriginsDialog', () => { render(); - await userEvent.type(screen.getByLabelText('Add another address'), `${PUBLIC}{Enter}`); + await userEvent.type(screen.getByLabelText('Add another address'), `${PUBLIC}{Enter}`, { + delay: null, + }); await userEvent.click(screen.getByRole('button', { name: 'Save' })); expect(saved.saveTrustedOrigins).toHaveBeenCalledWith([HERE, PUBLIC]); diff --git a/packages/screens/src/components/AdminArea/components/StoragePanel/components/BucketDialog/BucketDialog.test.tsx b/packages/screens/src/components/AdminArea/components/StoragePanel/components/BucketDialog/BucketDialog.test.tsx index 146d368003..0a6ce695a9 100644 --- a/packages/screens/src/components/AdminArea/components/StoragePanel/components/BucketDialog/BucketDialog.test.tsx +++ b/packages/screens/src/components/AdminArea/components/StoragePanel/components/BucketDialog/BucketDialog.test.tsx @@ -16,10 +16,10 @@ vi.mock('@ValenceClient/admin/fetchBuckets', () => ({ })); const fillIn = async () => { - await userEvent.type(screen.getByLabelText(/^Name/u), 'Films'); - await userEvent.type(screen.getByLabelText(/^Bucket/u), 'media'); - await userEvent.type(screen.getByLabelText(/^Access key ID/u), 'key'); - await userEvent.type(screen.getByLabelText(/^Secret access key/u), 'secret'); + await userEvent.type(screen.getByLabelText(/^Name/u), 'Films', { delay: null }); + await userEvent.type(screen.getByLabelText(/^Bucket/u), 'media', { delay: null }); + await userEvent.type(screen.getByLabelText(/^Access key ID/u), 'key', { delay: null }); + await userEvent.type(screen.getByLabelText(/^Secret access key/u), 'secret', { delay: null }); }; beforeEach(() => { diff --git a/packages/screens/src/components/AdminArea/components/TitlePage/components/AnimeSettingsCard/AnimeSettingsCard.test.tsx b/packages/screens/src/components/AdminArea/components/TitlePage/components/AnimeSettingsCard/AnimeSettingsCard.test.tsx index 027bb638f3..f3550179a2 100644 --- a/packages/screens/src/components/AdminArea/components/TitlePage/components/AnimeSettingsCard/AnimeSettingsCard.test.tsx +++ b/packages/screens/src/components/AdminArea/components/TitlePage/components/AnimeSettingsCard/AnimeSettingsCard.test.tsx @@ -35,7 +35,7 @@ const props = () => ({ describe('AnimeSettingsCard', () => { it('chooses the speech, or its profile’s', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const given = props(); render(); @@ -47,7 +47,7 @@ describe('AnimeSettingsCard', () => { }); it('keeps the show to a release group', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const given = props(); render(); @@ -59,7 +59,7 @@ describe('AnimeSettingsCard', () => { }); it('works its cours out by an episode group chosen', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const given = props(); render(); @@ -71,7 +71,7 @@ describe('AnimeSettingsCard', () => { }); it('says the names it is searched by, and opens its films', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const given = props(); render(); diff --git a/packages/screens/src/components/AdminArea/components/TitlePage/components/RequestReleasesTab/RequestReleasesTab.test.tsx b/packages/screens/src/components/AdminArea/components/TitlePage/components/RequestReleasesTab/RequestReleasesTab.test.tsx index 5ff612484e..baf9a858e5 100644 --- a/packages/screens/src/components/AdminArea/components/TitlePage/components/RequestReleasesTab/RequestReleasesTab.test.tsx +++ b/packages/screens/src/components/AdminArea/components/TitlePage/components/RequestReleasesTab/RequestReleasesTab.test.tsx @@ -67,7 +67,7 @@ const answering = () => { describe('RequestReleasesTab', () => { it('leaves out the releases that are some other title until they are asked for', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); answering(); @@ -93,7 +93,7 @@ describe('RequestReleasesTab', () => { }); it('searches again on only the indexers chosen', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const request = aMediaRequest({ kind: 'series', title: 'The Melancholy of Haruhi Suzumiya' }); answering(); @@ -112,7 +112,7 @@ describe('RequestReleasesTab', () => { }); it('searches by what is typed, and goes back to its own search', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const request = aMediaRequest({ kind: 'film', title: 'Star Trek' }); answering(); diff --git a/packages/screens/src/components/AdminArea/components/WebhooksPanel/components/NewWebhookDialog/NewWebhookDialog.test.tsx b/packages/screens/src/components/AdminArea/components/WebhooksPanel/components/NewWebhookDialog/NewWebhookDialog.test.tsx index 77b8c1ce73..af62f423d0 100644 --- a/packages/screens/src/components/AdminArea/components/WebhooksPanel/components/NewWebhookDialog/NewWebhookDialog.test.tsx +++ b/packages/screens/src/components/AdminArea/components/WebhooksPanel/components/NewWebhookDialog/NewWebhookDialog.test.tsx @@ -15,7 +15,7 @@ const drawn = (refusal: Refusal = null) => { describe('NewWebhookDialog', () => { it('offers every service but Custom, which is chosen on the webhook’s page', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); drawn(); await user.click(screen.getByRole('button', { name: 'Service' })); @@ -25,7 +25,7 @@ describe('NewWebhookDialog', () => { }); it('says under the address what is wrong with it, and sends nothing', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onCreate } = drawn(); await user.click(screen.getByRole('button', { name: 'Create' })); @@ -40,7 +40,7 @@ describe('NewWebhookDialog', () => { }); it('names a webhook after its service where no name was given, starting with failed jobs', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onCreate, onClose } = drawn(); await user.type(screen.getByRole('textbox', { name: 'Address' }), 'https://hooks.example/a'); @@ -58,7 +58,7 @@ describe('NewWebhookDialog', () => { }); it('starts a webhook on the local network where the switch is turned on', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onCreate } = drawn(); await user.type(screen.getByRole('textbox', { name: 'Address' }), 'http://192.168.1.5/hook'); @@ -69,7 +69,7 @@ describe('NewWebhookDialog', () => { }); it('keeps a new webhook off the local network by default', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onCreate } = drawn(); await user.type(screen.getByRole('textbox', { name: 'Address' }), 'https://hooks.example/a'); @@ -79,7 +79,7 @@ describe('NewWebhookDialog', () => { }); it('stays open and says why where the server refuses', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onClose } = drawn({ message: 'That address points inside this network.' }); await user.type(screen.getByRole('textbox', { name: 'Address' }), 'https://hooks.example/a'); diff --git a/packages/screens/src/components/AdminArea/components/WebhooksPanel/components/WebhookPage/WebhookPage.test.tsx b/packages/screens/src/components/AdminArea/components/WebhooksPanel/components/WebhookPage/WebhookPage.test.tsx index 5e850f4363..edd2843892 100644 --- a/packages/screens/src/components/AdminArea/components/WebhooksPanel/components/WebhookPage/WebhookPage.test.tsx +++ b/packages/screens/src/components/AdminArea/components/WebhooksPanel/components/WebhookPage/WebhookPage.test.tsx @@ -79,7 +79,7 @@ describe('WebhookPage', () => { }); it('starts a webhook turned Custom with the default setup', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onEdit } = drawn(aWebhook()); await user.click(screen.getByRole('button', { name: 'Service' })); @@ -92,7 +92,7 @@ describe('WebhookPage', () => { }); it('turns the local network on and off for the webhook', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onEdit } = drawn(aWebhook()); await user.click(screen.getByRole('switch', { name: 'Local network' })); @@ -101,7 +101,7 @@ describe('WebhookPage', () => { }); it('keeps a Custom setup already saved when turned back to Custom', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onEdit } = drawn(aWebhook({ custom: DEFAULT_CUSTOM_WEBHOOK })); await user.click(screen.getByRole('button', { name: 'Service' })); @@ -111,7 +111,7 @@ describe('WebhookPage', () => { }); it('saves the Custom message with the rest of its setup', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const custom = { ...DEFAULT_CUSTOM_WEBHOOK, format: 'text' as const, template: '{{title}}' }; const { onEdit } = drawn(aWebhook({ preset: 'custom', custom })); @@ -124,7 +124,7 @@ describe('WebhookPage', () => { }); it('says under the address what is wrong with a new one rather than saving it', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onEdit } = drawn(aWebhook()); await user.clear(screen.getByRole('textbox', { name: 'Address' })); @@ -135,7 +135,7 @@ describe('WebhookPage', () => { }); it('sends a failed delivery again', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onRedeliver } = drawn(aWebhook(), { deliveries: [FAILED] }); expect(screen.getByText('The receiver answered 500.')).toBeInTheDocument(); @@ -146,7 +146,7 @@ describe('WebhookPage', () => { }); it('goes back to every webhook', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const { onBack } = drawn(aWebhook()); await user.click(screen.getByRole('button', { name: 'Back to Webhooks' })); diff --git a/packages/screens/src/components/AdminPage/components/AdminSearch/AdminSearch.test.tsx b/packages/screens/src/components/AdminPage/components/AdminSearch/AdminSearch.test.tsx index c7aabe8467..4547bcf0c1 100644 --- a/packages/screens/src/components/AdminPage/components/AdminSearch/AdminSearch.test.tsx +++ b/packages/screens/src/components/AdminPage/components/AdminSearch/AdminSearch.test.tsx @@ -18,7 +18,7 @@ const SECTIONS = [ describe('AdminSearch', () => { it('opens the palette from the bar, and goes to the page chosen', async () => { const onGo = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(); @@ -40,7 +40,7 @@ describe('AdminSearch', () => { it('finds an action forgivingly, and asks its page to carry it out', async () => { const onGo = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(); @@ -53,7 +53,7 @@ describe('AdminSearch', () => { }); it('offers only actions whose page this admin can reach', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(); diff --git a/packages/screens/src/components/ApiKeyPanel/ApiKeyPanel.test.tsx b/packages/screens/src/components/ApiKeyPanel/ApiKeyPanel.test.tsx index 62e8d739f5..24fe9f1e04 100644 --- a/packages/screens/src/components/ApiKeyPanel/ApiKeyPanel.test.tsx +++ b/packages/screens/src/components/ApiKeyPanel/ApiKeyPanel.test.tsx @@ -89,7 +89,7 @@ describe('ApiKeyPanel', () => { }); it('makes a key with the name it was given', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); createMock.mockReturnValue(Promise.resolve({ ...key(), key: 'valence_secret' })); @@ -109,7 +109,7 @@ describe('ApiKeyPanel', () => { }); it('shows the key itself once it is made, and warns that it will not be again', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); createMock.mockReturnValue(Promise.resolve({ ...key(), key: 'valence_secret' })); @@ -123,7 +123,7 @@ describe('ApiKeyPanel', () => { }); it('refuses to make one with no name, rather than making an unnamed key', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(); @@ -133,7 +133,7 @@ describe('ApiKeyPanel', () => { }); it('turns a key off without revoking it', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); fetchMock.mockReturnValue(Promise.resolve([key()])); @@ -145,7 +145,7 @@ describe('ApiKeyPanel', () => { }); it('turns one back on', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); fetchMock.mockReturnValue(Promise.resolve([key({ enabled: false })])); @@ -157,7 +157,7 @@ describe('ApiKeyPanel', () => { }); it('revokes a key', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); fetchMock.mockReturnValue(Promise.resolve([key()])); diff --git a/packages/screens/src/components/ApiKeyPanel/components/ApiKeyList/ApiKeyList.test.tsx b/packages/screens/src/components/ApiKeyPanel/components/ApiKeyList/ApiKeyList.test.tsx index 93b47d5e23..01ecc23a47 100644 --- a/packages/screens/src/components/ApiKeyPanel/components/ApiKeyList/ApiKeyList.test.tsx +++ b/packages/screens/src/components/ApiKeyPanel/components/ApiKeyList/ApiKeyList.test.tsx @@ -49,7 +49,7 @@ const draw = (overrides: Partial = {}) => { />, ); - return { ...calls, user: userEvent.setup() }; + return { ...calls, user: userEvent.setup({ delay: null }) }; }; describe('ApiKeyList', () => { diff --git a/packages/screens/src/components/AppPasswordsPanel/components/AppPasswordSection/AppPasswordSection.test.tsx b/packages/screens/src/components/AppPasswordsPanel/components/AppPasswordSection/AppPasswordSection.test.tsx index 4e1e4b1b59..8254443c64 100644 --- a/packages/screens/src/components/AppPasswordsPanel/components/AppPasswordSection/AppPasswordSection.test.tsx +++ b/packages/screens/src/components/AppPasswordsPanel/components/AppPasswordSection/AppPasswordSection.test.tsx @@ -56,7 +56,7 @@ describe('AppPasswordSection', () => { }); it('makes a password for what somebody typed, and shows its address, username and secret once', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -70,7 +70,7 @@ describe('AppPasswordSection', () => { }); it('removes a password only once somebody says so', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); fetchAppPasswords.mockResolvedValue({ address: ADDRESS, routes: [], passwords: [PHONE] }); renderInAnAddress(); @@ -92,7 +92,7 @@ describe('AppPasswordSection', () => { }); it('stops showing a password just made once it is removed', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); diff --git a/packages/screens/src/components/CollectionEditDialog/CollectionEditDialog.test.tsx b/packages/screens/src/components/CollectionEditDialog/CollectionEditDialog.test.tsx index 17f0d5ddff..17dec2c3bd 100644 --- a/packages/screens/src/components/CollectionEditDialog/CollectionEditDialog.test.tsx +++ b/packages/screens/src/components/CollectionEditDialog/CollectionEditDialog.test.tsx @@ -73,7 +73,7 @@ describe('CollectionEditDialog', () => { />, ); - await userEvent.type(screen.getByLabelText('Name'), 'Saga'); + await userEvent.type(screen.getByLabelText('Name'), 'Saga', { delay: null }); await userEvent.click(screen.getByRole('switch', { name: 'The order matters' })); await userEvent.click(screen.getByRole('button', { name: 'Create' })); @@ -102,7 +102,7 @@ describe('CollectionEditDialog', () => { renderInAnAddress(); - await userEvent.type(screen.getByLabelText('Name'), 'Saga'); + await userEvent.type(screen.getByLabelText('Name'), 'Saga', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Create' })); expect( @@ -115,7 +115,9 @@ describe('CollectionEditDialog', () => { renderInAnAddress(); - await userEvent.type(screen.getByLabelText('Description'), 'Every one of them'); + await userEvent.type(screen.getByLabelText('Description'), 'Every one of them', { + delay: null, + }); await userEvent.click(screen.getByRole('button', { name: 'Save' })); await waitFor(() => { @@ -134,7 +136,7 @@ describe('CollectionEditDialog', () => { expect(screen.getByRole('heading', { name: 'New smart collection' })).toBeInTheDocument(); expect(screen.queryByText('Who sees it')).not.toBeInTheDocument(); - await userEvent.type(screen.getByLabelText('Name'), 'Unwatched'); + await userEvent.type(screen.getByLabelText('Name'), 'Unwatched', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Add a rule' })); await userEvent.click(screen.getByRole('button', { name: 'Create' })); @@ -158,7 +160,7 @@ describe('CollectionEditDialog', () => { mayEditLibraries.mockReturnValue(true); renderInAnAddress(); - await userEvent.type(screen.getByLabelText('Name'), 'For everyone'); + await userEvent.type(screen.getByLabelText('Name'), 'For everyone', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Everyone' })); await userEvent.click(screen.getByRole('button', { name: 'Create' })); @@ -184,7 +186,7 @@ describe('CollectionEditDialog', () => { />, ); - await userEvent.type(screen.getByLabelText('Name'), 'Dramas'); + await userEvent.type(screen.getByLabelText('Name'), 'Dramas', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Create' })); await waitFor(() => { diff --git a/packages/screens/src/components/ConnectToServer/ConnectToServer.test.tsx b/packages/screens/src/components/ConnectToServer/ConnectToServer.test.tsx index 43ea774099..e69ee47b41 100644 --- a/packages/screens/src/components/ConnectToServer/ConnectToServer.test.tsx +++ b/packages/screens/src/components/ConnectToServer/ConnectToServer.test.tsx @@ -10,7 +10,7 @@ vi.mock('@ValenceClient/session/readServerBrand', () => ({ const shown = (reach: (address: string) => Promise) => { const onConnected = vi.fn(); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); @@ -206,7 +206,7 @@ describe('what it found on this machine', () => { it('keeps the box open once somebody has typed in it, even after a server turns up', async () => { const { rerender } = render(); - await userEvent.type(screen.getByLabelText('Server address'), 'valence.home'); + await userEvent.type(screen.getByLabelText('Server address'), 'valence.home', { delay: null }); rerender(); await userEvent.clear(screen.getByLabelText('Server address')); diff --git a/packages/screens/src/components/DeviceApproval/DeviceApproval.test.tsx b/packages/screens/src/components/DeviceApproval/DeviceApproval.test.tsx index 0875f1e37b..c7c8cedcb2 100644 --- a/packages/screens/src/components/DeviceApproval/DeviceApproval.test.tsx +++ b/packages/screens/src/components/DeviceApproval/DeviceApproval.test.tsx @@ -17,7 +17,7 @@ beforeEach(() => { }); const typeTheCode = async (code = 'ABCD1234') => { - await userEvent.type(screen.getByLabelText('Code shown on your TV'), code); + await userEvent.type(screen.getByLabelText('Code shown on your TV'), code, { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Continue' })); }; @@ -33,7 +33,9 @@ describe('saying yes to a television from a phone', () => { it('tidies a code somebody typed off a screen before asking about it', async () => { render(); - await userEvent.type(screen.getByLabelText('Code shown on your TV'), 'abcd-1234'); + await userEvent.type(screen.getByLabelText('Code shown on your TV'), 'abcd-1234', { + delay: null, + }); await userEvent.click(screen.getByRole('button', { name: 'Continue' })); await waitFor(() => { @@ -46,7 +48,9 @@ describe('saying yes to a television from a phone', () => { render(); - await userEvent.type(screen.getByLabelText('Code shown on your TV'), 'ABCD1234'); + await userEvent.type(screen.getByLabelText('Code shown on your TV'), 'ABCD1234', { + delay: null, + }); await userEvent.click(screen.getByRole('button', { name: 'Continue' })); expect( diff --git a/packages/screens/src/components/FirstPassword/FirstPassword.test.tsx b/packages/screens/src/components/FirstPassword/FirstPassword.test.tsx index c8bdb06c32..00252f21bf 100644 --- a/packages/screens/src/components/FirstPassword/FirstPassword.test.tsx +++ b/packages/screens/src/components/FirstPassword/FirstPassword.test.tsx @@ -48,7 +48,7 @@ describe('FirstPassword', () => { drawIt(onChanged); await userEvent.click(await screen.findByRole('button', { name: 'Set up' })); - await userEvent.type(screen.getByLabelText('Password'), PASSWORD); + await userEvent.type(screen.getByLabelText('Password'), PASSWORD, { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Save' })); expect(giveFirstPassword).toHaveBeenCalledWith(PASSWORD); @@ -59,7 +59,7 @@ describe('FirstPassword', () => { drawIt(); await userEvent.click(await screen.findByRole('button', { name: 'Set up' })); - await userEvent.type(screen.getByLabelText('Password'), 'short'); + await userEvent.type(screen.getByLabelText('Password'), 'short', { delay: null }); expect(screen.getByRole('button', { name: 'Save' })).toBeDisabled(); }); @@ -70,7 +70,7 @@ describe('FirstPassword', () => { drawIt(); await userEvent.click(await screen.findByRole('button', { name: 'Set up' })); - await userEvent.type(screen.getByLabelText('Password'), PASSWORD); + await userEvent.type(screen.getByLabelText('Password'), PASSWORD, { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Save' })); expect(await screen.findByText('That account already has a password.')).toBeInTheDocument(); diff --git a/packages/screens/src/components/ForgotPassword/ForgotPassword.test.tsx b/packages/screens/src/components/ForgotPassword/ForgotPassword.test.tsx index a69fd1abbe..63be70968a 100644 --- a/packages/screens/src/components/ForgotPassword/ForgotPassword.test.tsx +++ b/packages/screens/src/components/ForgotPassword/ForgotPassword.test.tsx @@ -21,7 +21,7 @@ describe('ForgotPassword', () => { render(); await userEvent.click(screen.getByRole('button', { name: 'Forgot your password?' })); - await userEvent.type(screen.getByLabelText('Username or email'), ' ada '); + await userEvent.type(screen.getByLabelText('Username or email'), ' ada ', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Send reset link' })); expect( diff --git a/packages/screens/src/components/HouseholdOnboarding/HouseholdOnboarding.test.tsx b/packages/screens/src/components/HouseholdOnboarding/HouseholdOnboarding.test.tsx index cd0f7ee3d6..9d5d6e06e0 100644 --- a/packages/screens/src/components/HouseholdOnboarding/HouseholdOnboarding.test.tsx +++ b/packages/screens/src/components/HouseholdOnboarding/HouseholdOnboarding.test.tsx @@ -167,7 +167,7 @@ describe('setting a household up', () => { const field = screen.getByLabelText(/Display name/); await userEvent.clear(field); - await userEvent.type(field, ' The Morgans '); + await userEvent.type(field, ' The Morgans ', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Continue' })); await waitFor(() => { @@ -345,7 +345,7 @@ describe('setting a household up', () => { const field = screen.getByLabelText(/Display name/); await userEvent.clear(field); - await userEvent.type(field, 'The Morgans'); + await userEvent.type(field, 'The Morgans', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Continue' })); await pastThePeople(); await userEvent.click(await screen.findByRole('button', { name: 'Finish' })); diff --git a/packages/screens/src/components/HouseholdOnboarding/components/PasskeyStep/PasskeyStep.test.tsx b/packages/screens/src/components/HouseholdOnboarding/components/PasskeyStep/PasskeyStep.test.tsx index d36d7e4ea7..8af57fc84b 100644 --- a/packages/screens/src/components/HouseholdOnboarding/components/PasskeyStep/PasskeyStep.test.tsx +++ b/packages/screens/src/components/HouseholdOnboarding/components/PasskeyStep/PasskeyStep.test.tsx @@ -94,7 +94,7 @@ describe('PasskeyStep', () => { drawIt(); await userEvent.click(await screen.findByRole('button', { name: 'Use a password instead' })); - await userEvent.type(screen.getByLabelText('Password'), PASSWORD); + await userEvent.type(screen.getByLabelText('Password'), PASSWORD, { delay: null }); hasAPassword.mockResolvedValue(true); await userEvent.click(screen.getByRole('button', { name: 'Set a password' })); @@ -112,7 +112,7 @@ describe('PasskeyStep', () => { drawIt(); await userEvent.click(await screen.findByRole('button', { name: 'Use a password instead' })); - await userEvent.type(screen.getByLabelText('Password'), PASSWORD); + await userEvent.type(screen.getByLabelText('Password'), PASSWORD, { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Set a password' })); expect(await screen.findByText('That account already has a password.')).toBeInTheDocument(); diff --git a/packages/screens/src/components/HouseholdOnboarding/components/PeopleStep/PeopleStep.test.tsx b/packages/screens/src/components/HouseholdOnboarding/components/PeopleStep/PeopleStep.test.tsx index df6419d342..758bd2775e 100644 --- a/packages/screens/src/components/HouseholdOnboarding/components/PeopleStep/PeopleStep.test.tsx +++ b/packages/screens/src/components/HouseholdOnboarding/components/PeopleStep/PeopleStep.test.tsx @@ -53,7 +53,7 @@ const holding = (profiles: ViewerProfile[]) => { const draw = (onDone = vi.fn()) => { render(, { wrapper: CacheScope }); - return { onDone, actor: userEvent.setup() }; + return { onDone, actor: userEvent.setup({ delay: null }) }; }; beforeEach(() => { @@ -167,7 +167,9 @@ describe('PeopleStep', () => { await actor.click(await screen.findByRole('button', { name: 'Not now' })); - expect(onDone).toHaveBeenCalled(); + await waitFor(() => { + expect(onDone).toHaveBeenCalled(); + }); expect(changed).not.toHaveBeenCalled(); }); diff --git a/packages/screens/src/components/HouseholdProfiles/HouseholdProfiles.test.tsx b/packages/screens/src/components/HouseholdProfiles/HouseholdProfiles.test.tsx index 9b1e9dc46a..b2fdeba596 100644 --- a/packages/screens/src/components/HouseholdProfiles/HouseholdProfiles.test.tsx +++ b/packages/screens/src/components/HouseholdProfiles/HouseholdProfiles.test.tsx @@ -87,7 +87,7 @@ const draw = (accountId?: string) => { accountId === undefined ? : , ); - return userEvent.setup(); + return userEvent.setup({ delay: null }); }; const openTheMenuOf = async (actor: ReturnType, name: string) => { diff --git a/packages/screens/src/components/HouseholdProfiles/components/AccountFaceCard/AccountFaceCard.test.tsx b/packages/screens/src/components/HouseholdProfiles/components/AccountFaceCard/AccountFaceCard.test.tsx index a083e76880..b6b799375a 100644 --- a/packages/screens/src/components/HouseholdProfiles/components/AccountFaceCard/AccountFaceCard.test.tsx +++ b/packages/screens/src/components/HouseholdProfiles/components/AccountFaceCard/AccountFaceCard.test.tsx @@ -57,7 +57,7 @@ const draw = (household: Household) => { fetchOnboarding.mockResolvedValue({ isOnboarded: true, household }); render(, { wrapper: CacheScope }); - return userEvent.setup(); + return userEvent.setup({ delay: null }); }; beforeEach(() => { diff --git a/packages/screens/src/components/HouseholdProfiles/components/ProfileNameDialog/ProfileNameDialog.test.tsx b/packages/screens/src/components/HouseholdProfiles/components/ProfileNameDialog/ProfileNameDialog.test.tsx index beaed7e02a..262385c757 100644 --- a/packages/screens/src/components/HouseholdProfiles/components/ProfileNameDialog/ProfileNameDialog.test.tsx +++ b/packages/screens/src/components/HouseholdProfiles/components/ProfileNameDialog/ProfileNameDialog.test.tsx @@ -14,7 +14,7 @@ const draw = (onSave = vi.fn(() => Promise.resolve(true)), onClose = vi.fn()) => />, ); - return { onSave, onClose, actor: userEvent.setup() }; + return { onSave, onClose, actor: userEvent.setup({ delay: null }) }; }; describe('ProfileNameDialog', () => { diff --git a/packages/screens/src/components/HouseholdProfiles/components/ProfilePinDialog/ProfilePinDialog.test.tsx b/packages/screens/src/components/HouseholdProfiles/components/ProfilePinDialog/ProfilePinDialog.test.tsx index a05d33a6ae..2728010155 100644 --- a/packages/screens/src/components/HouseholdProfiles/components/ProfilePinDialog/ProfilePinDialog.test.tsx +++ b/packages/screens/src/components/HouseholdProfiles/components/ProfilePinDialog/ProfilePinDialog.test.tsx @@ -6,7 +6,7 @@ import { ProfilePinDialog } from './ProfilePinDialog'; const draw = (onSave = vi.fn(() => Promise.resolve(true)), onClose = vi.fn()) => { render(); - return { onSave, onClose, actor: userEvent.setup() }; + return { onSave, onClose, actor: userEvent.setup({ delay: null }) }; }; const type = async (actor: ReturnType, pin: string, again: string) => { @@ -77,7 +77,7 @@ describe('ProfilePinDialog', () => { const onClose = vi.fn(); const drawn = render(); - await userEvent.type(screen.getByLabelText('New PIN'), '1357'); + await userEvent.type(screen.getByLabelText('New PIN'), '1357', { delay: null }); drawn.rerender( , diff --git a/packages/screens/src/components/ImportPlaylistDialog/ImportPlaylistDialog.test.tsx b/packages/screens/src/components/ImportPlaylistDialog/ImportPlaylistDialog.test.tsx index 13e001b6cf..244363b90a 100644 --- a/packages/screens/src/components/ImportPlaylistDialog/ImportPlaylistDialog.test.tsx +++ b/packages/screens/src/components/ImportPlaylistDialog/ImportPlaylistDialog.test.tsx @@ -43,7 +43,7 @@ describe('ImportPlaylistDialog', () => { screen.getByLabelText(/Choose a file/u), new File(['#EXTM3U'], 'road.m3u', { type: 'audio/x-mpegurl' }), ); - await userEvent.type(screen.getByLabelText('Name'), ' Road Trip '); + await userEvent.type(screen.getByLabelText('Name'), ' Road Trip ', { delay: null }); await userEvent.click(importButton()); expect(importPlaylist).toHaveBeenCalledWith({ @@ -75,7 +75,7 @@ describe('ImportPlaylistDialog', () => { drawn(); await userEvent.click(screen.getByRole('button', { name: /Spotify/ })); - await userEvent.type(screen.getByLabelText('Playlist link'), 'not a link'); + await userEvent.type(screen.getByLabelText('Playlist link'), 'not a link', { delay: null }); expect(importButton()).toBeDisabled(); @@ -83,6 +83,7 @@ describe('ImportPlaylistDialog', () => { await userEvent.type( screen.getByLabelText('Playlist link'), 'https://open.spotify.com/playlist/x', + { delay: null }, ); await userEvent.click(screen.getByRole('switch', { name: 'Keep it in sync' })); await userEvent.click(importButton()); @@ -102,7 +103,9 @@ describe('ImportPlaylistDialog', () => { drawn(); await userEvent.click(screen.getByRole('button', { name: /ListenBrainz/ })); - await userEvent.type(screen.getByLabelText('Your ListenBrainz username'), 'rob'); + await userEvent.type(screen.getByLabelText('Your ListenBrainz username'), 'rob', { + delay: null, + }); await userEvent.click(screen.getByRole('button', { name: 'Find playlists' })); expect(await screen.findByText('Made for you by ListenBrainz')).toBeInTheDocument(); @@ -125,7 +128,9 @@ describe('ImportPlaylistDialog', () => { drawn(); await userEvent.click(screen.getByRole('button', { name: /ListenBrainz/ })); - await userEvent.type(screen.getByLabelText('Your ListenBrainz username'), 'nobody'); + await userEvent.type(screen.getByLabelText('Your ListenBrainz username'), 'nobody', { + delay: null, + }); await userEvent.click(screen.getByRole('button', { name: 'Find playlists' })); expect( @@ -142,7 +147,7 @@ describe('ImportPlaylistDialog', () => { drawn(); await userEvent.click(screen.getByRole('button', { name: /Last\.fm/ })); - await userEvent.type(screen.getByLabelText('Your Last.fm username'), 'rob'); + await userEvent.type(screen.getByLabelText('Your Last.fm username'), 'rob', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Most played' })); await userEvent.click(importButton()); diff --git a/packages/screens/src/components/ImportWizard/components/ArrImportStep/ArrImportStep.test.tsx b/packages/screens/src/components/ImportWizard/components/ArrImportStep/ArrImportStep.test.tsx index 8ac7dd7b62..4602f0b8ec 100644 --- a/packages/screens/src/components/ImportWizard/components/ArrImportStep/ArrImportStep.test.tsx +++ b/packages/screens/src/components/ImportWizard/components/ArrImportStep/ArrImportStep.test.tsx @@ -151,8 +151,9 @@ describe('ArrImportStep', () => { await userEvent.type( await screen.findByLabelText('Overseerr address'), 'http://overseerr:5055', + { delay: null }, ); - await userEvent.type(screen.getByLabelText('Overseerr API key'), 'key'); + await userEvent.type(screen.getByLabelText('Overseerr API key'), 'key', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Check setup' })); expect(planArrImport).toHaveBeenCalledWith({ @@ -162,7 +163,9 @@ describe('ArrImportStep', () => { choices: {}, }); - await userEvent.type(await screen.findByLabelText('Password for qBittorrent'), 'pw'); + await userEvent.type(await screen.findByLabelText('Password for qBittorrent'), 'pw', { + delay: null, + }); await userEvent.click(screen.getByRole('button', { name: 'Valence downloads' })); await userEvent.click(screen.getByRole('button', { name: 'Import it' })); @@ -189,8 +192,10 @@ describe('ArrImportStep', () => { }); renderInAnAddress(); - await userEvent.type(await screen.findByLabelText('Radarr address'), 'http://radarr:7878'); - await userEvent.type(screen.getByLabelText('Radarr API key'), 'key'); + await userEvent.type(await screen.findByLabelText('Radarr address'), 'http://radarr:7878', { + delay: null, + }); + await userEvent.type(screen.getByLabelText('Radarr API key'), 'key', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Check setup' })); expect(await screen.findByRole('alert')).toHaveTextContent('Requests are turned off.'); diff --git a/packages/screens/src/components/ImportWizard/components/ArrImportStep/components/ArrImportPlanView/ArrImportPlanView.test.tsx b/packages/screens/src/components/ImportWizard/components/ArrImportStep/components/ArrImportPlanView/ArrImportPlanView.test.tsx index 8ad0eb2b94..c0804f59f8 100644 --- a/packages/screens/src/components/ImportWizard/components/ArrImportStep/components/ArrImportPlanView/ArrImportPlanView.test.tsx +++ b/packages/screens/src/components/ImportWizard/components/ArrImportStep/components/ArrImportPlanView/ArrImportPlanView.test.tsx @@ -127,7 +127,7 @@ describe('ArrImportPlanView', () => { />, ); - await userEvent.type(screen.getByLabelText('Password for qBittorrent'), 'x'); + await userEvent.type(screen.getByLabelText('Password for qBittorrent'), 'x', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Valence downloads' })); expect(onSecretChange).toHaveBeenCalledWith('client:q:password', 'x'); diff --git a/packages/screens/src/components/ImportWizard/components/ArrImportStep/components/ArrPathMappingsForm/ArrPathMappingsForm.test.tsx b/packages/screens/src/components/ImportWizard/components/ArrImportStep/components/ArrPathMappingsForm/ArrPathMappingsForm.test.tsx index d1d5bd9dbf..367b8fc2a7 100644 --- a/packages/screens/src/components/ImportWizard/components/ArrImportStep/components/ArrPathMappingsForm/ArrPathMappingsForm.test.tsx +++ b/packages/screens/src/components/ImportWizard/components/ArrImportStep/components/ArrPathMappingsForm/ArrPathMappingsForm.test.tsx @@ -11,7 +11,7 @@ describe('ArrPathMappingsForm', () => { render(); - await userEvent.type(screen.getByLabelText('Folder as the apps see it'), 's'); + await userEvent.type(screen.getByLabelText('Folder as the apps see it'), 's', { delay: null }); expect(onChange).toHaveBeenLastCalledWith([{ from: '/moviess', to: '/media/Films' }]); }); diff --git a/packages/screens/src/components/ImportWizard/components/ArrImportStep/components/ArrSourcesForm/ArrSourcesForm.test.tsx b/packages/screens/src/components/ImportWizard/components/ArrImportStep/components/ArrSourcesForm/ArrSourcesForm.test.tsx index 877c123bae..a1373b1d42 100644 --- a/packages/screens/src/components/ImportWizard/components/ArrImportStep/components/ArrSourcesForm/ArrSourcesForm.test.tsx +++ b/packages/screens/src/components/ImportWizard/components/ArrImportStep/components/ArrSourcesForm/ArrSourcesForm.test.tsx @@ -25,7 +25,7 @@ describe('ArrSourcesForm', () => { expect(screen.getAllByLabelText('Radarr address')[0]).toHaveValue('http://radarr:7878'); - await userEvent.type(screen.getByLabelText('Overseerr API key'), 'k'); + await userEvent.type(screen.getByLabelText('Overseerr API key'), 'k', { delay: null }); expect(onChange).toHaveBeenLastCalledWith(1, { apiKey: 'k' }); }); diff --git a/packages/screens/src/components/ImportWizard/components/LibrariesStep/components/PathMappings/PathMappings.test.tsx b/packages/screens/src/components/ImportWizard/components/LibrariesStep/components/PathMappings/PathMappings.test.tsx index 7642955b5c..eb892eb6ee 100644 --- a/packages/screens/src/components/ImportWizard/components/LibrariesStep/components/PathMappings/PathMappings.test.tsx +++ b/packages/screens/src/components/ImportWizard/components/LibrariesStep/components/PathMappings/PathMappings.test.tsx @@ -23,9 +23,9 @@ describe('PathMappings', () => { const sources = screen.getAllByLabelText('On Den'); const valence = screen.getAllByLabelText('In Valence'); - await userEvent.type(sources[1] ?? document.body, '/data/kids'); + await userEvent.type(sources[1] ?? document.body, '/data/kids', { delay: null }); await userEvent.clear(valence[0] ?? document.body); - await userEvent.type(valence[0] ?? document.body, '/srv'); + await userEvent.type(valence[0] ?? document.body, '/srv', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Save and check again' })); expect(onSave).toHaveBeenLastCalledWith([{ from: '/data', to: '/srv' }]); diff --git a/packages/screens/src/components/ImportWizard/components/PeopleStep/PeopleStep.test.tsx b/packages/screens/src/components/ImportWizard/components/PeopleStep/PeopleStep.test.tsx index 11ef8aa511..11dfc58174 100644 --- a/packages/screens/src/components/ImportWizard/components/PeopleStep/PeopleStep.test.tsx +++ b/packages/screens/src/components/ImportWizard/components/PeopleStep/PeopleStep.test.tsx @@ -76,7 +76,7 @@ describe('PeopleStep', () => { expect(screen.getByRole('button', { name: 'Use PIN' })).toBeDisabled(); - await userEvent.type(pin, '0000'); + await userEvent.type(pin, '0000', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Use PIN' })); expect(await screen.findByText('That PIN is incorrect.')).toBeVisible(); diff --git a/packages/screens/src/components/ImportWizard/components/SourceStep/SourceStep.test.tsx b/packages/screens/src/components/ImportWizard/components/SourceStep/SourceStep.test.tsx index c4b961e746..57396a6315 100644 --- a/packages/screens/src/components/ImportWizard/components/SourceStep/SourceStep.test.tsx +++ b/packages/screens/src/components/ImportWizard/components/SourceStep/SourceStep.test.tsx @@ -57,8 +57,8 @@ describe('SourceStep', () => { expect(screen.getByRole('button', { name: 'Connect' })).toBeDisabled(); - await userEvent.type(screen.getByLabelText('Address'), ' http://den:8096 '); - await userEvent.type(screen.getByLabelText('API key'), 'key'); + await userEvent.type(screen.getByLabelText('Address'), ' http://den:8096 ', { delay: null }); + await userEvent.type(screen.getByLabelText('API key'), 'key', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Connect' })); expect(connectImportSource).toHaveBeenCalledWith({ @@ -76,8 +76,8 @@ describe('SourceStep', () => { }); render(); - await userEvent.type(screen.getByLabelText('Address'), 'http://den'); - await userEvent.type(screen.getByLabelText('API key'), 'bad'); + await userEvent.type(screen.getByLabelText('Address'), 'http://den', { delay: null }); + await userEvent.type(screen.getByLabelText('API key'), 'bad', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Connect' })); expect(await screen.findByText('Jellyfin refused the key.')).toBeVisible(); diff --git a/packages/screens/src/components/LockedLibrary/LockedLibrary.test.tsx b/packages/screens/src/components/LockedLibrary/LockedLibrary.test.tsx index ab6ac314e7..f5e8ef7eed 100644 --- a/packages/screens/src/components/LockedLibrary/LockedLibrary.test.tsx +++ b/packages/screens/src/components/LockedLibrary/LockedLibrary.test.tsx @@ -14,7 +14,7 @@ beforeEach(() => { describe('LockedLibrary', () => { it('unlocks the library with what was typed', async () => { vi.mocked(unlockLibrary).mockResolvedValue({ kind: 'unlocked', untilMs: 2000 }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); @@ -28,7 +28,7 @@ describe('LockedLibrary', () => { it('says so when it is not the right one', async () => { vi.mocked(unlockLibrary).mockResolvedValue({ kind: 'wrong' }); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderInAnAddress(); diff --git a/packages/screens/src/components/MusicPage/components/ArtistView/components/MergeArtistsDialog/MergeArtistsDialog.test.tsx b/packages/screens/src/components/MusicPage/components/ArtistView/components/MergeArtistsDialog/MergeArtistsDialog.test.tsx index 4382ffd600..c6f5a560d0 100644 --- a/packages/screens/src/components/MusicPage/components/ArtistView/components/MergeArtistsDialog/MergeArtistsDialog.test.tsx +++ b/packages/screens/src/components/MusicPage/components/ArtistView/components/MergeArtistsDialog/MergeArtistsDialog.test.tsx @@ -65,7 +65,7 @@ const answers = (aliases: string[] = []) => { describe('MergeArtistsDialog', () => { it('offers only the library’s artists that look like another name, and merges the ones chosen', async () => { const onClose = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderWithAnswers(, answers()); @@ -83,7 +83,7 @@ describe('MergeArtistsDialog', () => { }); it('narrows the artists to what is typed', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderWithAnswers(, answers()); @@ -94,7 +94,7 @@ describe('MergeArtistsDialog', () => { }); it('separates a name merged earlier, following the songs being read again', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); renderWithAnswers( , diff --git a/packages/screens/src/components/MusicPage/components/MusicLibrary/MusicLibrary.test.tsx b/packages/screens/src/components/MusicPage/components/MusicLibrary/MusicLibrary.test.tsx index aa5e281214..d73187fcad 100644 --- a/packages/screens/src/components/MusicPage/components/MusicLibrary/MusicLibrary.test.tsx +++ b/packages/screens/src/components/MusicPage/components/MusicLibrary/MusicLibrary.test.tsx @@ -132,7 +132,11 @@ describe('MusicLibrary', () => { renderInAnAddress(); await screen.findByRole('button', { name: /Sunday morning/ }); - await userEvent.type(screen.getByRole('searchbox', { name: 'Search your library' }), 'arcadia'); + await userEvent.type( + screen.getByRole('searchbox', { name: 'Search your library' }), + 'arcadia', + { delay: null }, + ); expect(screen.queryByRole('button', { name: /Sunday morning/ })).not.toBeInTheDocument(); expect(screen.getByRole('button', { name: /Even In Arcadia/ })).toBeInTheDocument(); diff --git a/packages/screens/src/components/MusicPage/components/MusicSearchView/MusicSearchView.test.tsx b/packages/screens/src/components/MusicPage/components/MusicSearchView/MusicSearchView.test.tsx index c818df0b2f..74b9fc8558 100644 --- a/packages/screens/src/components/MusicPage/components/MusicSearchView/MusicSearchView.test.tsx +++ b/packages/screens/src/components/MusicPage/components/MusicSearchView/MusicSearchView.test.tsx @@ -52,7 +52,7 @@ describe('MusicSearchView', () => { const box = screen.getByRole('searchbox', { name: 'Search music' }); - await userEvent.type(box, 'sleep'); + await userEvent.type(box, 'sleep', { delay: null }); await waitFor(() => { expect(box).toHaveValue('sleep'); diff --git a/packages/screens/src/components/MusicPage/components/PodcastsView/PodcastsView.test.tsx b/packages/screens/src/components/MusicPage/components/PodcastsView/PodcastsView.test.tsx index 053795be66..a68ee0caf0 100644 --- a/packages/screens/src/components/MusicPage/components/PodcastsView/PodcastsView.test.tsx +++ b/packages/screens/src/components/MusicPage/components/PodcastsView/PodcastsView.test.tsx @@ -50,7 +50,9 @@ describe('PodcastsView', () => { renderInAnAddress(); - await userEvent.type(screen.getByRole('searchbox', { name: 'Search podcasts' }), 'news'); + await userEvent.type(screen.getByRole('searchbox', { name: 'Search podcasts' }), 'news', { + delay: null, + }); expect(await screen.findByRole('region', { name: 'Podcasts found' })).toBeInTheDocument(); expect(screen.getByRole('button', { name: /Found Show/ })).toBeInTheDocument(); diff --git a/packages/screens/src/components/MusicPage/components/RadioView/RadioView.test.tsx b/packages/screens/src/components/MusicPage/components/RadioView/RadioView.test.tsx index 2797626ca8..3f3bf06fe1 100644 --- a/packages/screens/src/components/MusicPage/components/RadioView/RadioView.test.tsx +++ b/packages/screens/src/components/MusicPage/components/RadioView/RadioView.test.tsx @@ -76,7 +76,9 @@ describe('RadioView', () => { renderInAnAddress(); - await userEvent.type(screen.getByRole('searchbox', { name: 'Search stations' }), 'found'); + await userEvent.type(screen.getByRole('searchbox', { name: 'Search stations' }), 'found', { + delay: null, + }); expect(await screen.findByRole('region', { name: 'Stations found' })).toBeInTheDocument(); }); diff --git a/packages/screens/src/components/MusicPage/components/RadioView/components/AddStationDialog/AddStationDialog.test.tsx b/packages/screens/src/components/MusicPage/components/RadioView/components/AddStationDialog/AddStationDialog.test.tsx index 085995287d..ac67d06d25 100644 --- a/packages/screens/src/components/MusicPage/components/RadioView/components/AddStationDialog/AddStationDialog.test.tsx +++ b/packages/screens/src/components/MusicPage/components/RadioView/components/AddStationDialog/AddStationDialog.test.tsx @@ -57,14 +57,18 @@ describe('AddStationDialog', () => { expect(add).toBeDisabled(); - await userEvent.type(screen.getByLabelText('Name'), ' Mine '); - await userEvent.type(screen.getByLabelText('Stream address'), 'not a web address'); + await userEvent.type(screen.getByLabelText('Name'), ' Mine ', { delay: null }); + await userEvent.type(screen.getByLabelText('Stream address'), 'not a web address', { + delay: null, + }); expect(add).toBeDisabled(); await userEvent.clear(screen.getByLabelText('Stream address')); - await userEvent.type(screen.getByLabelText('Stream address'), 'https://example.test/mine'); - await userEvent.type(screen.getByLabelText(/^Genres/), 'jazz, , late'); + await userEvent.type(screen.getByLabelText('Stream address'), 'https://example.test/mine', { + delay: null, + }); + await userEvent.type(screen.getByLabelText(/^Genres/), 'jazz, , late', { delay: null }); await userEvent.click(add); expect(addOwnStation).toHaveBeenCalledWith({ @@ -83,11 +87,14 @@ describe('AddStationDialog', () => { renderInAnAddress(); - await userEvent.type(screen.getByLabelText('Name'), 'Mine'); - await userEvent.type(screen.getByLabelText('Stream address'), 'https://example.test/mine'); + await userEvent.type(screen.getByLabelText('Name'), 'Mine', { delay: null }); + await userEvent.type(screen.getByLabelText('Stream address'), 'https://example.test/mine', { + delay: null, + }); await userEvent.type( screen.getByLabelText('Logo address (optional)'), 'https://example.test/logo.png', + { delay: null }, ); await userEvent.click(screen.getByRole('button', { name: 'Add station' })); diff --git a/packages/screens/src/components/MusicPage/components/SongsView/SongsView.test.tsx b/packages/screens/src/components/MusicPage/components/SongsView/SongsView.test.tsx index cd228df822..dfdc2d0472 100644 --- a/packages/screens/src/components/MusicPage/components/SongsView/SongsView.test.tsx +++ b/packages/screens/src/components/MusicPage/components/SongsView/SongsView.test.tsx @@ -68,7 +68,9 @@ describe('SongsView', () => { renderInAnAddress(); - await userEvent.type(screen.getByRole('textbox', { name: 'Search the songs' }), 'muse'); + await userEvent.type(screen.getByRole('textbox', { name: 'Search the songs' }), 'muse', { + delay: null, + }); await waitFor(() => { expect(asked(fetchMock).some((url) => url.includes('q=muse'))).toBe(true); diff --git a/packages/screens/src/components/ObservabilityPage/components/JobHistory/JobHistory.test.tsx b/packages/screens/src/components/ObservabilityPage/components/JobHistory/JobHistory.test.tsx index 698ff878e7..b14aebd0ca 100644 --- a/packages/screens/src/components/ObservabilityPage/components/JobHistory/JobHistory.test.tsx +++ b/packages/screens/src/components/ObservabilityPage/components/JobHistory/JobHistory.test.tsx @@ -355,7 +355,7 @@ describe('JobHistory', () => { }); it('opens the log filtered to a run when View logs is chosen', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onViewLogs = vi.fn(); askedHistory.mockResolvedValue(page([record()])); @@ -381,7 +381,7 @@ describe('JobHistory', () => { }); it('lazily reads a run’s issues only once asked for them', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); askedHistory.mockResolvedValue(page([record()])); askedIssues.mockResolvedValue([issue()]); @@ -412,7 +412,7 @@ describe('JobHistory', () => { }); it('says a run has no issues rather than showing an empty list', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); askedHistory.mockResolvedValue(page([record()])); askedIssues.mockResolvedValue([]); @@ -438,7 +438,7 @@ describe('JobHistory', () => { }); it('shows the whole failure of a run that failed outright, rather than saying it has no issues', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const message = 'Failed query: select "path", "sizeBytes" from "media_item" where "libraryId" = $1'; @@ -474,7 +474,7 @@ describe('JobHistory', () => { }); it('lists the failure first and the itemised issues after it, where a run has both', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); askedHistory.mockResolvedValue( page([record({ status: 'failed', errorMessage: sayVerbatim('It stopped.') })]), @@ -505,7 +505,7 @@ describe('JobHistory', () => { }); it('opens what a running run is made of from the i beside its status', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); askedHistory.mockResolvedValue(page([record({ status: 'running', finishedAtMs: null })])); @@ -612,7 +612,7 @@ describe('JobHistory', () => { }); it('copies everything that went wrong as plain text', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const copied = vi.fn(() => Promise.resolve()); vi.stubGlobal('navigator', { ...navigator, clipboard: { writeText: copied } }); @@ -692,7 +692,9 @@ describe('JobHistory', () => { drawHistory(); await screen.findByText('Generate missing previews'); - await userEvent.type(screen.getByRole('searchbox', { name: 'Search job runs' }), 'run-9'); + await userEvent.type(screen.getByRole('searchbox', { name: 'Search job runs' }), 'run-9', { + delay: null, + }); await waitFor(() => { expect(askedHistory.mock.calls.at(-1)?.[0]).toMatchObject({ search: 'run-9' }); diff --git a/packages/screens/src/components/ObservabilityPage/components/LogExplorer/LogExplorer.test.tsx b/packages/screens/src/components/ObservabilityPage/components/LogExplorer/LogExplorer.test.tsx index 35c8077a8c..fcabdccd65 100644 --- a/packages/screens/src/components/ObservabilityPage/components/LogExplorer/LogExplorer.test.tsx +++ b/packages/screens/src/components/ObservabilityPage/components/LogExplorer/LogExplorer.test.tsx @@ -317,7 +317,9 @@ describe('LogExplorer', () => { it('turns a finished field typed into the search into a filter chip', async () => { render(draw()); await screen.findByText('Could not read file a'); - await userEvent.type(screen.getByRole('searchbox', { name: 'Search the log' }), 'job:abc123 '); + await userEvent.type(screen.getByRole('searchbox', { name: 'Search the log' }), 'job:abc123 ', { + delay: null, + }); await waitFor(() => { expect(lastLogQuery()).toMatchObject({ jobId: 'abc123', search: '' }); @@ -328,7 +330,9 @@ describe('LogExplorer', () => { it('searches for words that are not fields', async () => { render(draw()); await screen.findByText('Could not read file a'); - await userEvent.type(screen.getByRole('searchbox', { name: 'Search the log' }), 'unreadable'); + await userEvent.type(screen.getByRole('searchbox', { name: 'Search the log' }), 'unreadable', { + delay: null, + }); await waitFor(() => { expect(lastLogQuery()).toMatchObject({ search: 'unreadable' }); @@ -590,7 +594,9 @@ describe('LogExplorer', () => { 'unreadable', ); - await userEvent.type(screen.getByRole('searchbox', { name: 'Search the log' }), ' file'); + await userEvent.type(screen.getByRole('searchbox', { name: 'Search the log' }), ' file', { + delay: null, + }); await waitFor(() => { expect(onChange).toHaveBeenCalledWith( diff --git a/packages/screens/src/components/OriginList/OriginList.test.tsx b/packages/screens/src/components/OriginList/OriginList.test.tsx index 8b7bf08799..098bed11cd 100644 --- a/packages/screens/src/components/OriginList/OriginList.test.tsx +++ b/packages/screens/src/components/OriginList/OriginList.test.tsx @@ -63,7 +63,9 @@ describe('OriginList', () => { it('adds a typed address as the origin a browser sends', async () => { render(); - await userEvent.type(screen.getByLabelText('Add another address'), `${PUBLIC}/home`); + await userEvent.type(screen.getByLabelText('Add another address'), `${PUBLIC}/home`, { + delay: null, + }); await userEvent.click(screen.getByRole('button', { name: 'Add' })); expect(screen.getByRole('list')).toHaveTextContent(PUBLIC); @@ -73,7 +75,9 @@ describe('OriginList', () => { it('does not list an address twice', async () => { render(); - await userEvent.type(screen.getByLabelText('Add another address'), `${HERE}/{Enter}`); + await userEvent.type(screen.getByLabelText('Add another address'), `${HERE}/{Enter}`, { + delay: null, + }); expect(screen.getAllByRole('button', { name: `Remove ${HERE}` })).toHaveLength(1); }); @@ -83,11 +87,11 @@ describe('OriginList', () => { const field = screen.getByLabelText('Add another address'); - await userEvent.type(field, 'valence.local{Enter}'); + await userEvent.type(field, 'valence.local{Enter}', { delay: null }); expect(screen.getByText(NOT_AN_ADDRESS)).toBeInTheDocument(); - await userEvent.type(field, 'x'); + await userEvent.type(field, 'x', { delay: null }); expect(screen.queryByText(NOT_AN_ADDRESS)).not.toBeInTheDocument(); }); @@ -122,7 +126,9 @@ describe('OriginList', () => { render(); - await userEvent.type(screen.getByLabelText('Add another address'), `${PUBLIC}{Enter}`); + await userEvent.type(screen.getByLabelText('Add another address'), `${PUBLIC}{Enter}`, { + delay: null, + }); expect(onOriginsChange).not.toHaveBeenCalled(); }); diff --git a/packages/screens/src/components/PartyChat/PartyChat.test.tsx b/packages/screens/src/components/PartyChat/PartyChat.test.tsx index 90fb765832..5afd80b5a9 100644 --- a/packages/screens/src/components/PartyChat/PartyChat.test.tsx +++ b/packages/screens/src/components/PartyChat/PartyChat.test.tsx @@ -25,7 +25,7 @@ describe('PartyChat', () => { it('passes on what was written and clears the field', async () => { const onWrite = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(); diff --git a/packages/screens/src/components/PartyPanel/PartyPanel.test.tsx b/packages/screens/src/components/PartyPanel/PartyPanel.test.tsx index d68748ada5..fa061228ba 100644 --- a/packages/screens/src/components/PartyPanel/PartyPanel.test.tsx +++ b/packages/screens/src/components/PartyPanel/PartyPanel.test.tsx @@ -218,7 +218,7 @@ describe('PartyPanel', () => { }); it('lets the host promote somebody', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onSetRole = vi.fn(); render(); @@ -241,7 +241,7 @@ describe('PartyPanel', () => { }); it('lets the host withhold skipping while leaving pausing shared', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onLoosen = vi.fn(); render(); @@ -251,7 +251,7 @@ describe('PartyPanel', () => { }); it('offers a way out', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onLeave = vi.fn(); render(); @@ -283,7 +283,7 @@ describe('PartyPanel', () => { }); it('copies the link when asked', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onCopyInvitation = vi.fn(() => Promise.resolve()); render( @@ -315,7 +315,7 @@ describe('PartyPanel', () => { }); it('lets the host put somebody out', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onRemove = vi.fn(); render(); @@ -338,7 +338,7 @@ describe('PartyPanel', () => { }); it('lets the host put a password on it', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onSetPassword = vi.fn(); render(); @@ -355,7 +355,7 @@ describe('PartyPanel', () => { }); it('offers to take an existing password off again', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onSetPassword = vi.fn(); render( @@ -421,7 +421,7 @@ describe('PartyPanel', () => { }); it('offers to ask along somebody who is not here', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onAsk = vi.fn(); render( @@ -506,7 +506,7 @@ describe('PartyPanel', () => { }); it('says somebody has been asked, so they are not asked five times over', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render( { describe('chat', () => { it('lets the host turn chat on', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onLoosen = vi.fn(); render( @@ -558,7 +558,7 @@ describe('PartyPanel', () => { }); it('shows everybody the chat once it is on, and passes on what they write', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onWrite = vi.fn(); render( diff --git a/packages/screens/src/components/PartyPasswordDialog/PartyPasswordDialog.test.tsx b/packages/screens/src/components/PartyPasswordDialog/PartyPasswordDialog.test.tsx index 0b9e06c253..649cc08ed5 100644 --- a/packages/screens/src/components/PartyPasswordDialog/PartyPasswordDialog.test.tsx +++ b/packages/screens/src/components/PartyPasswordDialog/PartyPasswordDialog.test.tsx @@ -19,7 +19,7 @@ describe('PartyPasswordDialog', () => { }); it('joins with what was typed', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onJoin = vi.fn(); render(); @@ -48,7 +48,7 @@ describe('PartyPasswordDialog', () => { }); it('offers a way out for somebody who does not have it', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onClose = vi.fn(); render(); diff --git a/packages/screens/src/components/PasskeySetup/PasskeySetup.test.tsx b/packages/screens/src/components/PasskeySetup/PasskeySetup.test.tsx index 0f9c723b4e..7dab241335 100644 --- a/packages/screens/src/components/PasskeySetup/PasskeySetup.test.tsx +++ b/packages/screens/src/components/PasskeySetup/PasskeySetup.test.tsx @@ -74,7 +74,7 @@ describe('PasskeySetup when available', () => { }); it('registers a passkey with the chosen name', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await screen.findByText('None yet'); @@ -88,7 +88,7 @@ describe('PasskeySetup when available', () => { }); it('uses a default name when the field is cleared', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await screen.findByText('None yet'); @@ -101,7 +101,7 @@ describe('PasskeySetup when available', () => { }); it('refreshes the list after registering', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await screen.findByText('None yet'); @@ -113,7 +113,7 @@ describe('PasskeySetup when available', () => { it('says nothing when the user dismisses the device prompt', async () => { registerPasskeyMock.mockResolvedValue({ kind: 'cancelled' }); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await screen.findByText('None yet'); @@ -127,7 +127,7 @@ describe('PasskeySetup when available', () => { it('reports a failure', async () => { registerPasskeyMock.mockResolvedValue({ kind: 'failed', reason: 'The server said no.' }); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await screen.findByText('None yet'); @@ -138,7 +138,7 @@ describe('PasskeySetup when available', () => { it('renames a passkey', async () => { listPasskeysMock.mockResolvedValue([{ id: 'pk_1', name: 'Laptop' }]); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await screen.findByText('Laptop'); @@ -154,7 +154,7 @@ describe('PasskeySetup when available', () => { it('refuses to save an empty passkey name', async () => { listPasskeysMock.mockResolvedValue([{ id: 'pk_1', name: 'Laptop' }]); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await screen.findByText('Laptop'); @@ -168,7 +168,7 @@ describe('PasskeySetup when available', () => { it('removes a passkey', async () => { listPasskeysMock.mockResolvedValue([{ id: 'pk_1', name: 'Laptop' }]); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await screen.findByText('Laptop'); @@ -182,7 +182,7 @@ describe('PasskeySetup when available', () => { it('reports a failed removal', async () => { listPasskeysMock.mockResolvedValue([{ id: 'pk_1', name: 'Laptop' }]); deletePasskeyMock.mockResolvedValue(false); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await screen.findByText('Laptop'); @@ -243,7 +243,9 @@ describe('PasskeySetup for a session signed in a while ago', () => { isConfirmedMock.mockResolvedValue(false); render(); - await userEvent.type(await screen.findByLabelText('Password'), 'a-long-enough-password'); + await userEvent.type(await screen.findByLabelText('Password'), 'a-long-enough-password', { + delay: null, + }); expect(screen.queryByRole('button', { name: /Add a passkey/ })).not.toBeInTheDocument(); diff --git a/packages/screens/src/components/PasskeySetup/components/ConfirmItIsYou/ConfirmItIsYou.test.tsx b/packages/screens/src/components/PasskeySetup/components/ConfirmItIsYou/ConfirmItIsYou.test.tsx index 28a09cd3ec..aded944569 100644 --- a/packages/screens/src/components/PasskeySetup/components/ConfirmItIsYou/ConfirmItIsYou.test.tsx +++ b/packages/screens/src/components/PasskeySetup/components/ConfirmItIsYou/ConfirmItIsYou.test.tsx @@ -18,7 +18,9 @@ describe('ConfirmItIsYou', () => { confirmItIsYouMock.mockResolvedValue({ kind: 'confirmed' }); render(); - await userEvent.type(screen.getByLabelText('Password'), 'a-long-enough-password'); + await userEvent.type(screen.getByLabelText('Password'), 'a-long-enough-password', { + delay: null, + }); await userEvent.click(screen.getByRole('button', { name: 'Confirm' })); expect(confirmItIsYouMock).toHaveBeenCalledWith('a-long-enough-password'); @@ -31,7 +33,7 @@ describe('ConfirmItIsYou', () => { confirmItIsYouMock.mockResolvedValue({ kind: 'failed', reason: 'Incorrect password.' }); render(); - await userEvent.type(screen.getByLabelText('Password'), 'wrong'); + await userEvent.type(screen.getByLabelText('Password'), 'wrong', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Confirm' })); expect(await screen.findByText('Incorrect password.')).toBeInTheDocument(); diff --git a/packages/screens/src/components/PlaylistDialog/PlaylistDialog.test.tsx b/packages/screens/src/components/PlaylistDialog/PlaylistDialog.test.tsx index 422d72f9d5..c4eeb90049 100644 --- a/packages/screens/src/components/PlaylistDialog/PlaylistDialog.test.tsx +++ b/packages/screens/src/components/PlaylistDialog/PlaylistDialog.test.tsx @@ -48,7 +48,7 @@ describe('PlaylistDialog', () => { renderInAnAddress(); - await userEvent.type(screen.getByLabelText('Name'), 'Sunday morning'); + await userEvent.type(screen.getByLabelText('Name'), 'Sunday morning', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Create' })); await waitFor(() => { @@ -73,7 +73,7 @@ describe('PlaylistDialog', () => { it('marks a playlist whose order matters', async () => { renderInAnAddress(); - await userEvent.type(screen.getByLabelText('Name'), 'Chapters'); + await userEvent.type(screen.getByLabelText('Name'), 'Chapters', { delay: null }); await userEvent.click(screen.getByRole('switch', { name: 'The order matters' })); await userEvent.click(screen.getByRole('button', { name: 'Create' })); @@ -90,7 +90,7 @@ describe('PlaylistDialog', () => { const name = screen.getByLabelText('Name'); await userEvent.clear(name); - await userEvent.type(name, 'Late night'); + await userEvent.type(name, 'Late night', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Save' })); await waitFor(() => { @@ -107,7 +107,7 @@ describe('PlaylistDialog', () => { renderInAnAddress(); - await userEvent.type(screen.getByLabelText('Name'), 'x'); + await userEvent.type(screen.getByLabelText('Name'), 'x', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Create' })); expect(await screen.findByText('Couldn’t create the playlist.')).toBeInTheDocument(); @@ -123,7 +123,7 @@ describe('PlaylistDialog', () => { expect(screen.getByRole('heading', { name: 'New smart playlist' })).toBeInTheDocument(); expect(screen.queryByRole('switch', { name: 'The order matters' })).not.toBeInTheDocument(); - await userEvent.type(screen.getByLabelText('Name'), 'Liked'); + await userEvent.type(screen.getByLabelText('Name'), 'Liked', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Add a rule' })); await userEvent.click(screen.getByRole('button', { name: 'Create' })); @@ -140,9 +140,9 @@ describe('PlaylistDialog', () => { it('will not make a smart playlist while it holds more than it may', async () => { renderInAnAddress(); - await userEvent.type(screen.getByLabelText('Name'), 'Everything'); + await userEvent.type(screen.getByLabelText('Name'), 'Everything', { delay: null }); await userEvent.clear(screen.getByLabelText('Limit')); - await userEvent.type(screen.getByLabelText('Limit'), '5000'); + await userEvent.type(screen.getByLabelText('Limit'), '5000', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Create' })); expect( diff --git a/packages/screens/src/components/PluginSurface/PluginSurface.test.tsx b/packages/screens/src/components/PluginSurface/PluginSurface.test.tsx index 3c5cc5c0ab..c5fc9465bc 100644 --- a/packages/screens/src/components/PluginSurface/PluginSurface.test.tsx +++ b/packages/screens/src/components/PluginSurface/PluginSurface.test.tsx @@ -84,7 +84,7 @@ describe('PluginSurface', () => { renderInAnAddress(); await userEvent.clear(screen.getByLabelText('Username')); - await userEvent.type(screen.getByLabelText('Username'), 'ada'); + await userEvent.type(screen.getByLabelText('Username'), 'ada', { delay: null }); await userEvent.click(screen.getByRole('switch', { name: 'Send progress' })); await userEvent.click(screen.getByRole('switch', { name: 'Include adult titles' })); await userEvent.click(screen.getByRole('button', { name: /Import now/u })); diff --git a/packages/screens/src/components/ProfileGate/ProfileGate.test.tsx b/packages/screens/src/components/ProfileGate/ProfileGate.test.tsx index a89104c8db..8db48e1306 100644 --- a/packages/screens/src/components/ProfileGate/ProfileGate.test.tsx +++ b/packages/screens/src/components/ProfileGate/ProfileGate.test.tsx @@ -183,7 +183,7 @@ describe('ProfileGate', () => { it('signs in with the address and password', async () => { const onSignedIn = vi.fn(); - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); serverWith('refused'); @@ -201,7 +201,7 @@ describe('ProfileGate', () => { }); it('signs in with a username just the same', async () => { - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); serverWith('refused'); @@ -229,7 +229,7 @@ describe('ProfileGate', () => { }); it('asks for whatever is missing rather than greying out the button', async () => { - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); serverWith('refused'); @@ -253,7 +253,7 @@ describe('ProfileGate', () => { }); it('asks only for a password once a face is picked, never for an address', async () => { - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); renderInAnAddress(); @@ -266,7 +266,7 @@ describe('ProfileGate', () => { it('signs in as the face that was picked', async () => { const onSignedIn = vi.fn(); - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); renderInAnAddress(); @@ -284,7 +284,7 @@ describe('ProfileGate', () => { serverWith(HOUSEHOLD, { ok: true, body: JSON.stringify({ twoFactorRedirect: true }) }); const onSignedIn = vi.fn(); - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); renderInAnAddress(); @@ -303,7 +303,7 @@ describe('ProfileGate', () => { it('keeps the portrait while asking for a code, so it is plainly the same person', async () => { serverWith(HOUSEHOLD, { ok: true, body: JSON.stringify({ twoFactorRedirect: true }) }); - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); renderInAnAddress(); @@ -320,7 +320,7 @@ describe('ProfileGate', () => { it('says it was the password when it was, rather than failing silently', async () => { serverWith(HOUSEHOLD, { ok: false }); - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); renderInAnAddress(); @@ -337,7 +337,7 @@ describe('ProfileGate', () => { }); it('will not send an empty password, and says so where the password goes', async () => { - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); renderInAnAddress(); @@ -355,7 +355,7 @@ describe('ProfileGate', () => { }); it('puts the cursor in the password as soon as a face is picked', async () => { - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); renderInAnAddress(); @@ -423,7 +423,7 @@ describe('ProfileGate', () => { }); it('goes back to the wall when somebody picked the wrong person', async () => { - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); renderInAnAddress(); @@ -435,7 +435,7 @@ describe('ProfileGate', () => { }); it('says in words how to go back, above the portrait', async () => { - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); renderInAnAddress(); @@ -450,7 +450,7 @@ describe('ProfileGate', () => { }); it('goes back on escape, which is what everybody tries', async () => { - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); renderInAnAddress(); @@ -480,7 +480,7 @@ describe('ProfileGate', () => { it('scrolls on a whole page with the arrow', async () => { serverWith(many(15)); - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); renderInAnAddress(); @@ -512,7 +512,7 @@ describe('ProfileGate', () => { }); it('moves through the faces from the keyboard, for somebody holding a remote', async () => { - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); renderInAnAddress(); @@ -527,7 +527,7 @@ describe('ProfileGate', () => { it('follows the keyboard along the row rather than making somebody find the arrows', async () => { serverWith(many(15)); - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); renderInAnAddress(); @@ -563,7 +563,7 @@ describe('ProfileGate', () => { describe('signing in with a passkey instead of a password', () => { const askedForAPassword = async () => { - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); passkeySupportedMock.mockReturnValue(true); serverWith(HOUSEHOLD); @@ -585,7 +585,7 @@ describe('signing in with a passkey instead of a password', () => { }); it('offers nothing of the sort when the browser has none', async () => { - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); passkeySupportedMock.mockReturnValue(false); serverWith(HOUSEHOLD); @@ -600,7 +600,7 @@ describe('signing in with a passkey instead of a password', () => { it('lets somebody in when the passkey is accepted', async () => { const onSignedIn = vi.fn(); - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); passkeySupportedMock.mockReturnValue(true); passkeyMock.mockResolvedValue({ kind: 'signedIn' }); @@ -629,7 +629,7 @@ describe('signing in with a passkey instead of a password', () => { it('says nothing at all when somebody changed their mind', async () => { const onSignedIn = vi.fn(); - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); passkeySupportedMock.mockReturnValue(true); passkeyMock.mockResolvedValue({ kind: 'cancelled' }); @@ -680,7 +680,7 @@ describe('opened from the phone app, leading with a passkey', () => { }); it('says what went wrong when a passkey asked for by hand is refused', async () => { - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); passkeySupportedMock.mockReturnValue(true); passkeyMock.mockReset().mockResolvedValue({ kind: 'failed', reason: 'Not allowed.' }); @@ -693,7 +693,7 @@ describe('opened from the phone app, leading with a passkey', () => { }); it('goes to the usual ways in for somebody without one', async () => { - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); passkeySupportedMock.mockReturnValue(true); passkeyMock.mockReset().mockResolvedValue({ kind: 'cancelled' }); @@ -707,7 +707,7 @@ describe('opened from the phone app, leading with a passkey', () => { }); it('says nothing of a passkey refused after somebody moved on to another way in', async () => { - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); let refuse: (outcome: { kind: 'failed'; reason: string }) => void = () => undefined; passkeySupportedMock.mockReturnValue(true); @@ -830,7 +830,7 @@ describe('choosing a theme before signing in', () => { }); it('takes the theme somebody picks without making them sign in first', async () => { - const actor = userEvent.setup({ advanceTimers: vi.advanceTimersByTime }); + const actor = userEvent.setup({ delay: null, advanceTimers: vi.advanceTimersByTime }); renderInAnAddress(); await arrive(); diff --git a/packages/screens/src/components/ProfileRoster/ProfileRoster.test.tsx b/packages/screens/src/components/ProfileRoster/ProfileRoster.test.tsx index 545c0f9601..2d8585fcc9 100644 --- a/packages/screens/src/components/ProfileRoster/ProfileRoster.test.tsx +++ b/packages/screens/src/components/ProfileRoster/ProfileRoster.test.tsx @@ -34,7 +34,9 @@ describe('ProfileRoster', () => { render(); - await userEvent.type(screen.getByRole('textbox', { name: 'Add a profile' }), ' Sam '); + await userEvent.type(screen.getByRole('textbox', { name: 'Add a profile' }), ' Sam ', { + delay: null, + }); await userEvent.click(screen.getByRole('button', { name: 'Add' })); expect(onAdd).toHaveBeenCalledWith('Sam', PROFILE_COLOURS[1]); @@ -46,7 +48,9 @@ describe('ProfileRoster', () => { it('keeps the name where it could not be added', async () => { render( Promise.resolve(false)} />); - await userEvent.type(screen.getByRole('textbox', { name: 'Add a profile' }), 'Sam'); + await userEvent.type(screen.getByRole('textbox', { name: 'Add a profile' }), 'Sam', { + delay: null, + }); await userEvent.click(screen.getByRole('button', { name: 'Add' })); await waitFor(() => { diff --git a/packages/screens/src/components/ProfileSettings/ProfileSettings.test.tsx b/packages/screens/src/components/ProfileSettings/ProfileSettings.test.tsx index 9badbb52ca..dc8037a114 100644 --- a/packages/screens/src/components/ProfileSettings/ProfileSettings.test.tsx +++ b/packages/screens/src/components/ProfileSettings/ProfileSettings.test.tsx @@ -89,7 +89,7 @@ describe('ProfileSettings', () => { }); it('puts a theme into the draft, for the save button to keep', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onDraft = vi.fn(); renderInAnAddress(); @@ -103,7 +103,7 @@ describe('ProfileSettings', () => { }); it('puts a language for the profile into the draft', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onDraft = vi.fn(); renderInAnAddress(); @@ -129,7 +129,7 @@ describe('ProfileSettings', () => { }); it('writes a new name into the draft rather than saving it', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onDraft = vi.fn(); renderInAnAddress(); @@ -230,7 +230,7 @@ describe('ProfileSettings', () => { }); it('puts how this device streams into the draft', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); const onDraft = vi.fn(); renderInAnAddress(); diff --git a/packages/screens/src/components/ReencodeDialog/ReencodeDialog.test.tsx b/packages/screens/src/components/ReencodeDialog/ReencodeDialog.test.tsx index efc320c438..cc2a8219a5 100644 --- a/packages/screens/src/components/ReencodeDialog/ReencodeDialog.test.tsx +++ b/packages/screens/src/components/ReencodeDialog/ReencodeDialog.test.tsx @@ -291,7 +291,9 @@ describe('ReencodeDialog', () => { it('hides what falls below the size rule once one is set', async () => { render(); - await userEvent.type(screen.getByRole('spinbutton', { name: 'Larger than (GB)' }), '20'); + await userEvent.type(screen.getByRole('spinbutton', { name: 'Larger than (GB)' }), '20', { + delay: null, + }); expect(screen.queryByText('Harry Potter and the Prisoner of Azkaban')).toBeNull(); }); @@ -355,7 +357,9 @@ describe('ReencodeDialog', () => { render(); await userEvent.click(screen.getByRole('button', { name: 'Keep alongside' })); - await userEvent.type(screen.getByRole('spinbutton', { name: 'Bitrate ceiling' }), '3000'); + await userEvent.type(screen.getByRole('spinbutton', { name: 'Bitrate ceiling' }), '3000', { + delay: null, + }); await userEvent.click(theFilm()); await waitFor(() => { diff --git a/packages/screens/src/components/RequestsPage/components/BooksDiscover/BooksDiscover.test.tsx b/packages/screens/src/components/RequestsPage/components/BooksDiscover/BooksDiscover.test.tsx index 5ec03d05cb..bf10d5ca17 100644 --- a/packages/screens/src/components/RequestsPage/components/BooksDiscover/BooksDiscover.test.tsx +++ b/packages/screens/src/components/RequestsPage/components/BooksDiscover/BooksDiscover.test.tsx @@ -88,7 +88,7 @@ describe('BooksDiscover', () => { renderInAnAddress(); await screen.findByRole('heading', { name: 'Trending books' }); - await userEvent.type(screen.getByLabelText('Search for a book'), 'found'); + await userEvent.type(screen.getByLabelText('Search for a book'), 'found', { delay: null }); expect(await screen.findByText('Found It')).toBeInTheDocument(); expect(searchAskable).toHaveBeenLastCalledWith('found', 'book'); @@ -100,7 +100,7 @@ describe('BooksDiscover', () => { renderInAnAddress(); - await userEvent.type(await screen.findByLabelText('Search for a book'), 'zzz'); + await userEvent.type(await screen.findByLabelText('Search for a book'), 'zzz', { delay: null }); expect(await screen.findByText('No books found')).toBeInTheDocument(); }); @@ -117,7 +117,7 @@ describe('BooksDiscover', () => { renderInAnAddress(); - await userEvent.type(await screen.findByLabelText('Search for a book'), 'zzz'); + await userEvent.type(await screen.findByLabelText('Search for a book'), 'zzz', { delay: null }); expect(await screen.findByRole('alert')).toHaveTextContent('Couldn’t reach Open Library.'); }); diff --git a/packages/screens/src/components/RequestsPage/components/DiscoverSearchField/DiscoverSearchField.test.tsx b/packages/screens/src/components/RequestsPage/components/DiscoverSearchField/DiscoverSearchField.test.tsx index 5d3161305e..3e91348d9b 100644 --- a/packages/screens/src/components/RequestsPage/components/DiscoverSearchField/DiscoverSearchField.test.tsx +++ b/packages/screens/src/components/RequestsPage/components/DiscoverSearchField/DiscoverSearchField.test.tsx @@ -6,7 +6,7 @@ import { DiscoverSearchField } from './DiscoverSearchField'; describe('DiscoverSearchField', () => { it('searches for the words entered, and for nothing while there are none', async () => { const onSearch = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(); diff --git a/packages/screens/src/components/RequestsPage/components/RequestsList/RequestsList.test.tsx b/packages/screens/src/components/RequestsPage/components/RequestsList/RequestsList.test.tsx index a6eef9d2a0..13d336d1a5 100644 --- a/packages/screens/src/components/RequestsPage/components/RequestsList/RequestsList.test.tsx +++ b/packages/screens/src/components/RequestsPage/components/RequestsList/RequestsList.test.tsx @@ -107,6 +107,7 @@ describe('RequestsList', () => { await userEvent.type( await screen.findByRole('searchbox', { name: 'Search requests' }), 'arriv', + { delay: null }, ); await waitFor(() => { @@ -121,6 +122,7 @@ describe('RequestsList', () => { await userEvent.type( await screen.findByRole('searchbox', { name: 'Search requests' }), 'nothing like this', + { delay: null }, ); expect(await screen.findByText('Nothing matches that')).toBeInTheDocument(); diff --git a/packages/screens/src/components/ResetPasswordPage/ResetPasswordPage.test.tsx b/packages/screens/src/components/ResetPasswordPage/ResetPasswordPage.test.tsx index 2c8dd71464..d43a3b9239 100644 --- a/packages/screens/src/components/ResetPasswordPage/ResetPasswordPage.test.tsx +++ b/packages/screens/src/components/ResetPasswordPage/ResetPasswordPage.test.tsx @@ -27,14 +27,16 @@ describe('ResetPasswordPage', () => { const set = screen.getByRole('button', { name: 'Set password' }); - await userEvent.type(screen.getByLabelText('New password'), NEW_PASSWORD); - await userEvent.type(screen.getByLabelText('Confirm password'), 'something else'); + await userEvent.type(screen.getByLabelText('New password'), NEW_PASSWORD, { delay: null }); + await userEvent.type(screen.getByLabelText('Confirm password'), 'something else', { + delay: null, + }); expect(set).toBeDisabled(); expect(screen.getByText('The passwords don’t match.')).toBeInTheDocument(); await userEvent.clear(screen.getByLabelText('Confirm password')); - await userEvent.type(screen.getByLabelText('Confirm password'), NEW_PASSWORD); + await userEvent.type(screen.getByLabelText('Confirm password'), NEW_PASSWORD, { delay: null }); await userEvent.click(set); expect( @@ -47,8 +49,8 @@ describe('ResetPasswordPage', () => { resetPassword.mockResolvedValue({ kind: 'refused', reason: 'That link has expired.' }); render(); - await userEvent.type(screen.getByLabelText('New password'), NEW_PASSWORD); - await userEvent.type(screen.getByLabelText('Confirm password'), NEW_PASSWORD); + await userEvent.type(screen.getByLabelText('New password'), NEW_PASSWORD, { delay: null }); + await userEvent.type(screen.getByLabelText('Confirm password'), NEW_PASSWORD, { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Set password' })); expect(await screen.findByText('That link has expired.')).toBeInTheDocument(); diff --git a/packages/screens/src/components/SetupWizard/SetupWizard.test.tsx b/packages/screens/src/components/SetupWizard/SetupWizard.test.tsx index 78732a9a70..8e60e18971 100644 --- a/packages/screens/src/components/SetupWizard/SetupWizard.test.tsx +++ b/packages/screens/src/components/SetupWizard/SetupWizard.test.tsx @@ -181,21 +181,25 @@ const renderWizard = (props: Partial = {}) => const SETUP_CODE = 'K7QD-3MXP-9RTA-WZ4H'; const begin = async () => { - await userEvent.type(screen.getByLabelText('Setup code'), SETUP_CODE); + await userEvent.type(screen.getByLabelText('Setup code'), SETUP_CODE, { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Create your account' })); }; const reachAccess = async (email = '') => { await begin(); - await userEvent.type(await screen.findByLabelText('Name'), ' Operator '); - await userEvent.type(screen.getByLabelText('Username'), 'operator'); + await userEvent.type(await screen.findByLabelText('Name'), ' Operator ', { delay: null }); + await userEvent.type(screen.getByLabelText('Username'), 'operator', { delay: null }); if (email !== '') { - await userEvent.type(screen.getByLabelText('Email (optional)'), email); + await userEvent.type(screen.getByLabelText('Email (optional)'), email, { delay: null }); } - await userEvent.type(screen.getByLabelText('Password'), 'a-long-enough-password'); - await userEvent.type(screen.getByLabelText('Confirm password'), 'a-long-enough-password'); + await userEvent.type(screen.getByLabelText('Password'), 'a-long-enough-password', { + delay: null, + }); + await userEvent.type(screen.getByLabelText('Confirm password'), 'a-long-enough-password', { + delay: null, + }); await userEvent.click(screen.getByRole('button', { name: 'Continue' })); await screen.findByRole('button', { name: 'Create my account' }); }; @@ -390,7 +394,7 @@ describe('SetupWizard', () => { await createAccount(); await screen.findByText('That setup code doesn’t match the one in the server’s log.'); - await userEvent.type(screen.getByLabelText('Setup code'), 'X'); + await userEvent.type(screen.getByLabelText('Setup code'), 'X', { delay: null }); expect( screen.queryByText('That setup code doesn’t match the one in the server’s log.'), diff --git a/packages/screens/src/components/SetupWizard/components/AccountStep/AccountStep.test.tsx b/packages/screens/src/components/SetupWizard/components/AccountStep/AccountStep.test.tsx index 1be0414dad..55fa2ec745 100644 --- a/packages/screens/src/components/SetupWizard/components/AccountStep/AccountStep.test.tsx +++ b/packages/screens/src/components/SetupWizard/components/AccountStep/AccountStep.test.tsx @@ -26,10 +26,14 @@ const renderStep = (props: Parameters[0] = {}) => render(, { wrapper: CacheScope }); const fill = async () => { - await userEvent.type(screen.getByLabelText('Name'), 'Operator'); - await userEvent.type(screen.getByLabelText('Username'), 'operator'); - await userEvent.type(screen.getByLabelText('Password'), 'a-long-enough-password'); - await userEvent.type(screen.getByLabelText('Confirm password'), 'a-long-enough-password'); + await userEvent.type(screen.getByLabelText('Name'), 'Operator', { delay: null }); + await userEvent.type(screen.getByLabelText('Username'), 'operator', { delay: null }); + await userEvent.type(screen.getByLabelText('Password'), 'a-long-enough-password', { + delay: null, + }); + await userEvent.type(screen.getByLabelText('Confirm password'), 'a-long-enough-password', { + delay: null, + }); }; describe('AccountStep', () => { @@ -77,7 +81,7 @@ describe('AccountStep', () => { renderStep({ onContinue }); await fill(); - await userEvent.type(screen.getByLabelText('Email (optional)'), 'nope'); + await userEvent.type(screen.getByLabelText('Email (optional)'), 'nope', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Continue' })); expect(onContinue).not.toHaveBeenCalled(); @@ -91,11 +95,11 @@ describe('AccountStep', () => { const again = screen.getByLabelText('Confirm password'); - await userEvent.type(again, 'a-long'); + await userEvent.type(again, 'a-long', { delay: null }); expect(screen.queryByText('The passwords don’t match.')).toBeNull(); - await userEvent.type(again, '-enough-passwore'); + await userEvent.type(again, '-enough-passwore', { delay: null }); expect(screen.getByText('The passwords don’t match.')).toBeInTheDocument(); }); diff --git a/packages/screens/src/components/SetupWizard/components/CatalogueStep/CatalogueStep.test.tsx b/packages/screens/src/components/SetupWizard/components/CatalogueStep/CatalogueStep.test.tsx index d0bcdf8671..2dc1c72168 100644 --- a/packages/screens/src/components/SetupWizard/components/CatalogueStep/CatalogueStep.test.tsx +++ b/packages/screens/src/components/SetupWizard/components/CatalogueStep/CatalogueStep.test.tsx @@ -57,7 +57,9 @@ describe('CatalogueStep', () => { renderStep({ onSaved }); - await userEvent.type(await screen.findByLabelText('Catalogue key'), ' abc123 '); + await userEvent.type(await screen.findByLabelText('Catalogue key'), ' abc123 ', { + delay: null, + }); await userEvent.click(screen.getByRole('button', { name: 'Save and continue' })); await waitFor(() => { @@ -71,7 +73,9 @@ describe('CatalogueStep', () => { renderStep({ onSaved }); - await userEvent.type(await screen.findByLabelText('Catalogue key'), 'abc123{Enter}'); + await userEvent.type(await screen.findByLabelText('Catalogue key'), 'abc123{Enter}', { + delay: null, + }); await waitFor(() => { expect(onSaved).toHaveBeenCalledOnce(); @@ -81,7 +85,7 @@ describe('CatalogueStep', () => { it('does nothing on Enter with no key typed', async () => { renderStep(); - await userEvent.type(await screen.findByLabelText('Catalogue key'), '{Enter}'); + await userEvent.type(await screen.findByLabelText('Catalogue key'), '{Enter}', { delay: null }); expect(saveCatalogueKey).not.toHaveBeenCalled(); }); @@ -92,7 +96,7 @@ describe('CatalogueStep', () => { renderStep({ onSaved }); - await userEvent.type(await screen.findByLabelText('Catalogue key'), 'abc123'); + await userEvent.type(await screen.findByLabelText('Catalogue key'), 'abc123', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Save and continue' })); expect(await screen.findByText('Couldn’t save the catalogue key.')).toBeInTheDocument(); diff --git a/packages/screens/src/components/SetupWizard/components/HouseholdStep/HouseholdStep.test.tsx b/packages/screens/src/components/SetupWizard/components/HouseholdStep/HouseholdStep.test.tsx index dc0ff8a9fe..9b3b553269 100644 --- a/packages/screens/src/components/SetupWizard/components/HouseholdStep/HouseholdStep.test.tsx +++ b/packages/screens/src/components/SetupWizard/components/HouseholdStep/HouseholdStep.test.tsx @@ -135,7 +135,7 @@ describe('HouseholdStep', () => { expect(screen.getByRole('button', { name: 'Add' })).toBeDisabled(); - await userEvent.type(field, ' Alex {Enter}'); + await userEvent.type(field, ' Alex {Enter}', { delay: null }); await waitFor(() => { expect(createProfile).toHaveBeenCalledWith('Alex', expect.stringMatching(/^#/)); @@ -148,7 +148,9 @@ describe('HouseholdStep', () => { it('does not add somebody with only spaces for a name', async () => { renderStep(); - await userEvent.type(await screen.findByLabelText('Add a profile'), ' {Enter}'); + await userEvent.type(await screen.findByLabelText('Add a profile'), ' {Enter}', { + delay: null, + }); expect(createProfile).not.toHaveBeenCalled(); }); @@ -160,7 +162,7 @@ describe('HouseholdStep', () => { const field = await screen.findByLabelText('Add a profile'); - await userEvent.type(field, 'Alex'); + await userEvent.type(field, 'Alex', { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Add' })); expect(await screen.findByText('Couldn’t add that profile. Try again.')).toBeInTheDocument(); diff --git a/packages/screens/src/components/SetupWizard/components/ProfileStep/ProfileStep.test.tsx b/packages/screens/src/components/SetupWizard/components/ProfileStep/ProfileStep.test.tsx index f80f132505..30e03c1e9b 100644 --- a/packages/screens/src/components/SetupWizard/components/ProfileStep/ProfileStep.test.tsx +++ b/packages/screens/src/components/SetupWizard/components/ProfileStep/ProfileStep.test.tsx @@ -67,7 +67,9 @@ describe('ProfileStep', () => { renderStep(onContinue); - await userEvent.type(await screen.findByRole('textbox', { name: 'Display name' }), 'Dan'); + await userEvent.type(await screen.findByRole('textbox', { name: 'Display name' }), 'Dan', { + delay: null, + }); await userEvent.click(screen.getByRole('button', { name: 'Continue' })); await waitFor(() => { diff --git a/packages/screens/src/components/SetupWizard/components/WelcomeStep/WelcomeStep.test.tsx b/packages/screens/src/components/SetupWizard/components/WelcomeStep/WelcomeStep.test.tsx index b364f21320..431947b75d 100644 --- a/packages/screens/src/components/SetupWizard/components/WelcomeStep/WelcomeStep.test.tsx +++ b/packages/screens/src/components/SetupWizard/components/WelcomeStep/WelcomeStep.test.tsx @@ -51,7 +51,7 @@ describe('WelcomeStep', () => { it('asks for the code the server printed in its log, and says where to find it', async () => { const { onSetupCodeChange } = welcome(); - await userEvent.type(screen.getByLabelText('Setup code'), 'K'); + await userEvent.type(screen.getByLabelText('Setup code'), 'K', { delay: null }); expect(onSetupCodeChange).toHaveBeenCalledWith('K'); expect(screen.getByText(/printed it in its log/)).toBeInTheDocument(); diff --git a/packages/screens/src/components/SmartRulesEditor/components/SmartRuleRow/SmartRuleRow.test.tsx b/packages/screens/src/components/SmartRulesEditor/components/SmartRuleRow/SmartRuleRow.test.tsx index 18d99940ec..34ed2f3fa8 100644 --- a/packages/screens/src/components/SmartRulesEditor/components/SmartRuleRow/SmartRuleRow.test.tsx +++ b/packages/screens/src/components/SmartRulesEditor/components/SmartRuleRow/SmartRuleRow.test.tsx @@ -36,7 +36,7 @@ describe('SmartRuleRow', () => { render(); - await userEvent.type(screen.getByLabelText('From'), '1'); + await userEvent.type(screen.getByLabelText('From'), '1', { delay: null }); expect(onChange).toHaveBeenCalledWith(expect.objectContaining({ first: '1' })); }); diff --git a/packages/screens/src/components/TwoFactorChallenge/TwoFactorChallenge.test.tsx b/packages/screens/src/components/TwoFactorChallenge/TwoFactorChallenge.test.tsx index c4a0463c10..25e7fb9b8b 100644 --- a/packages/screens/src/components/TwoFactorChallenge/TwoFactorChallenge.test.tsx +++ b/packages/screens/src/components/TwoFactorChallenge/TwoFactorChallenge.test.tsx @@ -31,7 +31,7 @@ describe('TwoFactorChallenge', () => { }); it('rejects a code that is not six digits without contacting the server', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await actor.type(screen.getByLabelText('Authenticator code'), '123'); @@ -42,7 +42,7 @@ describe('TwoFactorChallenge', () => { }); it('checks a valid code against the authenticator', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await actor.type(screen.getByLabelText('Authenticator code'), '123456'); @@ -55,7 +55,7 @@ describe('TwoFactorChallenge', () => { it('reports success to its parent', async () => { const onVerified = vi.fn(); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await actor.type(screen.getByLabelText('Authenticator code'), '123456'); @@ -69,7 +69,7 @@ describe('TwoFactorChallenge', () => { it('does not sign in when the code is rejected', async () => { respondWith(false); const onVerified = vi.fn(); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await actor.type(screen.getByLabelText('Authenticator code'), '123456'); @@ -80,7 +80,7 @@ describe('TwoFactorChallenge', () => { }); it('switches to backup codes', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await actor.click(screen.getByRole('button', { name: /Use a backup code/ })); @@ -89,7 +89,7 @@ describe('TwoFactorChallenge', () => { }); it('checks a backup code as a backup code', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await actor.click(screen.getByRole('button', { name: /Use a backup code/ })); @@ -103,7 +103,7 @@ describe('TwoFactorChallenge', () => { }); it('does not apply the six digit rule to backup codes', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await actor.click(screen.getByRole('button', { name: /Use a backup code/ })); @@ -116,7 +116,7 @@ describe('TwoFactorChallenge', () => { }); it('clears a typed code when switching modes', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await actor.type(screen.getByLabelText('Authenticator code'), '123456'); @@ -133,7 +133,7 @@ describe('TwoFactorChallenge', () => { it('reports an unreachable server rather than failing silently', async () => { verifyTotp.mockRejectedValue(new Error('offline')); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await actor.type(screen.getByLabelText('Authenticator code'), '123456'); diff --git a/packages/screens/src/components/TwoFactorSetup/TwoFactorSetup.test.tsx b/packages/screens/src/components/TwoFactorSetup/TwoFactorSetup.test.tsx index a4c501cd55..d0b49f5c78 100644 --- a/packages/screens/src/components/TwoFactorSetup/TwoFactorSetup.test.tsx +++ b/packages/screens/src/components/TwoFactorSetup/TwoFactorSetup.test.tsx @@ -37,7 +37,7 @@ describe('TwoFactorSetup when disabled', () => { }); it('asks for the password before revealing a secret', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await actor.click(screen.getByRole('button', { name: 'Set up' })); @@ -47,7 +47,7 @@ describe('TwoFactorSetup when disabled', () => { }); it('shows the qr code, the key as text, and the backup codes', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await startEnrollment(actor); @@ -62,7 +62,7 @@ describe('TwoFactorSetup when disabled', () => { it('reports a wrong password without revealing a secret', async () => { enableTwoFactor.mockResolvedValue(null); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await startEnrollment(actor); @@ -73,7 +73,7 @@ describe('TwoFactorSetup when disabled', () => { it('does not enable until a generated code is confirmed', async () => { const onChanged = vi.fn(); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await startEnrollment(actor); @@ -83,7 +83,7 @@ describe('TwoFactorSetup when disabled', () => { }); it('rejects a confirmation code that is not six digits', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await startEnrollment(actor); @@ -98,7 +98,7 @@ describe('TwoFactorSetup when disabled', () => { it('completes enrollment when the code is accepted', async () => { const onChanged = vi.fn(); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await startEnrollment(actor); @@ -115,7 +115,7 @@ describe('TwoFactorSetup when disabled', () => { it('does not complete enrollment when the code is rejected', async () => { const onChanged = vi.fn(); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await startEnrollment(actor); @@ -138,7 +138,7 @@ describe('TwoFactorSetup when enabled', () => { }); it('requires the password to turn it off', async () => { - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await actor.click(screen.getByRole('button', { name: 'Turn off' })); @@ -149,7 +149,7 @@ describe('TwoFactorSetup when enabled', () => { it('asks for it to be turned off', async () => { const onChanged = vi.fn(); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await actor.click(screen.getByRole('button', { name: 'Turn off' })); @@ -165,7 +165,7 @@ describe('TwoFactorSetup when enabled', () => { it('does not turn it off when the password is wrong', async () => { disableTwoFactor.mockResolvedValue(false); const onChanged = vi.fn(); - const actor = userEvent.setup(); + const actor = userEvent.setup({ delay: null }); render(); await actor.click(screen.getByRole('button', { name: 'Turn off' })); diff --git a/packages/screens/src/components/WelcomePage/WelcomePage.test.tsx b/packages/screens/src/components/WelcomePage/WelcomePage.test.tsx index 5723bd0757..a05a5ba591 100644 --- a/packages/screens/src/components/WelcomePage/WelcomePage.test.tsx +++ b/packages/screens/src/components/WelcomePage/WelcomePage.test.tsx @@ -63,9 +63,11 @@ describe('WelcomePage', () => { expect(screen.getByLabelText('Username')).toHaveValue('ada'); await userEvent.clear(screen.getByLabelText('Username')); - await userEvent.type(screen.getByLabelText('Username'), 'countess'); - await userEvent.type(screen.getByLabelText('Email (optional)'), 'ada@example.com'); - await userEvent.type(screen.getByLabelText('Password'), PASSWORD); + await userEvent.type(screen.getByLabelText('Username'), 'countess', { delay: null }); + await userEvent.type(screen.getByLabelText('Email (optional)'), 'ada@example.com', { + delay: null, + }); + await userEvent.type(screen.getByLabelText('Password'), PASSWORD, { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Continue' })); expect(redeemSetupLink).toHaveBeenCalledWith('tok', { @@ -98,7 +100,7 @@ describe('WelcomePage', () => { it('will not finish with a password too short', async () => { drawIt(); - await userEvent.type(await screen.findByLabelText('Password'), 'short'); + await userEvent.type(await screen.findByLabelText('Password'), 'short', { delay: null }); expect(screen.getByRole('button', { name: 'Continue' })).toBeDisabled(); }); @@ -112,7 +114,7 @@ describe('WelcomePage', () => { expect(screen.queryByLabelText('Username')).not.toBeInTheDocument(); expect(screen.queryByLabelText('Email (optional)')).not.toBeInTheDocument(); - await userEvent.type(screen.getByLabelText('Password'), PASSWORD); + await userEvent.type(screen.getByLabelText('Password'), PASSWORD, { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Continue' })); expect(redeemSetupLink).toHaveBeenCalledWith('tok', { password: PASSWORD }); @@ -134,7 +136,7 @@ describe('WelcomePage', () => { drawIt(); - await userEvent.type(await screen.findByLabelText('Password'), PASSWORD); + await userEvent.type(await screen.findByLabelText('Password'), PASSWORD, { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Continue' })); expect(await screen.findByRole('alert')).toHaveTextContent('already in use'); @@ -146,7 +148,7 @@ describe('WelcomePage', () => { drawIt(); - await userEvent.type(await screen.findByLabelText('Password'), PASSWORD); + await userEvent.type(await screen.findByLabelText('Password'), PASSWORD, { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Continue' })); expect(await screen.findByRole('status')).toHaveTextContent('Your password is set'); @@ -178,7 +180,7 @@ describe('WelcomePage', () => { await screen.findByRole('heading', { name: 'Your passkey wasn’t created' }), ).toBeInTheDocument(); - await userEvent.type(screen.getByLabelText('Password'), PASSWORD); + await userEvent.type(screen.getByLabelText('Password'), PASSWORD, { delay: null }); await userEvent.click(screen.getByRole('button', { name: 'Use this password instead' })); expect(giveFirstPassword).toHaveBeenCalledWith(PASSWORD); diff --git a/packages/screens/src/components/WhoIsWatching/WhoIsWatching.test.tsx b/packages/screens/src/components/WhoIsWatching/WhoIsWatching.test.tsx index cbabd3df7a..4bec753ae3 100644 --- a/packages/screens/src/components/WhoIsWatching/WhoIsWatching.test.tsx +++ b/packages/screens/src/components/WhoIsWatching/WhoIsWatching.test.tsx @@ -50,7 +50,7 @@ const draw = (onChosen = vi.fn(), onSignOut = vi.fn()) => { />, ); - return { onChosen, onSignOut, actor: userEvent.setup() }; + return { onChosen, onSignOut, actor: userEvent.setup({ delay: null }) }; }; const pinField = () => screen.getByLabelText('PIN'); diff --git a/packages/screens/vitest.config.ts b/packages/screens/vitest.config.ts index 21b57c4d21..5a95b4553b 100644 --- a/packages/screens/vitest.config.ts +++ b/packages/screens/vitest.config.ts @@ -6,6 +6,7 @@ export default defineConfig({ plugins: [react()], test: { environment: 'jsdom', + pool: 'threads', globals: true, setupFiles: ['./vitest.setup.ts'], sequence: { hooks: 'list' }, diff --git a/packages/ui/src/components/CommandPalette/CommandPalette.test.tsx b/packages/ui/src/components/CommandPalette/CommandPalette.test.tsx index 626fa55283..05e08684a0 100644 --- a/packages/ui/src/components/CommandPalette/CommandPalette.test.tsx +++ b/packages/ui/src/components/CommandPalette/CommandPalette.test.tsx @@ -47,7 +47,7 @@ describe('CommandPalette', () => { it('says what was typed', async () => { const onQueryChange = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(palette({ onQueryChange })); await user.type(screen.getByRole('combobox'), 'u'); @@ -57,7 +57,7 @@ describe('CommandPalette', () => { it('chooses a result by its id', async () => { const onSelect = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(palette({ onSelect })); await user.click(screen.getByText('Updating')); diff --git a/packages/ui/src/components/Form/Form.test.tsx b/packages/ui/src/components/Form/Form.test.tsx index a541613cd1..e3c978c4ee 100644 --- a/packages/ui/src/components/Form/Form.test.tsx +++ b/packages/ui/src/components/Form/Form.test.tsx @@ -5,7 +5,7 @@ import { Form } from './Form'; describe('Form', () => { it('is sent by pressing Enter in a field, the same as by its button', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const onSubmit = vi.fn((event: { preventDefault: () => void }) => { event.preventDefault(); }); diff --git a/packages/ui/src/components/PinField/PinField.test.tsx b/packages/ui/src/components/PinField/PinField.test.tsx index 7841b63ac0..f779a27915 100644 --- a/packages/ui/src/components/PinField/PinField.test.tsx +++ b/packages/ui/src/components/PinField/PinField.test.tsx @@ -48,7 +48,7 @@ describe('PinField', () => { it('takes only digits, and no more than eight of them', async () => { const onValueChange = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(); diff --git a/packages/ui/src/components/ScopedField/ScopedField.test.tsx b/packages/ui/src/components/ScopedField/ScopedField.test.tsx index 640c0100d9..6287138f48 100644 --- a/packages/ui/src/components/ScopedField/ScopedField.test.tsx +++ b/packages/ui/src/components/ScopedField/ScopedField.test.tsx @@ -11,7 +11,7 @@ const KINDS = [ describe('ScopedField', () => { it('takes what is typed, and shows the kind in force at its end', async () => { const onValueChange = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render( { it('says which kind was chosen from each choice at its end', async () => { const onKind = vi.fn(); const onLanguage = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render( { it('adds what was typed on Enter, and each word before a comma', async () => { const onChange = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(); @@ -48,7 +48,7 @@ describe('TagField', () => { it('suggests a word already in use, and keeps the library’s spelling of it', async () => { const onChange = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(); @@ -63,7 +63,7 @@ describe('TagField', () => { it('never adds the same word twice, whatever its spelling', async () => { const onChange = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(); @@ -74,7 +74,7 @@ describe('TagField', () => { it('takes the last word away on Backspace in an empty field, and one by its chip', async () => { const onChange = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(); @@ -87,7 +87,7 @@ describe('TagField', () => { it('moves a word with Alt and an arrow, and by dragging it onto another', async () => { const onValuesChange = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render( { it('reports each typed character', async () => { const onValueChange = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(); await user.type(screen.getByLabelText('Email'), 'a'); @@ -36,7 +36,7 @@ describe('TextField', () => { }); it('accumulates typed text when driven by state', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(); await user.type(screen.getByLabelText('Email'), 'valence'); @@ -145,7 +145,7 @@ describe('TextField', () => { it('does not accept input when disabled', async () => { const onValueChange = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(); await user.type(screen.getByLabelText('Email'), 'a'); @@ -184,7 +184,7 @@ describe('TextField', () => { it('still reports what was typed', async () => { const onValueChange = vi.fn(); - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); render(); await user.type(screen.getByLabelText('Search'), 'a'); @@ -374,7 +374,7 @@ describe('a control after the field', () => { }); it('becomes a box for several lines where it is given rows, reaching the caller by its own ref', async () => { - const user = userEvent.setup(); + const user = userEvent.setup({ delay: null }); const onValueChange = vi.fn(); const areaRef = createRef(); diff --git a/packages/ui/vitest.config.ts b/packages/ui/vitest.config.ts index 907fdbee17..13a70a7302 100644 --- a/packages/ui/vitest.config.ts +++ b/packages/ui/vitest.config.ts @@ -4,6 +4,7 @@ export default defineConfig({ resolve: { tsconfigPaths: true }, test: { environment: 'jsdom', + pool: 'threads', globals: true, setupFiles: ['./vitest.setup.ts'], sequence: { hooks: 'list' },