Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
raimohanska committed Mar 4, 2024
1 parent 19912b9 commit c23d60c
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions playwright/src/tests/board.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ test.describe("Basic board functionality", () => {
await board.createArea(100, 200, userPageNoteText)
})

test("Create note by double clicking on board", async ({ page, browser }) => {
const board = await navigateToNewBoard(page, browser)
await board.board.dblclick({ position: { x: 200, y: 200 } })
await expect(board.getNote("HELLO")).toBeVisible()

await test.step("Also inside an Area", async () => {
await board.createArea(300, 200, "Container")
await board.board.dblclick({ position: { x: 350, y: 250 } })
await expect(board.getNote("HELLO")).toHaveCount(2)
})
})

test("Drag notes", async ({ page, browser }) => {
const board = await navigateToNewBoard(page, browser)
const monoids = await board.createNoteWithText(100, 200, "Monoids")
Expand All @@ -31,11 +43,19 @@ test.describe("Basic board functionality", () => {
await board.assertItemPosition(monoids, 300, 300)
})

const area = await board.createArea(450, 100, "Container")
await test.step("Drag multiple items", async () => {
await board.selectItems(monoids, semigroups)
await board.dragItem(monoids, 400, 300)
await board.assertItemPosition(monoids, 400, 300)
await board.assertItemPosition(semigroups, 300, 200)
await board.dragItem(monoids, 600, 300)
await board.assertItemPosition(monoids, 600, 300)
await board.assertItemPosition(semigroups, 500, 200)
})

await test.step("Drag area to move contained items", async () => {
await board.dragItem(area, 300, 300)
await board.assertItemPosition(area, 300, 300)
await board.assertItemPosition(monoids, 240, 360)
await board.assertItemPosition(semigroups, 140, 260)
})
})

Expand Down

0 comments on commit c23d60c

Please sign in to comment.