From 6cfa0d0555a22b02eebadbef6ddff8704018f159 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Mon, 11 Mar 2024 20:09:05 +0100 Subject: [PATCH] Fix assignee and peer switching e2e tests --- src/views/projects/Cob/AssigneeInput.svelte | 2 +- src/views/projects/Patch.svelte | 8 ++++++-- tests/e2e/project.spec.ts | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/views/projects/Cob/AssigneeInput.svelte b/src/views/projects/Cob/AssigneeInput.svelte index f4e89077c..a4f0611f9 100644 --- a/src/views/projects/Cob/AssigneeInput.svelte +++ b/src/views/projects/Cob/AssigneeInput.svelte @@ -33,7 +33,7 @@ const parsedNodeId = parseNodeId(inputValue); if (parsedNodeId) { assignee = `${parsedNodeId.prefix}${parsedNodeId.pubkey}`; - if (!updatedAssignees.find(({ id }) => id === assignee)) { + if (updatedAssignees.find(({ id }) => id === assignee)) { valid = false; validationMessage = "This assignee is already added"; } else { diff --git a/src/views/projects/Patch.svelte b/src/views/projects/Patch.svelte index 8d751dec4..6b571ade5 100644 --- a/src/views/projects/Patch.svelte +++ b/src/views/projects/Patch.svelte @@ -220,7 +220,9 @@ revision: revisionId, comment: commentId, reaction, - active: Boolean(authors.find(({ id }) => id === session.publicKey)), + active: !authors.find( + ({ id }) => utils.parseNodeId(id)?.pubkey === session.publicKey, + ), }, session.id, ); @@ -378,7 +380,9 @@ type: "revision.react", revision: revisionId, reaction, - active: Boolean(authors.find(({ id }) => id === session.publicKey)), + active: !authors.find( + ({ id }) => utils.parseNodeId(id)?.pubkey === session.publicKey, + ), }, session.id, ); diff --git a/tests/e2e/project.spec.ts b/tests/e2e/project.spec.ts index 047f37298..3e694048c 100644 --- a/tests/e2e/project.spec.ts +++ b/tests/e2e/project.spec.ts @@ -294,7 +294,7 @@ test("peer and branch switching", async ({ page }) => { ); await expect( page.getByRole("link", { - name: "Commits 6", + name: "Commits 7", }), ).toBeVisible(); } @@ -363,7 +363,7 @@ test("peer and branch switching", async ({ page }) => { ); await expect( page.getByRole("link", { - name: "Commits 7", + name: "Commits 8", }), ).toBeVisible(); await expect(