mirror of
https://github.com/gethomepage/homepage.git
synced 2026-02-07 16:30:52 +08:00
21 lines
737 B
JavaScript
21 lines
737 B
JavaScript
// @vitest-environment jsdom
|
|
|
|
import { screen } from "@testing-library/react";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
import { renderWithProviders } from "test-utils/render-with-providers";
|
|
|
|
import Greeting from "./greeting";
|
|
|
|
describe("components/widgets/greeting", () => {
|
|
it("renders nothing when text is not configured", () => {
|
|
const { container } = renderWithProviders(<Greeting options={{}} />, { settings: { target: "_self" } });
|
|
expect(container).toBeEmptyDOMElement();
|
|
});
|
|
|
|
it("renders configured greeting text", () => {
|
|
renderWithProviders(<Greeting options={{ text: "Hello there" }} />, { settings: { target: "_self" } });
|
|
expect(screen.getByText("Hello there")).toBeInTheDocument();
|
|
});
|
|
});
|