Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud AMBROSELLI committed Sep 13, 2023
1 parent ebe70b7 commit 5e776f7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dashboard/src/components/ConsultationModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ function ConsultationContent({ personId, consultation, date, onClose }) {
body.completedAt = null;
}

if (!isNewConsultation) {
if (!isNewConsultation && !!consultation) {
const historyEntry = {
date: new Date(),
user: user._id,
Expand Down
9 changes: 8 additions & 1 deletion e2e/consultations_create-consultation-from-agenda.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,20 @@ test("test", async ({ page }) => {
await page.getByLabel("Nom").click();
await page.getByLabel("Nom").fill("test");
await page.getByRole("button", { name: "Sauvegarder" }).click();
await page.getByText("Création réussie !").click();
await page.getByRole("link", { name: "Agenda" }).click();
await page.getByRole("button", { name: "Créer une nouvelle consultation" }).click();
await changeReactSelectValue(page, "create-consultation-person-select", "test");
await changeReactSelectValue(page, "consultation-modal-type", "Médicale");

await page.getByRole("button", { name: "Sauvegarder" }).click();
await page.getByText("Création réussie !").click();
await page.getByText("Consultation Médicale", { exact: true }).click();
await page.getByRole("button", { name: "Fermer" }).first().click();
await page.getByText("Consultation Médicale").click();
await page.getByRole("button", { name: "Modifier" }).click();
await page.getByLabel("Nom (facultatif)").fill("Avec un nom");
await page.getByRole("button", { name: "Sauvegarder" }).click();
await page.getByText("Consultation Médicale").click();
await page.getByRole("button", { name: "Historique" }).click();
await page.locator('[data-test-id="Nom\\: \\"\\" ➔ \\"Avec un nom\\""]').click();
});

0 comments on commit 5e776f7

Please sign in to comment.