Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
d33bc18b
Commit
d33bc18b
authored
Nov 21, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AppError test
parent
18932201
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
3 deletions
+29
-3
_app.tsx
pages/_app.tsx
+1
-1
_error.tsx
pages/_error.tsx
+1
-1
AppError.pw.tsx
ui/shared/AppError/AppError.pw.tsx
+26
-0
AppError.tsx
ui/shared/AppError/AppError.tsx
+0
-0
AppError.pw.tsx_status-code-404-1.png
...ror/__screenshots__/AppError.pw.tsx_status-code-404-1.png
+0
-0
AppError.pw.tsx_status-code-500-1.png
...ror/__screenshots__/AppError.pw.tsx_status-code-500-1.png
+0
-0
Page.tsx
ui/shared/Page/Page.tsx
+1
-1
No files found.
pages/_app.tsx
View file @
d33bc18b
...
...
@@ -9,7 +9,7 @@ import { Chakra } from 'lib/Chakra';
import
useConfigSentry
from
'
lib/hooks/useConfigSentry
'
;
import
type
{
ErrorType
}
from
'
lib/hooks/useFetch
'
;
import
theme
from
'
theme
'
;
import
AppError
from
'
ui/shared/AppError
'
;
import
AppError
from
'
ui/shared/AppError
/AppError
'
;
import
ErrorBoundary
from
'
ui/shared/ErrorBoundary
'
;
function
MyApp
({
Component
,
pageProps
}:
AppProps
)
{
...
...
pages/_error.tsx
View file @
d33bc18b
...
...
@@ -27,7 +27,7 @@ import * as cookies from 'lib/cookies';
import
getNetworkTitle
from
'
lib/networks/getNetworkTitle
'
;
import
type
{
Props
as
ServerSidePropsCommon
}
from
'
lib/next/getServerSideProps
'
;
import
{
getServerSideProps
as
getServerSidePropsCommon
}
from
'
lib/next/getServerSideProps
'
;
import
AppError
from
'
ui/shared/AppError
'
;
import
AppError
from
'
ui/shared/AppError
/AppError
'
;
import
Page
from
'
ui/shared/Page/Page
'
;
type
Props
=
ServerSidePropsCommon
&
{
...
...
ui/shared/AppError/AppError.pw.tsx
0 → 100644
View file @
d33bc18b
import
{
test
,
expect
}
from
'
@playwright/experimental-ct-react
'
;
import
React
from
'
react
'
;
import
RenderWithChakra
from
'
playwright/RenderWithChakra
'
;
import
AppError
from
'
./AppError
'
;
test
.
use
({
viewport
:
{
width
:
900
,
height
:
400
}
});
test
(
'
status code 404
'
,
async
({
mount
})
=>
{
const
component
=
await
mount
(
<
RenderWithChakra
>
<
AppError
statusCode=
{
404
}
/>
</
RenderWithChakra
>,
);
await
expect
(
component
).
toHaveScreenshot
();
});
test
(
'
status code 500
'
,
async
({
mount
})
=>
{
const
component
=
await
mount
(
<
RenderWithChakra
>
<
AppError
statusCode=
{
500
}
/>
</
RenderWithChakra
>,
);
await
expect
(
component
).
toHaveScreenshot
();
});
ui/shared/AppError.tsx
→
ui/shared/AppError
/AppError
.tsx
View file @
d33bc18b
File moved
ui/shared/AppError/__screenshots__/AppError.pw.tsx_status-code-404-1.png
0 → 100644
View file @
d33bc18b
31.4 KB
ui/shared/AppError/__screenshots__/AppError.pw.tsx_status-code-500-1.png
0 → 100644
View file @
d33bc18b
37.5 KB
ui/shared/Page/Page.tsx
View file @
d33bc18b
...
...
@@ -10,7 +10,7 @@ import useFetch from 'lib/hooks/useFetch';
import
useScrollDirection
from
'
lib/hooks/useScrollDirection
'
;
import
{
SocketProvider
}
from
'
lib/socket/context
'
;
import
ScrollDirectionContext
from
'
ui/ScrollDirectionContext
'
;
import
AppError
from
'
ui/shared/AppError
'
;
import
AppError
from
'
ui/shared/AppError
/AppError
'
;
import
ErrorBoundary
from
'
ui/shared/ErrorBoundary
'
;
import
PageContent
from
'
ui/shared/Page/PageContent
'
;
import
Header
from
'
ui/snippets/header/Header
'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment