Skip to content

Commit

Permalink
Merge pull request #1600 from skaut/frontend-eslint-v9
Browse files Browse the repository at this point in the history
[frontend] Updated eslint to v9
  • Loading branch information
marekdedic authored Sep 2, 2024
2 parents 11614db + 4a2391c commit 59264c6
Show file tree
Hide file tree
Showing 37 changed files with 3,833 additions and 2,645 deletions.
233 changes: 0 additions & 233 deletions packages/frontend/.eslintrc.json

This file was deleted.

20 changes: 10 additions & 10 deletions packages/frontend/__tests__/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ describe("App", () => {
mocked(swr).default.mockReturnValue({
data: testData,
error: undefined,
mutate: jest.fn(),
isValidating: false,
isLoading: false,
isValidating: false,
mutate: jest.fn(),
});
const { container } = render(
<MemoryRouter>
Expand All @@ -33,9 +33,9 @@ describe("App", () => {
mocked(swr).default.mockReturnValue({
data: testData,
error: undefined,
mutate: jest.fn(),
isValidating: false,
isLoading: false,
isValidating: false,
mutate: jest.fn(),
});
const { container } = render(
<MemoryRouter initialEntries={["/projekty"]}>
Expand All @@ -49,9 +49,9 @@ describe("App", () => {
mocked(swr).default.mockReturnValue({
data: testData,
error: undefined,
mutate: jest.fn(),
isValidating: false,
isLoading: false,
isValidating: false,
mutate: jest.fn(),
});
const { container } = render(
<MemoryRouter initialEntries={["/skaut/skaut-google-drive-gallery"]}>
Expand All @@ -65,9 +65,9 @@ describe("App", () => {
mocked(swr).default.mockReturnValue({
data: testData,
error: undefined,
mutate: jest.fn(),
isValidating: false,
isLoading: false,
isValidating: false,
mutate: jest.fn(),
});
const { container } = render(
<MemoryRouter initialEntries={["/skaut/skaut-google-drive-gallery/3"]}>
Expand All @@ -81,9 +81,9 @@ describe("App", () => {
mocked(swr).default.mockReturnValue({
data: undefined,
error: true,
mutate: jest.fn(),
isValidating: false,
isLoading: false,
isValidating: false,
mutate: jest.fn(),
});
const { container } = render(
<MemoryRouter>
Expand Down
15 changes: 15 additions & 0 deletions packages/frontend/__tests__/components/AppNavigation.test.tsx
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();
});
});
10 changes: 5 additions & 5 deletions packages/frontend/__tests__/components/Navigation.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ describe("Navigation component", () => {
<Navigation
items={[
{
title: "Poptávky",
link: "/",
title: "Poptávky",
},
{
title: "Projekty",
link: "/projekty",
title: "Projekty",
},
]}
/>
Expand All @@ -29,13 +29,13 @@ describe("Navigation component", () => {
<Navigation
items={[
{
title: "Poptávky",
link: "/",
title: "Poptávky",
},
{
title: "Projekty",
link: "/projekty",
isActive: true,
link: "/projekty",
title: "Projekty",
},
]}
/>
Expand Down
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>
`;
Loading

0 comments on commit 59264c6

Please sign in to comment.