Skip to content

Commit

Permalink
feat: add Portfolio route (#6054)
Browse files Browse the repository at this point in the history
# 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.
  • Loading branch information
yhabib authored Dec 20, 2024
1 parent 2ea948b commit 4820dac
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
14 changes: 14 additions & 0 deletions frontend/src/routes/(app)/(nns)/portfolio/+layout.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<script lang="ts">
import Content from "$lib/components/layout/Content.svelte";
import Layout from "$lib/components/layout/Layout.svelte";
import LayoutList from "$lib/components/layout/LayoutList.svelte";
import { i18n } from "$lib/stores/i18n";
</script>

<LayoutList title={$i18n.navigation.portfolio}>
<Layout>
<Content>
<slot />
</Content>
</Layout>
</LayoutList>
2 changes: 2 additions & 0 deletions frontend/src/routes/(app)/(nns)/portfolio/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<script lang="ts">
</script>
19 changes: 19 additions & 0 deletions frontend/src/tests/routes/app/portfolio/layout.spec.ts
Original file line number Diff line number Diff line change
@@ -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",
});
});
});

0 comments on commit 4820dac

Please sign in to comment.