2023-11-27 18:48:37 +03:00
|
|
|
import { expect, test } from '@playwright/test'
|
|
|
|
import * as actions from './actions'
|
|
|
|
import * as customExpect from './customExpect'
|
|
|
|
import * as locate from './locate'
|
|
|
|
|
|
|
|
test('component browser shows entries, and creates a new node', async ({ page }) => {
|
|
|
|
await actions.goToGraph(page)
|
|
|
|
await locate.graphEditor(page).click()
|
|
|
|
await locate.graphEditor(page).press('Enter')
|
|
|
|
await customExpect.toExist(locate.componentBrowser(page))
|
|
|
|
await customExpect.toExist(locate.componentBrowserEntry(page))
|
2023-12-12 17:27:40 +03:00
|
|
|
let nodeCount = await locate.graphNode(page).count()
|
2023-11-27 18:48:37 +03:00
|
|
|
await locate.componentBrowserEntry(page).last().click()
|
2023-12-12 17:27:40 +03:00
|
|
|
await expect(locate.componentBrowser(page)).not.toBeVisible()
|
|
|
|
await expect(locate.graphNode(page)).toHaveCount(nodeCount + 1)
|
|
|
|
|
|
|
|
// Clicking at highlighted entry should also work.
|
|
|
|
nodeCount = await locate.graphNode(page).count()
|
|
|
|
await locate.graphEditor(page).press('Enter')
|
|
|
|
await locate.componentBrowserSelectedEntry(page).first().click()
|
2023-11-27 18:48:37 +03:00
|
|
|
await expect(locate.componentBrowser(page)).not.toBeVisible()
|
|
|
|
await expect(locate.graphNode(page)).toHaveCount(nodeCount + 1)
|
|
|
|
})
|