Skip to content

Commit

Permalink
chore(solid-query): Replace screen with rendered in tests (TanSta…
Browse files Browse the repository at this point in the history
…ck#6589)

* Replace screen with rendered

* Bump solid version

* Update @solidjs/testing-library

* Bumpto 0.8.5
  • Loading branch information
lachlancollins authored Dec 26, 2023
1 parent 42362e4 commit 3b6e373
Show file tree
Hide file tree
Showing 21 changed files with 758 additions and 773 deletions.
2 changes: 1 addition & 1 deletion examples/solid/basic-graphql-request/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@tanstack/solid-query-devtools": "^5.0.0",
"graphql": "^16.8.1",
"graphql-request": "^6.1.0",
"solid-js": "^1.8.1"
"solid-js": "^1.8.7"
},
"devDependencies": {
"typescript": "5.2.2",
Expand Down
2 changes: 1 addition & 1 deletion examples/solid/basic-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dependencies": {
"@tanstack/solid-query": "^5.0.0",
"@tanstack/solid-query-devtools": "^5.0.0",
"solid-js": "^1.8.1"
"solid-js": "^1.8.7"
},
"devDependencies": {
"typescript": "5.2.2",
Expand Down
2 changes: 1 addition & 1 deletion examples/solid/default-query-function/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dependencies": {
"@tanstack/solid-query": "^5.0.0",
"@tanstack/solid-query-devtools": "^5.0.0",
"solid-js": "^1.8.1"
"solid-js": "^1.8.7"
},
"devDependencies": {
"typescript": "5.2.2",
Expand Down
2 changes: 1 addition & 1 deletion examples/solid/simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dependencies": {
"@tanstack/solid-query": "^5.0.0",
"@tanstack/solid-query-devtools": "^5.0.0",
"solid-js": "^1.8.1"
"solid-js": "^1.8.7"
},
"devDependencies": {
"@tanstack/eslint-plugin-query": "^5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/solid/solid-start-streaming/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@solidjs/router": "^0.8.3",
"@tanstack/solid-query": "^5.0.0",
"@tanstack/solid-query-devtools": "^5.0.0",
"solid-js": "^1.8.1",
"solid-js": "^1.8.7",
"solid-start": "^0.3.7",
"undici": "^5.28.2"
},
Expand Down
2 changes: 1 addition & 1 deletion integrations/solid-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"dependencies": {
"@tanstack/solid-query": "workspace:*",
"@tanstack/solid-query-devtools": "workspace:*",
"solid-js": "^1.8.1",
"solid-js": "^1.8.7",
"vite": "^4.5.1",
"vite-plugin-solid": "^2.7.2"
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"namespace": "@tanstack",
"devDependencies": {
"@commitlint/parse": "^18.4.3",
"@solidjs/testing-library": "^0.5.1",
"@solidjs/testing-library": "^0.8.5",
"@testing-library/jest-dom": "^6.1.5",
"@testing-library/react": "^14.1.2",
"@types/current-git-branch": "^1.1.6",
Expand Down Expand Up @@ -80,7 +80,7 @@
"rimraf": "^5.0.5",
"semver": "^7.5.4",
"sherif": "^0.7.0",
"solid-js": "^1.8.1",
"solid-js": "^1.8.7",
"stream-to-array": "^2.3.0",
"tsup": "^8.0.1",
"type-fest": "^4.8.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/query-devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"@tanstack/query-core": "workspace:*",
"clsx": "^2.0.0",
"goober": "^2.1.13",
"solid-js": "^1.8.1",
"solid-js": "^1.8.7",
"solid-transition-group": "^0.2.3",
"superjson": "^1.13.3",
"tsup-preset-solid": "^2.2.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/solid-query-devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@
"@tanstack/query-devtools": "workspace:*"
},
"peerDependencies": {
"solid-js": "^1.8.1",
"solid-js": "^1.8.7",
"@tanstack/solid-query": "workspace:^"
},
"devDependencies": {
"solid-js": "^1.8.1",
"solid-js": "^1.8.7",
"@tanstack/solid-query": "workspace:^",
"tsup-preset-solid": "^2.2.0",
"vite-plugin-solid": "^2.7.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/solid-query-persist-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"devDependencies": {
"tsup-preset-solid": "^2.2.0",
"vite-plugin-solid": "^2.7.2",
"solid-js": "^1.8.1"
"solid-js": "^1.8.7"
},
"peerDependencies": {
"@tanstack/solid-query": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/solid-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
],
"dependencies": {
"@tanstack/query-core": "workspace:*",
"solid-js": "^1.8.1"
"solid-js": "^1.8.7"
},
"devDependencies": {
"tsup-preset-solid": "^2.2.0",
Expand Down
16 changes: 8 additions & 8 deletions packages/solid-query/src/__tests__/QueryClientProvider.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest'
import { render, screen, waitFor } from '@solidjs/testing-library'
import { render, waitFor } from '@solidjs/testing-library'
import { QueryCache } from '@tanstack/query-core'
import { QueryClientProvider, createQuery, useQueryClient } from '..'
import { createQueryClient, queryKey, sleep } from './utils'
Expand Down Expand Up @@ -27,14 +27,14 @@ describe('QueryClientProvider', () => {
)
}

render(() => (
const rendered = render(() => (
<QueryClientProvider client={queryClient}>
<Page />
</QueryClientProvider>
))

await waitFor(() => {
return screen.getByText('test')
return rendered.getByText('test')
})

expect(queryCache.find({ queryKey: key })).toBeDefined()
Expand Down Expand Up @@ -81,7 +81,7 @@ describe('QueryClientProvider', () => {
)
}

render(() => (
const rendered = render(() => (
<>
<QueryClientProvider client={queryClient1}>
<Page1 />
Expand All @@ -92,8 +92,8 @@ describe('QueryClientProvider', () => {
</>
))

await waitFor(() => screen.getByText('test1'))
await waitFor(() => screen.getByText('test2'))
await waitFor(() => rendered.getByText('test1'))
await waitFor(() => rendered.getByText('test2'))

expect(queryCache1.find({ queryKey: key1 })).toBeDefined()
expect(queryCache1.find({ queryKey: key2 })).not.toBeDefined()
Expand Down Expand Up @@ -130,13 +130,13 @@ describe('QueryClientProvider', () => {
)
}

render(() => (
const rendered = render(() => (
<QueryClientProvider client={queryClient}>
<Page />
</QueryClientProvider>
))

await waitFor(() => screen.getByText('test'))
await waitFor(() => rendered.getByText('test'))

expect(queryCache.find({ queryKey: key })).toBeDefined()
expect(queryCache.find({ queryKey: key })?.options.gcTime).toBe(Infinity)
Expand Down
Loading

0 comments on commit 3b6e373

Please sign in to comment.