Skip to content

Commit

Permalink
fix: e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
Volubyl committed Feb 2, 2023
1 parent 5a6f3f8 commit 74efb68
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client/src/lib/components/DatasetForm/DatasetForm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import "@testing-library/jest-dom";

import DatasetForm from "./DatasetForm.svelte";
import { render, fireEvent, getByLabelText } from "@testing-library/svelte";
import { render, fireEvent } from "@testing-library/svelte";
import type {
DatasetFormData,
DatasetFormInitial,
Expand Down
12 changes: 8 additions & 4 deletions client/src/tests/e2e/contribuer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ test.describe("Basic form submission", () => {

// "Sources et formats" section

const apiFormat = page.locator("label[for=dataformats-1]");
await apiFormat.check();
await page
.getByLabel(
"Format(s) des données * Sélectionnez ici les différents formats de données qu'un réutilisateur potentiel pourrait exploiter."
)
.fill("d");
await page.getByText("Base de données").click();

const technicalSource = page.locator("form [name=technicalSource]");
await technicalSource.fill(technicalSourceText);
Expand Down Expand Up @@ -146,8 +150,8 @@ test.describe("Basic form submission", () => {
expect(json.geographical_coverage).toBe("Europe continentale");
expect(json.formats).toStrictEqual([
{
id: 1,
name: "Fichier tabulaire (XLS, XLSX, CSV, ...)",
id: 4,
name: "Base de données",
},
]);
expect(json.producer_email).toBe(producerEmailText);
Expand Down

0 comments on commit 74efb68

Please sign in to comment.