mirror of
https://github.com/penpot/penpot.git
synced 2026-05-20 15:33:43 +00:00
🐛 Fix text editor being hidden to Playwright when empty text (#9682)
This commit is contained in:
parent
6ac8012258
commit
fc36fb0959
@ -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", {
|
||||
|
||||
@ -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();
|
||||
});
|
||||
|
||||
@ -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"})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user