Skip to content

Commit

Permalink
Update Banner.test.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
ailZhou committed Nov 18, 2024
1 parent ac82fcb commit 85b78c8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions services/ui-src/src/components/banners/Banner.test.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { render, screen } from "@testing-library/react";
import {Banner} from "./Banner";
import { Banner } from "./Banner";

const bannerData = {
title: "mock-title",
description: "mock-description"
}
title: "mock-title",
description: "mock-description",
};

describe("Test Banner", () => {
it("Test Banner with no data", () => {
const {container} = render(<Banner bannerData={undefined}></Banner>)
const { container } = render(<Banner bannerData={undefined}></Banner>);
expect(container.childElementCount).toEqual(0);
})
});
it("Test Banner with data", () => {
render(<Banner bannerData={bannerData}></Banner>)
render(<Banner bannerData={bannerData}></Banner>);
expect(screen.getByText(bannerData.title)).toBeInTheDocument();
expect(screen.getByText(bannerData.description)).toBeInTheDocument();
})
})
});
});

0 comments on commit 85b78c8

Please sign in to comment.