mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix eslint errors
Signed-off-by: Hung-Han (Henry) Chen <1474479+chenhunghan@users.noreply.github.com>
This commit is contained in:
parent
92b928e76f
commit
936de47f28
@ -2,11 +2,11 @@ import React from "react";
|
|||||||
import { render } from "@testing-library/react";
|
import { render } from "@testing-library/react";
|
||||||
import "@testing-library/jest-dom/extend-expect";
|
import "@testing-library/jest-dom/extend-expect";
|
||||||
|
|
||||||
import { BottomBar } from './bottom-bar'
|
import { BottomBar } from "./bottom-bar";
|
||||||
jest.mock("../../../extensions/registries");
|
jest.mock("../../../extensions/registries");
|
||||||
import { statusBarRegistry } from "../../../extensions/registries";
|
import { statusBarRegistry } from "../../../extensions/registries";
|
||||||
|
|
||||||
describe('<BottomBar />', () => {
|
describe("<BottomBar />", () => {
|
||||||
|
|
||||||
it("renders w/o errors", () => {
|
it("renders w/o errors", () => {
|
||||||
const { container } = render(<BottomBar />);
|
const { container } = render(<BottomBar />);
|
||||||
@ -21,13 +21,13 @@ describe('<BottomBar />', () => {
|
|||||||
expect(() => render(<BottomBar />)).not.toThrow();
|
expect(() => render(<BottomBar />)).not.toThrow();
|
||||||
statusBarRegistry.getItems = jest.fn().mockImplementationOnce(() => []);
|
statusBarRegistry.getItems = jest.fn().mockImplementationOnce(() => []);
|
||||||
expect(() => render(<BottomBar />)).not.toThrow();
|
expect(() => render(<BottomBar />)).not.toThrow();
|
||||||
statusBarRegistry.getItems = jest.fn().mockImplementationOnce(() => { return {}});
|
statusBarRegistry.getItems = jest.fn().mockImplementationOnce(() => { return {};});
|
||||||
expect(() => render(<BottomBar />)).not.toThrow();
|
expect(() => render(<BottomBar />)).not.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("renders items [{item: React.ReactNode}] (4.0.0-rc.1)", async () => {
|
it("renders items [{item: React.ReactNode}] (4.0.0-rc.1)", async () => {
|
||||||
const testId = 'testId'
|
const testId = "testId";
|
||||||
const text = 'heee'
|
const text = "heee";
|
||||||
statusBarRegistry.getItems = jest.fn().mockImplementationOnce(() => [
|
statusBarRegistry.getItems = jest.fn().mockImplementationOnce(() => [
|
||||||
{ item: <span data-testid={testId} >{text}</span> }
|
{ item: <span data-testid={testId} >{text}</span> }
|
||||||
]);
|
]);
|
||||||
@ -36,12 +36,12 @@ describe('<BottomBar />', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("renders items [{item: () => React.ReactNode}] (4.0.0-rc.1+)", async () => {
|
it("renders items [{item: () => React.ReactNode}] (4.0.0-rc.1+)", async () => {
|
||||||
const testId = 'testId'
|
const testId = "testId";
|
||||||
const text = 'heee'
|
const text = "heee";
|
||||||
statusBarRegistry.getItems = jest.fn().mockImplementationOnce(() => [
|
statusBarRegistry.getItems = jest.fn().mockImplementationOnce(() => [
|
||||||
{ item: () => <span data-testid={testId} >{text}</span> }
|
{ item: () => <span data-testid={testId} >{text}</span> }
|
||||||
]);
|
]);
|
||||||
const { getByTestId } = render(<BottomBar />);
|
const { getByTestId } = render(<BottomBar />);
|
||||||
expect(await getByTestId(testId)).toHaveTextContent(text);
|
expect(await getByTestId(testId)).toHaveTextContent(text);
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user