mirror of
https://github.com/enso-org/enso.git
synced 2024-12-22 16:11:45 +03:00
c69ba4ee70
Fixes #9182 Now we are careful when to handle events - before or after updating intersected set. Added general E2E and detailed unit tests for selecting. Also discovered, that sometimes the test are running while nodes are not yet in right positions. Added an instruction ensuring the position is right.
20 lines
661 B
TypeScript
20 lines
661 B
TypeScript
import { expect, type Locator } from 'playwright/test'
|
|
|
|
/** Ensures that at least one of the elements that the Locator points to,
|
|
* is an attached and visible DOM node. */
|
|
export function toExist(locator: Locator) {
|
|
// Counter-intuitive, but correct:
|
|
// https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-be-visible
|
|
return expect(locator.first()).toBeVisible()
|
|
}
|
|
|
|
export function toBeSelected(locator: Locator) {
|
|
return expect(locator).toHaveClass(/(?<=^| )selected(?=$| )/)
|
|
}
|
|
|
|
export module not {
|
|
export function toBeSelected(locator: Locator) {
|
|
return expect(locator).not.toHaveClass(/(?<=^| )selected(?=$| )/)
|
|
}
|
|
}
|