Skip to content

Commit 6ea8d69

Browse files
committed
test: Add test for the agnostic adapter
1 parent 23c57cb commit 6ea8d69

File tree

5 files changed

+47
-1
lines changed

5 files changed

+47
-1
lines changed

packages/e2e/next/cypress/e2e/shared/basic-io.cy.ts

+16
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,19 @@ testBasicIO({
2323
path: '/pages/basic-io/useQueryStates',
2424
nextJsRouter: 'pages'
2525
})
26+
27+
// Test the agnostic adapter
28+
29+
testBasicIO({
30+
hook: 'useQueryState',
31+
path: '/app/agnostic/basic-io',
32+
nextJsRouter: 'app',
33+
description: 'Agnostic adapter'
34+
})
35+
36+
testBasicIO({
37+
hook: 'useQueryState',
38+
path: '/pages/agnostic/basic-io',
39+
nextJsRouter: 'pages',
40+
description: 'Agnostic adapter'
41+
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { UseQueryStateBasicIO } from 'e2e-shared/specs/basic-io'
2+
import { Suspense } from 'react'
3+
4+
export default function Page() {
5+
return (
6+
<Suspense>
7+
<UseQueryStateBasicIO />
8+
</Suspense>
9+
)
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { NuqsAdapter } from 'nuqs/adapters/next'
2+
import type { ReactNode } from 'react'
3+
4+
export default function RouterAgnosticLayout({
5+
children
6+
}: {
7+
children: ReactNode
8+
}) {
9+
return <NuqsAdapter>{children}</NuqsAdapter>
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { UseQueryStateBasicIO } from 'e2e-shared/specs/basic-io'
2+
import { NuqsAdapter } from 'nuqs/adapters/next'
3+
4+
export default function Page() {
5+
return (
6+
<NuqsAdapter>
7+
<UseQueryStateBasicIO />
8+
</NuqsAdapter>
9+
)
10+
}

turbo.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"dependsOn": ["^build"]
1010
},
1111
"nuqs#build": {
12-
"outputs": ["dist/**", "size.json", ".tsup"]
12+
"outputs": ["dist/**", "size.json", ".tsup/**", ".tsbuildinfo"]
1313
},
1414
"e2e-next#build": {
1515
"outputs": [".next/**", "!.next/cache/**", "cypress/**"],

0 commit comments

Comments
 (0)