feat: Add additional example legislation

This commit is contained in:
Adrian Rumpold
2025-05-20 12:07:58 +02:00
parent 56d271d0df
commit debaf567ea
2 changed files with 11 additions and 1 deletions

View File

@@ -12,7 +12,13 @@ describe("CelexSelector", () => {
expect(getByLabelText("Select example:")).toBeInTheDocument(); expect(getByLabelText("Select example:")).toBeInTheDocument();
expect(getByRole("combobox")).toBeInTheDocument(); expect(getByRole("combobox")).toBeInTheDocument();
const options = getAllByRole("option"); const [def, ...options] = getAllByRole("option");
// First option is the disabled placeholder option
expect(def).toHaveValue("");
expect(def).toHaveTextContent("Select an example");
expect(def).toBeDisabled();
expect(options).toHaveLength(examples.length); expect(options).toHaveLength(examples.length);
for (const i in examples) { for (const i in examples) {
expect(options[i]).toHaveValue(examples[i].id); expect(options[i]).toHaveValue(examples[i].id);

View File

@@ -1,5 +1,9 @@
export const examples = [ export const examples = [
{ name: "GDPR", id: "32016R0679" }, { name: "GDPR", id: "32016R0679" },
{ name: "AI Act", id: "32024R1689" }, { name: "AI Act", id: "32024R1689" },
{ name: "Cybersecurity Act", id: "32019R0881" },
{ name: "Cyber Resilience Act", id: "32024R2847" }, { name: "Cyber Resilience Act", id: "32024R2847" },
{ name: "Medical Device Regulation", id: "32017R0745" },
{ name: "NIS 2 Directive", id: "32022L2555" },
{ name: "Digital Services Act", id: "32022R2065" },
]; ];