Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Invert markdown plain buttons in Blob component
Sebastian Martinez committed 2 years ago
commit 580ccbcf1a8874f729095b9bdc3f7eb7fa03af57
parent d914710396e410c73df3b1925dc744712fe3498c
2 files changed +11 -11
modified src/views/projects/Source/Blob.svelte
@@ -264,7 +264,7 @@
              window.location.hash = "";
              showMarkdown = true;
            }}>
-
            Plain
+
            Markdown
          </Button>
          <Button
            styleBorderRadius="0"
@@ -272,7 +272,7 @@
            on:click={() => {
              showMarkdown = false;
            }}>
-
            Markdown
+
            Plain
          </Button>
        </Radio>
      {/if}
modified tests/e2e/project.spec.ts
@@ -98,7 +98,7 @@ test("source file highlighting", async ({ page }) => {

test("navigate line numbers", async ({ page }) => {
  await page.goto(`${markdownUrl}/tree/main/cheatsheet.md`);
-
  await page.getByRole("button", { name: "Markdown" }).click();
+
  await page.getByRole("button", { name: "Plain" }).click();

  await page.getByRole("link", { name: "5", exact: true }).click();
  await expect(page.locator("#L5")).toHaveClass("line highlight");
@@ -115,7 +115,7 @@ test("navigate line numbers", async ({ page }) => {
  // Check that we go back to the Markdown view when navigating to a different
  // file.
  await page.getByRole("link", { name: "footnotes.md" }).click();
-
  await expect(page.getByRole("button", { name: "Markdown" })).toHaveClass(
+
  await expect(page.getByRole("button", { name: "Plain" })).toHaveClass(
    /secondary/,
  );
});
@@ -241,21 +241,21 @@ test("markdown files", async ({ page }) => {

  // Switch between raw and rendered modes.
  {
-
    await expect(page.getByRole("button", { name: "Plain" })).toHaveClass(
+
    await expect(page.getByRole("button", { name: "Markdown" })).toHaveClass(
      /secondary/,
    );
-
    await expect(
-
      page.getByRole("button", { name: "Markdown" }),
-
    ).not.toHaveClass(/secondary/);
-
    await page.getByRole("button", { name: "Markdown" }).click();
    await expect(page.getByRole("button", { name: "Plain" })).not.toHaveClass(
      /secondary/,
    );
-
    await expect(page.getByRole("button", { name: "Markdown" })).toHaveClass(
+
    await page.getByRole("button", { name: "Plain" }).click();
+
    await expect(
+
      page.getByRole("button", { name: "Markdown" }),
+
    ).not.toHaveClass(/secondary/);
+
    await expect(page.getByRole("button", { name: "Plain" })).toHaveClass(
      /secondary/,
    );
    await expect(page.getByText("##### Table of Contents")).toBeVisible();
-
    await page.getByRole("button", { name: "Plain" }).click();
+
    await page.getByRole("button", { name: "Markdown" }).click();
  }

  // Internal links go to anchor.