Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 e2e tests #1111

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions cypress/integration/tests/500.cy.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
describe('Custom 500 page should', () => {
before(() => {
cy.cleanUpTestState();
});

beforeEach(() => {
cy.visit('/500', { failOnStatusCode: false });
});

it('Should display', () => {
cy.checkImage(
`Illustration of a person's face and shoulders, with big leaves and flowers blooming above them`,
'illustration_bloom_head',
);
cy.get('h1').contains('500 - Internal error');
cy.get('p').contains(
'Hmm, something went wrong there. Please go back and try again. Get in touch via the contact form if the error continues.',
);
});

it('Should be redirected to courses when clicking Back to welcome page', () => {
const buttonText = 'Back to welcome page';
cy.checkLink('/login', buttonText);
cy.get('a').contains(buttonText).click();
cy.checkPageUrl('courses');
});
});
2 changes: 1 addition & 1 deletion pages/500.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const Custom500: NextPage = () => {
<title>{t('500.title')}</title>
</Head>
<Box sx={imageContainerStyle}>
<Image alt={t('alt.bloomLogo')} src={bloomHead} fill sizes="100vw" />
<Image alt={t('alt.bloomHead')} src={bloomHead} fill sizes="100vw" />
</Box>
<Typography variant="h1" component="h1">
{t('500.title')}
Expand Down
Loading