diff --git a/backend/.oxlintrc.json b/backend/.oxlintrc.json index a5e663c35482..10e1703b16a0 100644 --- a/backend/.oxlintrc.json +++ b/backend/.oxlintrc.json @@ -3,5 +3,13 @@ "extends": [ "../packages/oxlint-config/index.jsonc" // "@monkeytype/oxlint-config" + ], + "overrides": [ + { + "files": ["src/**/*.ts"], + "rules": { + "import/no-cycle": "off" //todo: fix cycles and turn this on + } + } ] } diff --git a/frontend/__tests__/components/AnimatedModal.spec.tsx b/frontend/__tests__/components/AnimatedModal.spec.tsx index 1c10d9f573fe..4ca8e8870eea 100644 --- a/frontend/__tests__/components/AnimatedModal.spec.tsx +++ b/frontend/__tests__/components/AnimatedModal.spec.tsx @@ -13,8 +13,6 @@ describe("AnimatedModal", () => { }); function renderModal(props: { - isOpen: boolean; - onClose: () => void; onEscape?: (e: KeyboardEvent) => void; onBackdropClick?: (e: MouseEvent) => void; class?: string; @@ -29,7 +27,7 @@ describe("AnimatedModal", () => { modalDiv: HTMLDivElement; } { const { container } = render(() => ( - +
Test Content
)); @@ -45,14 +43,14 @@ describe("AnimatedModal", () => { } it("renders dialog with correct id and class", () => { - const { dialog } = renderModal({ isOpen: false, onClose: vi.fn() }); + const { dialog } = renderModal({}); - expect(dialog).toHaveAttribute("id", "TestModal"); + expect(dialog).toHaveAttribute("id", "SupportModal"); expect(dialog).toHaveClass("modalWrapper", "hidden"); }); it("renders children inside modal div", () => { - const { modalDiv } = renderModal({ isOpen: false, onClose: vi.fn() }); + const { modalDiv } = renderModal({}); expect( modalDiv.querySelector("[data-testid='modal-content']"), @@ -60,25 +58,19 @@ describe("AnimatedModal", () => { }); it("has escape handler attached", () => { - const onClose = vi.fn(); - - const { dialog } = renderModal({ isOpen: true, onClose }); + const { dialog } = renderModal({}); expect(dialog.onkeydown).toBeDefined(); }); it("has backdrop click handler attached", () => { - const onClose = vi.fn(); - - const { dialog } = renderModal({ isOpen: true, onClose }); + const { dialog } = renderModal({}); expect(dialog.onmousedown).toBeDefined(); }); it("applies custom class to dialog", () => { const { dialog } = renderModal({ - isOpen: false, - onClose: vi.fn(), class: "customClass", }); @@ -87,11 +79,9 @@ describe("AnimatedModal", () => { it("renders with animationMode none", () => { const { dialog } = renderModal({ - isOpen: false, - onClose: vi.fn(), animationMode: "none", }); - expect(dialog).toHaveAttribute("id", "TestModal"); + expect(dialog).toHaveAttribute("id", "SupportModal"); }); }); diff --git a/frontend/__tests__/components/Button.spec.tsx b/frontend/__tests__/components/Button.spec.tsx new file mode 100644 index 000000000000..5f68eb9145d2 --- /dev/null +++ b/frontend/__tests__/components/Button.spec.tsx @@ -0,0 +1,167 @@ +import { describe, it, expect, vi, afterEach } from "vitest"; +import { render, cleanup } from "@solidjs/testing-library"; +import { Button } from "../../src/ts/components/Button"; + +describe("Button component", () => { + afterEach(() => { + cleanup(); + }); + + it("renders a button element when onClick is provided", () => { + const onClick = vi.fn(); + + const { container } = render(() => ( + + )); + + const child = container.querySelector('[data-testid="child"]'); + expect(child).toBeTruthy(); + expect(child?.textContent).toBe("Child"); + }); +}); diff --git a/frontend/src/html/footer.html b/frontend/src/html/footer.html deleted file mode 100644 index 4d2f7db9d711..000000000000 --- a/frontend/src/html/footer.html +++ /dev/null @@ -1,86 +0,0 @@ - diff --git a/frontend/src/html/popups.html b/frontend/src/html/popups.html index 29378eb83de2..f67aa61a004f 100644 --- a/frontend/src/html/popups.html +++ b/frontend/src/html/popups.html @@ -1,4 +1,4 @@ - + - - -