2024-02-16 14:15:00 +00:00
|
|
|
import { expect } from '@playwright/test'
|
|
|
|
import { setup } from '../shared-e2e'
|
|
|
|
import test from './fixtures/fixtures'
|
|
|
|
|
|
|
|
test.describe('when selecting a tool from the toolbar', () => {
|
|
|
|
test.beforeEach(setup)
|
|
|
|
|
|
|
|
test('tool selection behaviors', async ({ toolbar }) => {
|
|
|
|
const { select, draw, arrow, cloud } = toolbar.tools
|
|
|
|
const { popoverCloud } = toolbar.popOverTools
|
|
|
|
|
|
|
|
await test.step('selecting a tool changes the button color', async () => {
|
|
|
|
await select.click()
|
2024-02-23 14:37:15 +00:00
|
|
|
await toolbar.isSelected(select)
|
|
|
|
await toolbar.isNotSelected(draw)
|
2024-02-16 14:15:00 +00:00
|
|
|
await draw.click()
|
2024-02-23 14:37:15 +00:00
|
|
|
await toolbar.isNotSelected(select)
|
|
|
|
await toolbar.isSelected(draw)
|
2024-02-16 14:15:00 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
await test.step('selecting certain tools exposes the tool-lock button', async () => {
|
|
|
|
await draw.click()
|
|
|
|
expect(toolbar.toolLock).toBeHidden()
|
|
|
|
await arrow.click()
|
|
|
|
expect(toolbar.toolLock).toBeVisible()
|
|
|
|
})
|
|
|
|
|
|
|
|
await test.step('selecting a tool from the popover makes it appear on toolbar', async () => {
|
|
|
|
await expect(cloud).toBeHidden()
|
|
|
|
await expect(toolbar.moreToolsPopover).toBeHidden()
|
|
|
|
await toolbar.moreToolsButton.click()
|
|
|
|
await expect(toolbar.moreToolsPopover).toBeVisible()
|
|
|
|
await popoverCloud.click()
|
|
|
|
await expect(toolbar.moreToolsPopover).toBeHidden()
|
|
|
|
await expect(cloud).toBeVisible()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|