shoc-frontend-new/src/test/lib/mui-theme.test.tsx

19 lines
658 B
TypeScript
Raw Normal View History

import { Alert, ThemeProvider } from "@mui/material";
import { render, screen } from "@testing-library/react";
import { describe, expect, it } from "vitest";
import { muiTheme } from "@/lib/theme/mui-theme";
describe("MUI theme variants", () => {
it("applies the custom success palette when Alert uses severity", () => {
render(
<ThemeProvider theme={muiTheme}>
<Alert severity="success">Saved</Alert>
</ThemeProvider>,
);
const alert = screen.getByRole("alert");
expect(getComputedStyle(alert).backgroundColor).toBe("rgb(240, 253, 244)");
expect(getComputedStyle(alert).color).toBe("rgb(22, 101, 52)");
});
});