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

feat: landing page with corresponding tests #32

Merged
merged 3 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
25 changes: 0 additions & 25 deletions frontend/.env.example
ArtemisAaroe marked this conversation as resolved.
Show resolved Hide resolved

This file was deleted.

55 changes: 55 additions & 0 deletions frontend/cypress/e2e/1-getting-started/pages/landingpage.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@

describe('Landing page', () => {
it('should load the landing page successfully', () => {
cy.visit('http://localhost:3000/');
cy.url().should("eq", "http://localhost:3000/")
});
});

describe("Make sure landing page is visitable/ displays data properly", () => {
beforeEach(() => {
cy.visit("http://localhost:3000/")
})

it("test landingpage has navigation bar", () => {
cy.contains("Før Søknad")
cy.contains("Under Søknad")
cy.contains("Mottakskontroll")
})

it("landing page has welcoming paragraph", () => {
cy.get("#welcome-text").should("be.visible")
})

it("landing page has image", () => {
cy.get("#homepage-picture").should("be.visible")
})
});

//todo: update when navbar is made
ArtemisAaroe marked this conversation as resolved.
Show resolved Hide resolved
describe("Make sure navbar on landing page get you to intended target", () => {
beforeEach(() => {
cy.visit("http://localhost:3000/")
})

it("test før søknad", () => {
cy.contains("Før Søknad").click();
cy.url().should("eq", "http://localhost:3000/bygget")
})

it("test under søknad", () => {
cy.contains("Under Søknad").click();
cy.url().should("eq", "http://localhost:3000/soknad")
ArtemisAaroe marked this conversation as resolved.
Show resolved Hide resolved
})

it("test Mottakskontroll", () => {
cy.contains("Mottakskontroll").click();
cy.url().should("eq", "http://localhost:3000/admin")
})
})






143 changes: 0 additions & 143 deletions frontend/cypress/e2e/1-getting-started/todo.cy.js

This file was deleted.

Binary file not shown.
10 changes: 5 additions & 5 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^8.1.0",
"@typescript-eslint/parser": "^8.1.0",
"cypress": "^13.14.2",
"cypress": "^13.15.0",
"eslint": "^8.57.0",
"eslint-config-next": "^14.2.4",
"jest": "^29.7.0",
Expand Down
Binary file added frontend/public/homepagepicture.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 18 additions & 5 deletions frontend/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
import Link from "next/link";
import Image from "next/image";


export default async function Home() {
return (
<main className="flex min-h-screen flex-col items-center justify-center bg-gradient-to-b from-[#2e026d] to-[#15162c] text-white">
<div className="flex flex-row gap-4">
<main className="flex min-h-screen flex-col items-center justify-center bg-white">
{/*
to be removed when navbar is added
ArtemisAaroe marked this conversation as resolved.
Show resolved Hide resolved
*/}
<div className="flex flex-row gap-4 top-0 fixed" >
<Link href={"/bygget"} className="bg-blue-500 rounded-xl p-4">
Grenssesnitt 1 (meld fra om bygging)
Før Søknad
</Link>
<Link href={"/soknad"} className="bg-blue-500 rounded-xl p-4">
Grenssesnitt 2 (søk om byggetillatelse)
Under Søknad
</Link>
<Link href={"/admin"} className="bg-blue-500 rounded-xl p-4">
Grenssesnitt 3 (admin dashboard)
Mottakskontroll
</Link>
</div>

<figure className="xl:flex pl-10 md:pl-40 pr-4 md:pr-16">
<section id="welcome-text">
<h1 className="text-5xl font-bold">KartAI</h1>
<p className="mt-10 text-xl md:text-3xl">Et verktøy for å effektivisere og hjelpe innbyggere med byggesøknadsprossessen ved å ta i bruk kunstig intelligens.</p>
<p className="mt-10 text-xl md:text-3xl mb-10 xl:mb-0">Ved at innbyggere tar i bruk digitale selvbetjeningsløsninger, sparer både kommune og innbyggere tid, ressurser og penger. </p>
</section>
<Image id="homepage-picture" src= "/homepagepicture.jpg" alt="Lanskapsbilde" width={800} height={600} className="rounded-md xl:ml-20" />
</figure>
</main>
);
}
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading