Skip to content

Commit

Permalink
feat: minor corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
Anais-71 committed Jul 15, 2024
1 parent a2a955c commit 8a8fe3a
Show file tree
Hide file tree
Showing 14 changed files with 138 additions and 18,933 deletions.
18,281 changes: 0 additions & 18,281 deletions package-lock.json

This file was deleted.

10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
"name": "kasa",
"version": "0.1.0",
"private": true,
"proxy": "http://localhost:3000",
"dependencies": {
"@testing-library/dom": "^10.3.0",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/react": "^16.0.0",
"@testing-library/user-event": "^13.5.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.2.1",
"react-router-dom": "^6.24.1",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
Expand All @@ -34,5 +38,9 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.x",
"jest-fetch-mock": "^3.0.3"
}
}
File renamed without changes
6 changes: 5 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<head>
<meta charset="utf-8" />
<!-- <link rel="icon" href="../src/assets/favicon.svg" /> -->
<link rel="icon" href="./favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="Web site created using create-react-app" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
Expand All @@ -13,6 +13,10 @@
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap"
rel="stylesheet">

<!-- Font Awesome -->
<script src="https://kit.fontawesome.com/3dd7fc5378.js" crossorigin="anonymous"></script>

<title>Kasa</title>
</head>

Expand Down
6 changes: 5 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import Footer from './components/footer/Footer'
import Error from './components/error/Error'

//Pages
import Home from './pages/Home';
import Home from './pages/home/Home';
import About from './pages/about/About';
import Housing from './pages/housing/Housing';

function App() {
return (
Expand All @@ -17,6 +19,8 @@ function App() {
<Header />
<Routes>
<Route path='/' element={<Home />} />
<Route path='/about' element={<About />} />
<Route path='/logement/:id' element={<Housing />} />
<Route path='*' element={<Error />} />
</Routes>
<Footer />
Expand Down
17 changes: 17 additions & 0 deletions src/components/card/__snapshots__/card.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Given I am on the home page The card matches the snapshot 1`] = `
<DocumentFragment>
<div
class="lodges"
/>
</DocumentFragment>
`;

exports[`Given I am on the home page The dropdown page matches the snapshot 1`] = `
<DocumentFragment>
<div
class="lodges"
/>
</DocumentFragment>
`;
22 changes: 10 additions & 12 deletions src/components/card/card.test.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
import { render, screen } from '@testing-library/react';
import Footer from './Footer';
import { render, fireEvent } from '@testing-library/react';
import Card from './Card';

describe('Given I am on the home page', () => {
beforeEach(() => {
render(<Card />);
});
const title = 'Test title';
const cover = ['https://s3-eu-west-1.amazonaws.com/course.oc-static.com/projects/front-end-kasa-project/accommodation-20-1.jpg'];

test('When the card component is being displayed, Then the cover image should be present', () => {
const cover = screen.getByAltText('image de la carte');
expect(cover).toBeInTheDocument();
test('When the card component is being displayed, Then the title should be present', () => {
const { getByText } = render(<Card title={title} />);
expect(getByText(title)).toBeInTheDocument();
});

test('When the card component is being displayed, Then the title should be present', () => {
const title = screen.getByTestId('title');
expect(title).toBeInTheDocument();
test('When the card component is being displayed, Then the cover image should be present', () => {
const { getByText } = render(<Card cover={cover} />);
expect(getByText(cover)).toBeInTheDocument();
});

test('The card matches the snapshot', () => {
test('The dropdown page matches the snapshot', () => {
const { asFragment } = render(<Card />);
expect(asFragment()).toMatchSnapshot();
});
Expand Down
Loading

0 comments on commit 8a8fe3a

Please sign in to comment.