-
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.
Update frontend and backend ci (#17)
* Update frontend and backend ci * Fix import issue * Fix import paths to include js extension * Fix import path of reportWebVitals * Use babel with jest * Config jest for es modules * Downgrade axios * Update app.test * Update tests * Revert "Config jest for es modules" This reverts commit 5316ede. * Revert "Use babel with jest" This reverts commit d3a95cb.
- Loading branch information
Showing
8 changed files
with
54 additions
and
37 deletions.
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,8 +1,31 @@ | ||
import { render, screen } from '@testing-library/react'; | ||
import App from './App'; | ||
import React from "react"; | ||
import { render, screen } from "@testing-library/react"; | ||
import { MemoryRouter, Route, Routes } from "react-router-dom"; | ||
import SenderPage from "./components/SenderPage"; | ||
import ReceiverPage from "./components/ReceiverPage"; | ||
|
||
test('renders learn react link', () => { | ||
render(<App />); | ||
const linkElement = screen.getByText(/learn react/i); | ||
expect(linkElement).toBeInTheDocument(); | ||
describe("App Navigation", () => { | ||
test("renders SenderPage when navigating to '/'", () => { | ||
render( | ||
<MemoryRouter initialEntries={["/"]}> | ||
<Routes> | ||
<Route path="/" element={<SenderPage />} /> | ||
</Routes> | ||
</MemoryRouter> | ||
); | ||
const senderHeading = screen.getByText(/Sender Page/i); | ||
expect(senderHeading).toBeInTheDocument(); | ||
}); | ||
|
||
test("renders ReceiverPage when navigating to '/receiver'", () => { | ||
render( | ||
<MemoryRouter initialEntries={["/receiver"]}> | ||
<Routes> | ||
<Route path="/receiver" element={<ReceiverPage />} /> | ||
</Routes> | ||
</MemoryRouter> | ||
); | ||
const receiverHeading = screen.getByText(/Receiver Page/i); | ||
expect(receiverHeading).toBeInTheDocument(); | ||
}); | ||
}); |
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