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:
parent
0047289e8d
commit
68c684dc1c
@ -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/>);
|
||||||
|
|
||||||
|
|||||||
@ -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}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user