fix: react.use should not depend on data condition #777
Annotations
14 errors and 1 notice
test
Process completed with exit code 1.
|
useSWR - concurrent rendering › should pause when changing the key inside a transition:
test/use-swr-concurrent-rendering.test.tsx#L61
TestingLibraryElementError: Unable to find an element with the text: isPending:0,data:swr-key-5211509. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.
Ignored nodes: comments, script, style
<body>
<div>
<div>
isPending:
0
,
loading
</div>
</div>
</body>
at Object.getElementError (node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/config.js:37:19)
at node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/query-helpers.js:76:38
at node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/query-helpers.js:52:17
at node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/query-helpers.js:95:19
at Object.getByText (test/use-swr-concurrent-rendering.test.tsx:61:12)
|
useSWR - suspense › should only render fallback once when `keepPreviousData` is set to true:
test/use-swr-suspense.test.tsx#L422
expect(jest.fn()).toHaveBeenCalledTimes(expected)
Expected number of calls: 1
Received number of calls: 2
at Object.toHaveBeenCalledTimes (test/use-swr-suspense.test.tsx:422:22)
|
useSWR - suspense › should throw errors:
test/use-swr-suspense.test.tsx#L117
Unable to find an element with the text: error boundary. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.
Ignored nodes: comments, script, style
<body>
<div>
<div>
fallback
</div>
</div>
</body>
at waitForWrapper (node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/wait-for.js:166:27)
at node_modules/.pnpm/@testing-library[email protected]/node_modules/@testing-library/dom/dist/query-helpers.js:86:33
at Object.findByText (test/use-swr-suspense.test.tsx:117:18)
|
e2e
Process completed with exit code 1.
|
test/initial-render.test.ts:26:7 › rendering › should be able to retry in suspense with mutate:
e2e/test/initial-render.test.ts#L28
3) test/initial-render.test.ts:26:7 › rendering › should be able to retry in suspense with mutate
Retry #2 ───────────────────────────────────────────────────────────────────────────────────────
Error: Timed out 5000ms waiting for expect(received).toBeVisible()
Call log:
- expect.toBeVisible with timeout 5000ms
- waiting for getByText('Something went wrong')
26 | test('should be able to retry in suspense with mutate', async ({ page }) => {
27 | await page.goto('./suspense-retry-mutate', { waitUntil: 'commit' })
> 28 | await expect(page.getByText('Something went wrong')).toBeVisible()
| ^
29 | await page.getByRole('button', { name: 'retry' }).click()
30 | await expect(page.getByText('data: SWR suspense retry works')).toBeVisible()
31 | })
at /__w/swr/swr/e2e/test/initial-render.test.ts:28:58
|
test/initial-render.test.ts:26:7 › rendering › should be able to retry in suspense with mutate:
e2e/test/initial-render.test.ts#L28
3) test/initial-render.test.ts:26:7 › rendering › should be able to retry in suspense with mutate
Retry #1 ───────────────────────────────────────────────────────────────────────────────────────
Error: Timed out 5000ms waiting for expect(received).toBeVisible()
Call log:
- expect.toBeVisible with timeout 5000ms
- waiting for getByText('Something went wrong')
26 | test('should be able to retry in suspense with mutate', async ({ page }) => {
27 | await page.goto('./suspense-retry-mutate', { waitUntil: 'commit' })
> 28 | await expect(page.getByText('Something went wrong')).toBeVisible()
| ^
29 | await page.getByRole('button', { name: 'retry' }).click()
30 | await expect(page.getByText('data: SWR suspense retry works')).toBeVisible()
31 | })
at /__w/swr/swr/e2e/test/initial-render.test.ts:28:58
|
test/initial-render.test.ts:26:7 › rendering › should be able to retry in suspense with mutate:
e2e/test/initial-render.test.ts#L28
3) test/initial-render.test.ts:26:7 › rendering › should be able to retry in suspense with mutate
Error: Timed out 5000ms waiting for expect(received).toBeVisible()
Call log:
- expect.toBeVisible with timeout 5000ms
- waiting for getByText('Something went wrong')
26 | test('should be able to retry in suspense with mutate', async ({ page }) => {
27 | await page.goto('./suspense-retry-mutate', { waitUntil: 'commit' })
> 28 | await expect(page.getByText('Something went wrong')).toBeVisible()
| ^
29 | await page.getByRole('button', { name: 'retry' }).click()
30 | await expect(page.getByText('data: SWR suspense retry works')).toBeVisible()
31 | })
at /__w/swr/swr/e2e/test/initial-render.test.ts:28:58
|
test/initial-render.test.ts:18:7 › rendering › should be able to retry in suspense with react 18.2:
e2e/test/initial-render.test.ts#L22
2) test/initial-render.test.ts:18:7 › rendering › should be able to retry in suspense with react 18.2
Retry #2 ───────────────────────────────────────────────────────────────────────────────────────
Error: Timed out 5000ms waiting for expect(received).toBeVisible()
Call log:
- expect.toBeVisible with timeout 5000ms
- waiting for getByText('Something went wrong')
20 | }) => {
21 | await page.goto('./suspense-retry-18-2', { waitUntil: 'commit' })
> 22 | await expect(page.getByText('Something went wrong')).toBeVisible()
| ^
23 | await page.getByRole('button', { name: 'retry' }).click()
24 | await expect(page.getByText('data: SWR suspense retry works')).toBeVisible()
25 | })
at /__w/swr/swr/e2e/test/initial-render.test.ts:22:58
|
test/initial-render.test.ts:18:7 › rendering › should be able to retry in suspense with react 18.2:
e2e/test/initial-render.test.ts#L22
2) test/initial-render.test.ts:18:7 › rendering › should be able to retry in suspense with react 18.2
Retry #1 ───────────────────────────────────────────────────────────────────────────────────────
Error: Timed out 5000ms waiting for expect(received).toBeVisible()
Call log:
- expect.toBeVisible with timeout 5000ms
- waiting for getByText('Something went wrong')
20 | }) => {
21 | await page.goto('./suspense-retry-18-2', { waitUntil: 'commit' })
> 22 | await expect(page.getByText('Something went wrong')).toBeVisible()
| ^
23 | await page.getByRole('button', { name: 'retry' }).click()
24 | await expect(page.getByText('data: SWR suspense retry works')).toBeVisible()
25 | })
at /__w/swr/swr/e2e/test/initial-render.test.ts:22:58
|
test/initial-render.test.ts:18:7 › rendering › should be able to retry in suspense with react 18.2:
e2e/test/initial-render.test.ts#L22
2) test/initial-render.test.ts:18:7 › rendering › should be able to retry in suspense with react 18.2
Error: Timed out 5000ms waiting for expect(received).toBeVisible()
Call log:
- expect.toBeVisible with timeout 5000ms
- waiting for getByText('Something went wrong')
20 | }) => {
21 | await page.goto('./suspense-retry-18-2', { waitUntil: 'commit' })
> 22 | await expect(page.getByText('Something went wrong')).toBeVisible()
| ^
23 | await page.getByRole('button', { name: 'retry' }).click()
24 | await expect(page.getByText('data: SWR suspense retry works')).toBeVisible()
25 | })
at /__w/swr/swr/e2e/test/initial-render.test.ts:22:58
|
test/initial-render.test.ts:10:7 › rendering › should be able to retry in suspense with react 18.3:
e2e/test/initial-render.test.ts#L14
1) test/initial-render.test.ts:10:7 › rendering › should be able to retry in suspense with react 18.3
Retry #2 ───────────────────────────────────────────────────────────────────────────────────────
Error: Timed out 5000ms waiting for expect(received).toBeVisible()
Call log:
- expect.toBeVisible with timeout 5000ms
- waiting for getByText('Something went wrong')
12 | }) => {
13 | await page.goto('./suspense-retry-18-3', { waitUntil: 'commit' })
> 14 | await expect(page.getByText('Something went wrong')).toBeVisible()
| ^
15 | await page.getByRole('button', { name: 'retry' }).click()
16 | await expect(page.getByText('data: SWR suspense retry works')).toBeVisible()
17 | })
at /__w/swr/swr/e2e/test/initial-render.test.ts:14:58
|
test/initial-render.test.ts:10:7 › rendering › should be able to retry in suspense with react 18.3:
e2e/test/initial-render.test.ts#L14
1) test/initial-render.test.ts:10:7 › rendering › should be able to retry in suspense with react 18.3
Retry #1 ───────────────────────────────────────────────────────────────────────────────────────
Error: Timed out 5000ms waiting for expect(received).toBeVisible()
Call log:
- expect.toBeVisible with timeout 5000ms
- waiting for getByText('Something went wrong')
12 | }) => {
13 | await page.goto('./suspense-retry-18-3', { waitUntil: 'commit' })
> 14 | await expect(page.getByText('Something went wrong')).toBeVisible()
| ^
15 | await page.getByRole('button', { name: 'retry' }).click()
16 | await expect(page.getByText('data: SWR suspense retry works')).toBeVisible()
17 | })
at /__w/swr/swr/e2e/test/initial-render.test.ts:14:58
|
test/initial-render.test.ts:10:7 › rendering › should be able to retry in suspense with react 18.3:
e2e/test/initial-render.test.ts#L14
1) test/initial-render.test.ts:10:7 › rendering › should be able to retry in suspense with react 18.3
Error: Timed out 5000ms waiting for expect(received).toBeVisible()
Call log:
- expect.toBeVisible with timeout 5000ms
- waiting for getByText('Something went wrong')
12 | }) => {
13 | await page.goto('./suspense-retry-18-3', { waitUntil: 'commit' })
> 14 | await expect(page.getByText('Something went wrong')).toBeVisible()
| ^
15 | await page.getByRole('button', { name: 'retry' }).click()
16 | await expect(page.getByText('data: SWR suspense retry works')).toBeVisible()
17 | })
at /__w/swr/swr/e2e/test/initial-render.test.ts:14:58
|
🎭 Playwright Run Summary
3 failed
test/initial-render.test.ts:10:7 › rendering › should be able to retry in suspense with react 18.3
test/initial-render.test.ts:18:7 › rendering › should be able to retry in suspense with react 18.2
test/initial-render.test.ts:26:7 › rendering › should be able to retry in suspense with mutate ─
7 passed (56.8s)
|
Artifacts
Produced during runtime
Name | Size | Digest | |
---|---|---|---|
playwright-report
|
628 KB |
sha256:dd37c3eca1ee368c40cf7ece4f57dbf097aee8499698cf933d66f9b62e9a0ad9
|
|