-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[frontend] Split AppNavigation from App
- Loading branch information
1 parent
2618e81
commit 10b7e38
Showing
4 changed files
with
83 additions
and
16 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
packages/frontend/__tests__/components/AppNavigation.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { render } from "@testing-library/react"; | ||
import { MemoryRouter } from "react-router-dom"; | ||
|
||
import { AppNavigation } from "../../src/components/AppNavigation"; | ||
|
||
describe("AppNavigation component", () => { | ||
test("should render correctly", () => { | ||
const { container } = render( | ||
<MemoryRouter> | ||
<AppNavigation /> | ||
</MemoryRouter>, | ||
); | ||
expect(container.firstChild).toMatchSnapshot(); | ||
}); | ||
}); |
49 changes: 49 additions & 0 deletions
49
packages/frontend/__tests__/components/__snapshots__/AppNavigation.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`AppNavigation component should render correctly 1`] = ` | ||
.emotion-0 { | ||
list-style: none; | ||
display: -webkit-box; | ||
display: -webkit-flex; | ||
display: -ms-flexbox; | ||
display: flex; | ||
margin-bottom: 24px; | ||
padding: 0 16px; | ||
border-bottom: 1px solid #294885; | ||
} | ||
.emotion-1 { | ||
display: block; | ||
padding: 0.2em 0.8em; | ||
margin-bottom: -1px; | ||
border: 1px solid transparent; | ||
border-radius: 5px 5px 0 0; | ||
} | ||
.emotion-1.active { | ||
border-top: 1px solid #294885; | ||
border-right: 1px solid #294885; | ||
border-left: 1px solid #294885; | ||
background-color: #fff; | ||
} | ||
<nav> | ||
<div | ||
class="emotion-0" | ||
> | ||
<a | ||
aria-current="page" | ||
class="emotion-1 active" | ||
href="/" | ||
> | ||
Poptávky | ||
</a> | ||
<a | ||
class="emotion-1" | ||
href="/projekty" | ||
> | ||
Projekty | ||
</a> | ||
</div> | ||
</nav> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type React from "react"; | ||
|
||
import { Navigation } from "./Navigation"; | ||
|
||
export const AppNavigation = (): React.JSX.Element => ( | ||
<Navigation | ||
items={[ | ||
{ | ||
link: "/", | ||
title: "Poptávky", | ||
}, | ||
{ | ||
link: "/projekty", | ||
title: "Projekty", | ||
}, | ||
]} | ||
/> | ||
); |