-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #158 from OctoFi/v4.3
v4.3 Updates
- Loading branch information
Showing
294 changed files
with
13,324 additions
and
13,682 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
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,40 @@ | ||
import { render, screen } from "@testing-library/react"; | ||
import { render } from "./testing/customRender"; | ||
import App from "./App"; | ||
|
||
test("renders learn react link", () => { | ||
render(<App />); | ||
const linkElement = screen.getByText(/learn react/i); | ||
expect(linkElement).toBeInTheDocument(); | ||
jest.mock("./theme", () => ({ | ||
FixedGlobalStyle: () => "FixedGlobalStyle", | ||
ThemedGlobalStyle: () => "ThemedGlobalStyle", | ||
})); | ||
|
||
jest.mock("./components/RouteChanger/routeChanger", () => () => <div>RouteChanger</div>); | ||
jest.mock("./components/WalletModal", () => () => <div>WalletModal</div>); | ||
jest.mock("./state/lists/updater", () => () => <div>ListsUpdater</div>); | ||
jest.mock("./state/application/updater", () => () => <div>ApplicationUpdater</div>); | ||
jest.mock("./state/multicall/updater", () => () => <div>MultiCallUpdater</div>); | ||
jest.mock("./state/transactions/updater", () => () => <div>TransactionUpdater</div>); | ||
jest.mock("./state/user/updater", () => () => <div>UserUpdater</div>); | ||
jest.mock("./Routes", () => () => <div>Routes</div>); | ||
jest.mock("./components/Web3ReactManager", () => ({ children }) => <div>Web3ReactManager {children}</div>); | ||
jest.mock("./components/TransactionHandler", () => () => <div>TransactionHandler</div>); | ||
|
||
let state = { | ||
initialState: { | ||
user: { | ||
userDarkMode: false, | ||
}, | ||
}, | ||
}; | ||
|
||
test("smoke test light mode", () => { | ||
render(<App />, state); | ||
}); | ||
|
||
test("smoke test dark mode", () => { | ||
state.initialState.user.userDarkMode = true; | ||
render(<App />, state); | ||
}); | ||
|
||
test("requires user state", () => { | ||
state.initialState.user = null; | ||
expect(() => render(<App />, state)).toThrow(); | ||
}); |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.