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 11import { test , expect } from '@playwright/test'
22
3- test ( 'Hello World! should be rendered' , async ( { page } ) => {
3+ test ( 'gratitext should be rendered' , async ( { page } ) => {
44 await page . goto ( '/' )
55
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 } )
88} )
99
1010test ( 'About should be rendered' , async ( { page } ) => {
Original file line number Diff line number Diff line change 11import { test , expect } from '@playwright/test'
22
3- test ( 'Hello World! should be rendered' , async ( { page } ) => {
3+ test ( 'gratitext should be rendered' , async ( { page } ) => {
44 await page . goto ( '/' )
55
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 } )
88} )
99
1010test ( 'About should be rendered' , async ( { page } ) => {
Original file line number Diff line number Diff line change 11import { test , expect } from '@playwright/test'
22
3- test ( 'Hello World! should be rendered' , async ( { page } ) => {
3+ test ( 'gratitext should be rendered' , async ( { page } ) => {
44 await page . goto ( '/' )
55
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 } )
88} )
99
1010test ( 'About should be rendered' , async ( { page } ) => {
Original file line number Diff line number Diff line change 11import { test , expect } from '@playwright/test'
22
3- test ( 'Hello World! should be rendered' , async ( { page } ) => {
3+ test ( 'gratitext should be rendered' , async ( { page } ) => {
44 await page . goto ( '/' )
55
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 } )
88} )
99
1010test ( 'About should be rendered' , async ( { page } ) => {
Original file line number Diff line number Diff line change 11import { test , expect } from '@playwright/test'
22
3- test ( 'Hello World! should be rendered' , async ( { page } ) => {
3+ test ( 'gratitext should be rendered' , async ( { page } ) => {
44 await page . goto ( '/' )
55
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 } )
88} )
99
1010test ( 'About should be rendered' , async ( { page } ) => {
Original file line number Diff line number Diff line change 11import { test , expect } from '@playwright/test'
22
3- test ( 'Hello World! should be rendered' , async ( { page } ) => {
3+ test ( 'gratitext should be rendered' , async ( { page } ) => {
44 await page . goto ( '/' )
55
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 } )
88} )
99
1010test ( 'About should be rendered' , async ( { page } ) => {
Original file line number Diff line number Diff line change 22 createBrowserRouter ,
33 createRoutesFromElements ,
44 Route ,
5- useRouteError ,
65} from 'react-router'
76import { NotFoundRoute } from './routes/404.tsx'
87import { AppLayout } from './routes/app/layout.tsx'
@@ -15,6 +14,7 @@ import {
1514 RecipientRoute ,
1615} from './routes/app/recipient.tsx'
1716import { RecipientsRoute } from './routes/app/recipients.tsx'
17+ import { UnknownErrorBoundary } from './routes/error-boundary.tsx'
1818import { SignupRoute } from './routes/signup.tsx'
1919
2020export const router = createBrowserRouter (
@@ -38,19 +38,3 @@ export const router = createBrowserRouter(
3838 </ Route > ,
3939 ) ,
4040)
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