File tree Expand file tree Collapse file tree 8 files changed +36
-35
lines changed
03.problem.custom-link/tests
03.solution.custom-link/tests
99.final/01.solution.final/src Expand file tree Collapse file tree 8 files changed +36
-35
lines changed Original file line number Diff line number Diff line change 1
1
import { test , expect } from '@playwright/test'
2
2
3
- test ( 'Hello World! should be rendered' , async ( { page } ) => {
3
+ test ( 'gratitext should be rendered' , async ( { page } ) => {
4
4
await page . goto ( '/' )
5
5
6
- const helloWorld = page . getByText ( / h e l l o w o r l d / i )
7
- await expect ( helloWorld ) . toBeVisible ( { timeout : 500 } )
6
+ const gratitext = page . getByRole ( 'banner' ) . getByText ( / g r a t i t e x t / )
7
+ await expect ( gratitext ) . toBeVisible ( { timeout : 500 } )
8
8
} )
9
9
10
10
test ( 'About should be rendered' , async ( { page } ) => {
Original file line number Diff line number Diff line change 1
1
import { test , expect } from '@playwright/test'
2
2
3
- test ( 'Hello World! should be rendered' , async ( { page } ) => {
3
+ test ( 'gratitext should be rendered' , async ( { page } ) => {
4
4
await page . goto ( '/' )
5
5
6
- const helloWorld = page . getByText ( / h e l l o w o r l d / i )
7
- await expect ( helloWorld ) . toBeVisible ( { timeout : 500 } )
6
+ const gratitext = page . getByRole ( 'banner' ) . getByText ( / g r a t i t e x t / )
7
+ await expect ( gratitext ) . toBeVisible ( { timeout : 500 } )
8
8
} )
9
9
10
10
test ( 'About should be rendered' , async ( { page } ) => {
Original file line number Diff line number Diff line change 1
1
import { test , expect } from '@playwright/test'
2
2
3
- test ( 'Hello World! should be rendered' , async ( { page } ) => {
3
+ test ( 'gratitext should be rendered' , async ( { page } ) => {
4
4
await page . goto ( '/' )
5
5
6
- const helloWorld = page . getByText ( / h e l l o w o r l d / i )
7
- await expect ( helloWorld ) . toBeVisible ( { timeout : 500 } )
6
+ const gratitext = page . getByRole ( 'banner' ) . getByText ( / g r a t i t e x t / )
7
+ await expect ( gratitext ) . toBeVisible ( { timeout : 500 } )
8
8
} )
9
9
10
10
test ( 'About should be rendered' , async ( { page } ) => {
Original file line number Diff line number Diff line change 1
1
import { test , expect } from '@playwright/test'
2
2
3
- test ( 'Hello World! should be rendered' , async ( { page } ) => {
3
+ test ( 'gratitext should be rendered' , async ( { page } ) => {
4
4
await page . goto ( '/' )
5
5
6
- const helloWorld = page . getByText ( / h e l l o w o r l d / i )
7
- await expect ( helloWorld ) . toBeVisible ( { timeout : 500 } )
6
+ const gratitext = page . getByRole ( 'banner' ) . getByText ( / g r a t i t e x t / )
7
+ await expect ( gratitext ) . toBeVisible ( { timeout : 500 } )
8
8
} )
9
9
10
10
test ( 'About should be rendered' , async ( { page } ) => {
Original file line number Diff line number Diff line change 1
1
import { test , expect } from '@playwright/test'
2
2
3
- test ( 'Hello World! should be rendered' , async ( { page } ) => {
3
+ test ( 'gratitext should be rendered' , async ( { page } ) => {
4
4
await page . goto ( '/' )
5
5
6
- const helloWorld = page . getByText ( / h e l l o w o r l d / i )
7
- await expect ( helloWorld ) . toBeVisible ( { timeout : 500 } )
6
+ const gratitext = page . getByRole ( 'banner' ) . getByText ( / g r a t i t e x t / )
7
+ await expect ( gratitext ) . toBeVisible ( { timeout : 500 } )
8
8
} )
9
9
10
10
test ( 'About should be rendered' , async ( { page } ) => {
Original file line number Diff line number Diff line change 1
1
import { test , expect } from '@playwright/test'
2
2
3
- test ( 'Hello World! should be rendered' , async ( { page } ) => {
3
+ test ( 'gratitext should be rendered' , async ( { page } ) => {
4
4
await page . goto ( '/' )
5
5
6
- const helloWorld = page . getByText ( / h e l l o w o r l d / i )
7
- await expect ( helloWorld ) . toBeVisible ( { timeout : 500 } )
6
+ const gratitext = page . getByRole ( 'banner' ) . getByText ( / g r a t i t e x t / )
7
+ await expect ( gratitext ) . toBeVisible ( { timeout : 500 } )
8
8
} )
9
9
10
10
test ( 'About should be rendered' , async ( { page } ) => {
Original file line number Diff line number Diff line change 2
2
createBrowserRouter ,
3
3
createRoutesFromElements ,
4
4
Route ,
5
- useRouteError ,
6
5
} from 'react-router'
7
6
import { NotFoundRoute } from './routes/404.tsx'
8
7
import { AppLayout } from './routes/app/layout.tsx'
@@ -15,6 +14,7 @@ import {
15
14
RecipientRoute ,
16
15
} from './routes/app/recipient.tsx'
17
16
import { RecipientsRoute } from './routes/app/recipients.tsx'
17
+ import { UnknownErrorBoundary } from './routes/error-boundary.tsx'
18
18
import { SignupRoute } from './routes/signup.tsx'
19
19
20
20
export const router = createBrowserRouter (
@@ -38,19 +38,3 @@ export const router = createBrowserRouter(
38
38
</ Route > ,
39
39
) ,
40
40
)
41
-
42
- function UnknownErrorBoundary ( ) {
43
- const error = useRouteError ( )
44
-
45
- return (
46
- < div className = "bg-danger-background text-danger-foreground mt-20 flex h-full flex-col items-center justify-center px-8 py-12" >
47
- < h1 className = "text-2xl font-bold" > Unknown error</ h1 >
48
- < p className = "text-danger-foreground/80 text-sm" >
49
- An unknown error occurred. Please try again later.
50
- </ p >
51
- < pre className = "text-danger-foreground/80 bg-danger-foreground/10 mt-4 max-h-[50vh] overflow-auto rounded-lg p-4 text-sm break-all whitespace-break-spaces" >
52
- { error instanceof Error ? error . message : 'Unknown error' }
53
- </ pre >
54
- </ div >
55
- )
56
- }
Original file line number Diff line number Diff line change
1
+ import { useRouteError } from 'react-router'
2
+
3
+ export function UnknownErrorBoundary ( ) {
4
+ const error = useRouteError ( )
5
+
6
+ return (
7
+ < div className = "bg-danger-background text-danger-foreground mt-20 flex h-full flex-col items-center justify-center px-8 py-12" >
8
+ < h1 className = "text-2xl font-bold" > Unknown error</ h1 >
9
+ < p className = "text-danger-foreground/80 text-sm" >
10
+ An unknown error occurred. Please try again later.
11
+ </ p >
12
+ < pre className = "text-danger-foreground/80 bg-danger-foreground/10 mt-4 max-h-[50vh] overflow-auto rounded-lg p-4 text-sm break-all whitespace-break-spaces" >
13
+ { error instanceof Error ? error . message : 'Unknown error' }
14
+ </ pre >
15
+ </ div >
16
+ )
17
+ }
You can’t perform that action at this time.
0 commit comments