mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-04 03:00:32 +08:00
Fix flakiness in comment and reply e2e test
This commit is contained in:
@@ -167,7 +167,11 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="comment-section" class:inline>
|
||||
<div
|
||||
class="comment-section"
|
||||
aria-label="extended-textarea"
|
||||
title=""
|
||||
class:inline>
|
||||
<Radio>
|
||||
<Button
|
||||
styleBorderRadius="0"
|
||||
|
||||
@@ -45,9 +45,7 @@ test("use revision selector", async ({ page }) => {
|
||||
await page.getByRole("link", { name: "Changes" }).click();
|
||||
// Switching to the initial revision
|
||||
await page.getByText("Revision 2c2f036").click();
|
||||
await expect(page.locator(".dropdown")).toBeVisible();
|
||||
await page.getByRole("link", { name: "Revision 679b2c8" }).click();
|
||||
await expect(page.locator(".dropdown")).toBeHidden();
|
||||
|
||||
await expect(
|
||||
page.getByRole("cell", { name: "Had to push a new revision" }),
|
||||
|
||||
@@ -57,9 +57,7 @@ export async function expectThreadCommentingToWork(page: Page) {
|
||||
await page.getByRole("button", { name: "Leave your comment" }).click();
|
||||
await page.getByPlaceholder("Leave your comment").fill("This is a comment");
|
||||
await page.getByRole("button", { name: "Comment" }).click();
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Comment", exact: true }),
|
||||
).toBeHidden();
|
||||
await expect(page.getByLabel("extended-textarea")).toBeHidden();
|
||||
await page.reload();
|
||||
await expect(page.getByText("This is a comment")).toBeVisible();
|
||||
|
||||
@@ -68,16 +66,14 @@ export async function expectThreadCommentingToWork(page: Page) {
|
||||
.getByPlaceholder("Leave your comment")
|
||||
.fill("This is an edited comment");
|
||||
await page.getByRole("button", { name: "Save" }).click();
|
||||
await expect(page.getByRole("button", { name: "Save" })).toBeHidden();
|
||||
await expect(page.getByLabel("extended-textarea")).toBeHidden();
|
||||
await page.reload();
|
||||
await expect(page.getByText("This is an edited comment")).toBeVisible();
|
||||
|
||||
await page.getByRole("button", { name: "Reply to comment" }).click();
|
||||
await page.getByPlaceholder("Reply to comment").fill("This is a reply");
|
||||
await page.getByRole("button", { name: "Comment", exact: true }).click();
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Comment", exact: true }),
|
||||
).toBeHidden();
|
||||
await expect(page.getByLabel("extended-textarea")).toBeHidden();
|
||||
await page.reload();
|
||||
await expect(page.getByText("This is a reply")).toBeVisible();
|
||||
|
||||
@@ -86,7 +82,7 @@ export async function expectThreadCommentingToWork(page: Page) {
|
||||
.getByPlaceholder("Leave your comment")
|
||||
.fill("This is an edited reply");
|
||||
await page.getByRole("button", { name: "Save" }).click();
|
||||
await expect(page.getByRole("button", { name: "Save" })).toBeHidden();
|
||||
await expect(page.getByLabel("extended-textarea")).toBeHidden();
|
||||
await page.reload();
|
||||
await expect(page.getByText("This is an edited reply")).toBeVisible();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user