forked from TanStack/query
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5e9b3bf
commit 8200ebf
Showing
2 changed files
with
14 additions
and
8 deletions.
There are no files selected for viewing
5 changes: 4 additions & 1 deletion
5
packages/svelte-query/tests/createInfiniteQuery/BaseExample.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 10 additions & 7 deletions
17
packages/svelte-query/tests/createInfiniteQuery/createInfiniteQuery.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
import { describe, test } from 'vitest' | ||
import { render } from '@testing-library/svelte' | ||
import { render, waitFor } from '@testing-library/svelte' | ||
|
||
import { sleep } from '../utils' | ||
import BaseExample from './BaseExample.svelte' | ||
|
||
describe.only('createQuery', () => { | ||
describe('createQuery', () => { | ||
test('Render and wait for success', async () => { | ||
const rendered = render(BaseExample) | ||
|
||
// await rendered.findByText('Data: undefined') | ||
// await rendered.findByText('Status: pending') | ||
waitFor(async () => { | ||
await rendered.findByText('Data: undefined') | ||
await rendered.findByText('Status: pending') | ||
}) | ||
|
||
await sleep(20) | ||
|
||
await rendered.findByText('Data: {"pages":[0],"pageParams":[0]}') | ||
await rendered.findByText('Status: success') | ||
waitFor(async () => { | ||
await rendered.findByText('Data: {"pages":[0],"pageParams":[0]}') | ||
await rendered.findByText('Status: success') | ||
}) | ||
}) | ||
}) |