Skip to content

Commit

Permalink
Initial not-found page
Browse files Browse the repository at this point in the history
  • Loading branch information
SalamaGofore committed Apr 5, 2024
1 parent 2f5e647 commit 89f044e
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/lib/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface Configuration {

export const configuration: Configuration = {
serviceUrl: process.env.SERVICE_URL || 'http://localhost:3404',
loginUrl: process.env.LOGIN_URL || 'https://virkailija.untuvaopintopolku.fi/cas/login?service=http://localhost:3404/api/login',
loginUrl: process.env.LOGIN_URL || 'https://virkailija.untuvaopintopolku.fi/cas/login?service=http://ataru-virkailija.kehittajan-oma-kone.untuvaopintopolku.fi:3404/api/login',
sessionCookie: process.env.SESSION_COOKIE || 'JSESSIONID',
hautUrl: `${DOMAIN}/kouta-internal/haku/search`,
hakuUrl: `${DOMAIN}/kouta-internal/haku`,
Expand Down
45 changes: 45 additions & 0 deletions src/app/not-found.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { Grid, Button, Typography } from '@mui/material';

export default function Custom404() {
return (
<Grid
container
direction="column"
justifyContent="center"
alignItems="center"
spacing={5}
sx={{textAlign: 'center', paddingTop: '132px', paddingBottom: '132px'}}>
<Grid item>
<Typography variant="h1" component="h1" color="secondary">
404
</Typography>
</Grid>
<Grid item>
<Typography variant="h2" component="h2">
Sivua ei löytynyt
</Typography>
<Typography variant="body1" paragraph>
Linkki on virheellinen tai vanhentunut.
</Typography>
</Grid>
<Grid item>
<Grid
container
direction="row"
justifyContent="center"
alignItems="center"
spacing={2}>
<Grid item>
<Button
variant="contained"
aria-label="Palaa etusivulle"
color="primary"
href="/">
Palaa etusivulle
</Button>
</Grid>
</Grid>
</Grid>
</Grid>
)
}
7 changes: 7 additions & 0 deletions tests/e2e/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@ test('has title', async ({ page }) => {

await expect(page).toHaveTitle(/Valintojen Toteuttaminen/);
});

test('not found page', async ({ page }) => {
await page.goto('http://localhost:3404/mimic-treasure-chest');
await expect(page.locator('h1')).toContainText('404');
await page.locator('a').click();
await expect(page.locator('h1')).toContainText(/Valintojen Toteuttaminen/);
});

0 comments on commit 89f044e

Please sign in to comment.