Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Fix flakiness in comment and reply e2e test
Sebastian Martinez committed 2 years ago
commit 0f8bd0d1dc1579271202f99ec8a493f2d2fb81e1
parent 84addf467dc3114a40da887fa37c93dc6bfe1264
3 files changed +9 -11
modified src/components/ExtendedTextarea.svelte
@@ -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"
modified tests/e2e/project/patch.spec.ts
@@ -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" }),
modified tests/support/project.ts
@@ -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();
}