Skip to content

Commit

Permalink
Add new contact page.
Browse files Browse the repository at this point in the history
Add test for new contact page.
  • Loading branch information
sceiler committed Sep 15, 2023
1 parent b6db651 commit fcbc255
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
18 changes: 18 additions & 0 deletions e2e/test/specs/test.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,24 @@ describe('Guestbook application', () => {
expect(paragraphText).toBe('This is a guestbook.');
});

it('should have a contact us page with header and paragraph', async () => {
await browser.url(baseUrl + '/contact')

let browserTitle = '';
await browser.getTitle().then((title) => {
browserTitle = title;
});

const aboutUsHeader = await $('#about-us');
const aboutUsParagraph = await $('#about-us-paragraph');
const headerText = await aboutUsHeader.getText();
const paragraphText = await aboutUsParagraph.getText();

await expect(browserTitle === 'Contact us').toBe(true);
expect(headerText).toBe('Contact us');
expect(paragraphText).toBe('This is how to contact us: my-email@gmail.com');
});

it.skip('should redirect non-authenticated user to GitHub SSO ', async () => {
const MAX_ATTEMPTS = 20;
const RETRY_INTERVAL = 2000; // Retry every 2 seconds
Expand Down
16 changes: 16 additions & 0 deletions src/app/contact/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {Metadata} from "next";

export const metadata: Metadata = {
title: "Contact us",
description: "This is how to contact us: my-email@gmail.com",
};

export default async function Contact() {
return (
<main>
<h1 data-testid={'contact-us'} id={'contact-us'} className="mx-1 text-xl">About us</h1>
<p data-testid={'contact-us-paragraph'} id={'contact-us-paragraph'} className="mx-1">This is how to contact
us: my-email@gmail.com</p>
</main>
)
}

0 comments on commit fcbc255

Please sign in to comment.