🐛 Fix text editor being hidden to Playwright when empty text (#9682)

This commit is contained in:
Belén Albeza 2026-05-15 12:04:51 +02:00 committed by GitHub
parent 6ac8012258
commit fc36fb0959
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 19 additions and 2 deletions

View File

@ -172,6 +172,7 @@ export class WorkspacePage extends BaseWebSocketPage {
this.toolbarOptions = page.getByTestId("toolbar-options");
this.rectShapeButton = page.getByRole("button", { name: "Rectangle (R)" });
this.ellipseShapeButton = page.getByRole("button", { name: "Ellipse (E)" });
this.textShapeButton = page.getByRole("button", { name: "Text (T)" });
this.moveButton = page.getByRole("button", { name: "Move (V)" });
this.boardButton = page.getByRole("button", { name: "Board (B)" });
this.toggleToolbarButton = page.getByRole("button", {

View File

@ -315,3 +315,19 @@ test("BUG 11552 - Apply styles to the current caret", async ({ page }) => {
await expect(fontSizeInput).toHaveValue("");
await expect(fontSizeInput).toHaveAttribute("placeholder", "Mixed");
});
// This is to prevent QA tests from failing due to playwright
// considering 0-width text boxes as invisible
test("BUG 14098 - Fix text editor having 0 width or height", async ({ page }) => {
const workspace = new WasmWorkspacePage(page);
await workspace.setupEmptyFile();
await workspace.mockRPC("update-file?id=*", "text-editor/update-file.json");
await workspace.goToWorkspace();
await workspace.textShapeButton.click();
await workspace.clickAt(200, 200);
const textEditor = workspace.page.locator(`div[class*="viewport"]`).first().getByRole('textbox').first();
await expect(textEditor).toBeVisible();
});

View File

@ -423,8 +423,8 @@
(obj/merge!
#js {"--editor-container-width" "auto"
"--editor-container-height" "auto"
"--editor-container-min-width" (dm/str selrect-width "px")
"--editor-container-min-height" (dm/str selrect-height "px")
"--editor-container-min-width" (dm/str (max 1 selrect-width) "px")
"--editor-container-min-height" (dm/str (max 1 selrect-height) "px")
"--fallback-families" (if (seq fallback-families) (dm/str (str/join ", " fallback-families)) "sourcesanspro")
:display "flex"})