feat(training): captions under lesson images
Authors can now attach a caption to an image in the lesson editor; it is sanitized as figure text and follows the image's alignment in the reader. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
@@ -91,11 +91,16 @@ test.describe("training", () => {
|
||||
await page
|
||||
.getByRole("button", { name: "Set image width to 50%" })
|
||||
.click();
|
||||
page.once("dialog", (dialog) => dialog.accept("Front-of-house console"));
|
||||
await page.getByRole("button", { name: "Add image caption" }).click();
|
||||
await page.getByRole("button", { name: "Save lesson" }).click();
|
||||
|
||||
await expect(
|
||||
lesson.locator('img[data-align="right"][width="50%"]'),
|
||||
).toBeVisible();
|
||||
await expect(lesson.locator("figcaption")).toHaveText(
|
||||
"Front-of-house console",
|
||||
);
|
||||
|
||||
const pdf = Buffer.from("%PDF-1.7\n% E2E manual\n");
|
||||
await lesson
|
||||
@@ -127,6 +132,7 @@ test.describe("training", () => {
|
||||
).toHaveCount(0);
|
||||
await expect(page.getByRole("link", { name: "guide.txt" })).toBeVisible();
|
||||
await expect(page.getByRole("img", { name: "console.png" })).toBeVisible();
|
||||
await expect(page.getByText("Front-of-house console")).toBeVisible();
|
||||
await expect(
|
||||
page.getByRole("link", { name: "audio-manual.pdf" }),
|
||||
).toBeVisible();
|
||||
|
||||
Reference in New Issue
Block a user