Fixing tests

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev committed 2021-09-06 14:36:24 +03:00
1 parent 0047289e8d
commit 68c684dc1c
2 files changed
+14 -1

No files matched your search

@@ -41,9 +41,16 @@ jest.mock(
}
),
},
app: {
getPath: () => "tmp",
},
})
);
jest.mock("../../+catalog", () => ({
previousActiveTab: jest.fn()
}));
const goBack = jest.fn();
const goForward = jest.fn();
@@ -76,6 +83,12 @@ describe("<TopBar/>", () => {
expect(container).toBeInstanceOf(HTMLElement);
});
it("renders home button", async () => {
const { getByTestId } = render(<TopBar/>);
expect(await getByTestId("home-button")).toBeInTheDocument();
});
it("renders history arrows", async () => {
const { getByTestId } = render(<TopBar/>);
+1 -1
View File
@@ -93,7 +93,7 @@ export const TopBar = observer(({ children, ...rest }: Props) => {
<div className={styles.topBar} {...rest}>
<div className={styles.history}>
<Icon
data-testid="home-buttton"
data-testid="home-button"
material="home"
className="ml-5"
onClick={goHome}