mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
🐛 Fix missing scroll in comments
This commit is contained in:
committed by
Andrey Antukh
parent
c5bf2a775e
commit
3d7f399a50
File diff suppressed because one or more lines are too long
10
frontend/playwright/data/workspace/get-thread-comments.json
Normal file
10
frontend/playwright/data/workspace/get-thread-comments.json
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -43,4 +43,18 @@ export class ViewerPage extends BaseWebSocketPage {
|
||||
async cleanUp() {
|
||||
await this.#ws.mockClose();
|
||||
}
|
||||
|
||||
async showComments(clickOptions = {}) {
|
||||
await this.page
|
||||
.getByRole("button", { name: "Comments (G C)" })
|
||||
.click(clickOptions);
|
||||
}
|
||||
|
||||
async showCommentsThread(number, clickOptions = {}) {
|
||||
await this.page
|
||||
.getByTestId("floating-thread-bubble")
|
||||
.filter({ hasText: number.toString() })
|
||||
.click(clickOptions);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
34
frontend/playwright/ui/specs/viewer-comments.spec.js
Normal file
34
frontend/playwright/ui/specs/viewer-comments.spec.js
Normal file
@@ -0,0 +1,34 @@
|
||||
import { test, expect } from "@playwright/test";
|
||||
import { ViewerPage } from "../pages/ViewerPage";
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await ViewerPage.init(page);
|
||||
});
|
||||
|
||||
const singleBoardFileId = "dd5cc0bb-91ff-81b9-8004-77df9cd3edb1";
|
||||
const singleBoardPageId = "dd5cc0bb-91ff-81b9-8004-77df9cd3edb2";
|
||||
|
||||
const setupFileWithSingleBoard = async (viewer) => {
|
||||
await viewer.mockRPC(/get\-view\-only\-bundle\?/, "viewer/get-view-only-bundle-single-board.json");
|
||||
await viewer.mockRPC("get-comment-threads?file-id=*", "workspace/get-comment-threads-not-empty.json");
|
||||
await viewer.mockRPC(
|
||||
"get-file-fragment?file-id=*&fragment-id=*",
|
||||
"viewer/get-file-fragment-single-board.json",
|
||||
);
|
||||
await viewer.mockRPC("get-comments?thread-id=*", "workspace/get-thread-comments.json");
|
||||
await viewer.mockRPC("update-comment-thread-status", "workspace/update-comment-thread-status.json");
|
||||
};
|
||||
|
||||
test("Comment is shown with scroll and valid position", async ({ page }) => {
|
||||
const viewer = new ViewerPage(page);
|
||||
await viewer.setupLoggedInUser();
|
||||
await setupFileWithSingleBoard(viewer);
|
||||
|
||||
await viewer.goToViewer({ fileId: singleBoardFileId, pageId: singleBoardPageId });
|
||||
await viewer.showComments();
|
||||
await viewer.showCommentsThread(1);
|
||||
await expect(viewer.page.getByRole("textbox", { name: "Reply" })).toBeVisible();
|
||||
await viewer.showCommentsThread(1);
|
||||
await viewer.showCommentsThread(2);
|
||||
await expect(viewer.page.getByRole("textbox", { name: "Reply" })).toBeVisible();
|
||||
});
|
||||
Reference in New Issue
Block a user