diff --git a/tests/e2e/board-attachment-receipts.spec.ts b/tests/e2e/board-attachment-receipts.spec.ts index 912cde9ad8..da87912cf8 100644 --- a/tests/e2e/board-attachment-receipts.spec.ts +++ b/tests/e2e/board-attachment-receipts.spec.ts @@ -80,6 +80,14 @@ async function setup(page: Page, request: APIRequestContext, classic: boolean) { composer, editor, send, + sendComment: async () => { + await send.click(); + if (classic) { + const confirm = page.getByTestId("issue-chat-no-assignee-send-anyway"); + await expect(confirm).toBeVisible(); + await confirm.click(); + } + }, attachments: () => request .get(`/api/issues/${issue.id}/attachments`) @@ -185,7 +193,7 @@ for (const classic of [false, true]) { req.method() === "POST" && new URL(req.url()).pathname.endsWith("/comments"), ); - await fixture.send.click(); + await fixture.sendComment(); expect((await outbound).postDataJSON().attachmentIds.sort()).toEqual( receipts.map((row) => row.id).sort(), ); @@ -246,7 +254,7 @@ for (const classic of [false, true]) { accepted = true; await route.abort("connectionreset"); }); - await fixture.send.click(); + await fixture.sendComment(); await expect.poll(() => accepted).toBe(true); expect(await fixture.comments()).toHaveLength(1); expect(acceptedRequestId).toEqual(expect.any(String)); @@ -278,7 +286,7 @@ for (const classic of [false, true]) { await fixture.editor.fill( "A deliberately new comment after the original receipt settled.", ); - await fixture.send.click(); + await fixture.sendComment(); await expect.poll(async () => (await fixture.comments()).length).toBe(2); }); @@ -300,14 +308,14 @@ for (const classic of [false, true]) { body: JSON.stringify({ error: "Fixture policy rejected this attempt" }), }); }); - await fixture.send.click(); + await fixture.sendComment(); await expect(fixture.editor).toContainText("Known rejection,"); await expect(fixture.send).toBeEnabled(); expect(await fixture.comments()).toHaveLength(0); await page.reload(); await expect(fixture.editor).toContainText("Known rejection,"); await expect(fixture.composer.getByRole("alert")).toHaveCount(0); - await fixture.send.click(); + await fixture.sendComment(); await expect.poll(async () => (await fixture.comments()).length).toBe(1); expect( (await fixture.attachments()).find((row) => row.id === receipt.id) @@ -341,7 +349,7 @@ for (const classic of [false, true]) { await route.fulfill({ response }).catch(() => {}); }); try { - await fixture.send.click(); + await fixture.sendComment(); await expect.poll(() => accepted).toBe(true); expect(await fixture.comments()).toHaveLength(1); await fixture.editor.fill("A newer draft written while delivery was pending."); @@ -356,7 +364,7 @@ for (const classic of [false, true]) { expect(await fixture.comments()).toHaveLength(1); expect(acceptedRequestId).toEqual(expect.any(String)); expect((await fixture.comments())[0]!.clientRequestId).toBe(acceptedRequestId); - await fixture.send.click(); + await fixture.sendComment(); await expect.poll(async () => (await fixture.comments()).length).toBe(2); expect(attempts).toBe(2); expect((await fixture.comments()).map((comment) => comment.body).sort()).toEqual([ @@ -414,7 +422,7 @@ for (const classic of [false, true]) req.method() === "POST" && new URL(req.url()).pathname.endsWith("/comments"), ); - await fixture.send.click(); + await fixture.sendComment(); expect((await outbound).postDataJSON().attachmentIds).toBeUndefined(); await expect.poll(async () => (await fixture.comments()).length).toBe(1); expect((await fixture.comments())[0]!.body).not.toContain( @@ -452,7 +460,7 @@ test("legacy failed upload can be removed before sending the retained text", asy }); await expect(remove).toBeVisible(); await remove.click(); - await fixture.send.click(); + await fixture.sendComment(); await expect.poll(async () => (await fixture.comments()).length).toBe(1); expect((await fixture.comments())[0]!.body).toBe( "Keep this text after removing the failed file.",