Skip to content

Commit

Permalink
Merge pull request #6 from techswitch-learners/mm.007-create-a-footer
Browse files Browse the repository at this point in the history
Mm.007 create a footer
  • Loading branch information
sun-amy authored Jul 31, 2024
2 parents 7457512 + 81dfc3d commit 787bd94
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import "@testing-library/jest-dom";
// remove this test when real tests are added
test('renders header', () => {
render(<App />);
const header = screen.getByText(/MarsioKart/i);
expect(header).toBeInTheDocument();
const header = screen.getAllByText(/MarsioKart/i);
expect(header[0]).toBeInTheDocument();
});
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {BrowserRouter as Router, Routes, Route} from 'react-router-dom';
import './App.scss';
import Home from './Home/Home';
import { Quiz } from './Quiz/Quiz';
import Footer from './Footer/Footer';

function App() {
return (
Expand All @@ -15,6 +16,7 @@ function App() {
<Route path='/quiz'
element={<Quiz/>}/>
</Routes>
<Footer/>
</Router>
</div>
);
Expand Down
9 changes: 9 additions & 0 deletions src/Footer/Footer.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { render, screen } from '@testing-library/react';
import Footer from './Footer';
import "@testing-library/jest-dom";

test('renders footer', () => {
render(<Footer/>);
const footer = screen.getByText(/NASA/i);
expect(footer).toBeInTheDocument();
});
9 changes: 9 additions & 0 deletions src/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default function Footer() {

return (
<footer>
MarsioKart &copy; 2024.
All images sourced from <a href="https://api.nasa.gov/">NASA</a>.
</footer>
)
}

0 comments on commit 787bd94

Please sign in to comment.