From 9b2dc45c20b50bd3b2b555ef5824f42bdf188497 Mon Sep 17 00:00:00 2001 From: Kevin Tun Date: Tue, 18 Feb 2025 11:48:53 -0600 Subject: [PATCH] feat(StockCenterInfoDisplay.test.tsx): add unit tests for StockCenterInfoDisplay component This commit adds unit tests for the StockCenterInfoDisplay component. The tests verify that the component renders the mock content text and the heading text correctly. This ensures that the component is working as expected and that the content is being displayed correctly. --- .../__tests__/StockCenterInfoDisplay.test.tsx | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 packages/ui-dsc/src/__tests__/StockCenterInfoDisplay.test.tsx diff --git a/packages/ui-dsc/src/__tests__/StockCenterInfoDisplay.test.tsx b/packages/ui-dsc/src/__tests__/StockCenterInfoDisplay.test.tsx new file mode 100644 index 000000000..e4d127bc8 --- /dev/null +++ b/packages/ui-dsc/src/__tests__/StockCenterInfoDisplay.test.tsx @@ -0,0 +1,26 @@ +import { render, screen } from "@testing-library/react" +import { describe, it, expect } from "vitest" +import { StockCenterInfoDisplay } from "../home/StockCenterInfoDisplay" +import { mockContent, sampleText } from "../mocks/mockContent" + +describe("StockCenterInfoDisplay", () => { + it("renders the mock content text", () => { + render( + , + ) + expect(screen.getByText(sampleText)).toBeInTheDocument() + }) + + it("renders the heading text", () => { + render( + , + ) + expect(screen.getByText("Welcome to Dicty Stock Center (DSC)")).toBeInTheDocument() + }) +})