From 4820dacc0b118e180ccfb7fe6c0b08121799f4ec Mon Sep 17 00:00:00 2001 From: Yusef Habib Date: Fri, 20 Dec 2024 07:48:03 +0100 Subject: [PATCH] feat: add Portfolio route (#6054) # Motivation We need a new route to display the Portfolio page. # Changes - Creates a new route in the (nns) group for the portfolio page. # Tests - Unit test that the page renders with the appropriate title. # Todos - [ ] Add entry to changelog (if necessary). Not necessary. --- .../(app)/(nns)/portfolio/+layout.svelte | 14 ++++++++++++++ .../routes/(app)/(nns)/portfolio/+page.svelte | 2 ++ .../tests/routes/app/portfolio/layout.spec.ts | 19 +++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 frontend/src/routes/(app)/(nns)/portfolio/+layout.svelte create mode 100644 frontend/src/routes/(app)/(nns)/portfolio/+page.svelte create mode 100644 frontend/src/tests/routes/app/portfolio/layout.spec.ts diff --git a/frontend/src/routes/(app)/(nns)/portfolio/+layout.svelte b/frontend/src/routes/(app)/(nns)/portfolio/+layout.svelte new file mode 100644 index 00000000000..b9015b3b6e6 --- /dev/null +++ b/frontend/src/routes/(app)/(nns)/portfolio/+layout.svelte @@ -0,0 +1,14 @@ + + + + + + + + + diff --git a/frontend/src/routes/(app)/(nns)/portfolio/+page.svelte b/frontend/src/routes/(app)/(nns)/portfolio/+page.svelte new file mode 100644 index 00000000000..0fbba997890 --- /dev/null +++ b/frontend/src/routes/(app)/(nns)/portfolio/+page.svelte @@ -0,0 +1,2 @@ + diff --git a/frontend/src/tests/routes/app/portfolio/layout.spec.ts b/frontend/src/tests/routes/app/portfolio/layout.spec.ts new file mode 100644 index 00000000000..e21717e8892 --- /dev/null +++ b/frontend/src/tests/routes/app/portfolio/layout.spec.ts @@ -0,0 +1,19 @@ +import { layoutTitleStore } from "$lib/stores/layout.store"; +import PortfolioLayout from "$routes/(app)/(nns)/portfolio/+layout.svelte"; +import { render } from "@testing-library/svelte"; +import { get } from "svelte/store"; + +describe("Portfolio layout", () => { + beforeEach(() => { + layoutTitleStore.set({ title: "" }); + }); + + it("should set title and header layout to 'Portfolio'", () => { + render(PortfolioLayout); + + expect(get(layoutTitleStore)).toEqual({ + title: "Portfolio", + header: "Portfolio", + }); + }); +});