From 776b15a3dcb5ebdc6605968ec1b68760457cc6f7 Mon Sep 17 00:00:00 2001 From: Hakan Orak Date: Tue, 14 Jan 2025 14:22:33 +0100 Subject: [PATCH] test(SelectInput): add test for SelectInput component --- .../Select/__tests__/SelectInput.test.tsx | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 slash/react/src/Form/Select/__tests__/SelectInput.test.tsx diff --git a/slash/react/src/Form/Select/__tests__/SelectInput.test.tsx b/slash/react/src/Form/Select/__tests__/SelectInput.test.tsx new file mode 100644 index 000000000..e9f66d81a --- /dev/null +++ b/slash/react/src/Form/Select/__tests__/SelectInput.test.tsx @@ -0,0 +1,44 @@ +import { render, screen } from "@testing-library/react"; +import { axe } from "jest-axe"; +import { SelectInput } from "../SelectInput"; + +const options = [ + { value: "fun", label: "For fun" }, + { value: "work", label: "For work" }, + { value: "drink", label: "For drink" }, +]; + +describe("SelectInput", () => { + it("should have label", () => { + // Act + render( + , + ); + + // Assert + const labelSelectInput = screen.getByRole("combobox", { + name: "label select input", + }); + expect(labelSelectInput).toHaveClass("af-form__input-select"); + }); + + it("shouldn't have an accessibility violation