1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fixing tests

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

View File

@ -41,9 +41,16 @@ jest.mock(
} }
), ),
}, },
app: {
getPath: () => "tmp",
},
}) })
); );
jest.mock("../../+catalog", () => ({
previousActiveTab: jest.fn()
}));
const goBack = jest.fn(); const goBack = jest.fn();
const goForward = jest.fn(); const goForward = jest.fn();
@ -76,6 +83,12 @@ describe("<TopBar/>", () => {
expect(container).toBeInstanceOf(HTMLElement); expect(container).toBeInstanceOf(HTMLElement);
}); });
it("renders home button", async () => {
const { getByTestId } = render(<TopBar/>);
expect(await getByTestId("home-button")).toBeInTheDocument();
});
it("renders history arrows", async () => { it("renders history arrows", async () => {
const { getByTestId } = render(<TopBar/>); const { getByTestId } = render(<TopBar/>);

View File

@ -93,7 +93,7 @@ export const TopBar = observer(({ children, ...rest }: Props) => {
<div className={styles.topBar} {...rest}> <div className={styles.topBar} {...rest}>
<div className={styles.history}> <div className={styles.history}>
<Icon <Icon
data-testid="home-buttton" data-testid="home-button"
material="home" material="home"
className="ml-5" className="ml-5"
onClick={goHome} onClick={goHome}