mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-16 03:40:37 +08:00
Invert markdown plain buttons in Blob component
Signed-off-by: Sebastian Martinez <me@sebastinez.dev> Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
This commit is contained in:
@@ -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}
|
||||
|
||||
+13
-13
@@ -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(
|
||||
/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(
|
||||
/secondary/,
|
||||
);
|
||||
await expect(page.getByText("##### Table of Contents")).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "Plain" })).not.toHaveClass(
|
||||
/secondary/,
|
||||
);
|
||||
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: "Markdown" }).click();
|
||||
}
|
||||
|
||||
// Internal links go to anchor.
|
||||
|
||||
Reference in New Issue
Block a user