Testing Framwork #17

Merged
an.di merged 83 commits from adilallo/enhancement/TestingFramework2 into main 2025-09-03 18:50:40 +00:00
2 changed files with 11 additions and 3 deletions
Showing only changes of commit e44d7c1b92 - Show all commits
+6 -2
View File
@@ -246,13 +246,17 @@ describe("Footer", () => {
const emailLinks = screen.getAllByRole("link", {
name: "medlab@colorado.edu",
});
const blueskyLink = screen.getByRole("link", {
const blueskyLinks = screen.getAllByRole("link", {
name: "Follow us on Bluesky",
});
const gitlabLink = screen.getByRole("link", {
const gitlabLinks = screen.getAllByRole("link", {
name: "Follow us on GitLab",
});
// Use the first instance of each social media link
const blueskyLink = blueskyLinks[0];
const gitlabLink = gitlabLinks[0];
// Check email links (multiple due to responsive design)
emailLinks.forEach((emailLink) => {
expect(emailLink).toHaveClass("focus:outline-none");
+5 -1
View File
@@ -1,10 +1,14 @@
import "@testing-library/jest-dom/vitest";
import { afterAll, afterEach, beforeAll } from "vitest";
import { cleanup } from "@testing-library/react";
import { server } from "./tests/msw/server";
// expose Tailwind tokens to JSDOM (for design token checks)
import "./app/tailwind.css";
// MSW for API integration tests (mock fetch)
beforeAll(() => server.listen({ onUnhandledRequest: "bypass" }));
afterEach(() => server.resetHandlers());
afterEach(() => {
server.resetHandlers();
cleanup(); // Clean up React DOM after each test
});
afterAll(() => server.close());