Add regression e2e test for empty graph (#11031)

Closes #11026
This commit is contained in:
Ilya Bogdanov 2024-09-11 15:40:24 +04:00 committed by GitHub
parent 497da82b10
commit a0a4a2fef3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,23 @@
import { test } from '@playwright/test'
import * as actions from './actions'
import { expect } from './customExpect'
import { CONTROL_KEY, DELETE_KEY } from './keyboard'
import * as locate from './locate'
test('graph can be empty', async ({ page }) => {
await actions.goToGraph(page)
await expect(locate.graphEditor(page)).toExist()
await expect(locate.graphNode(page)).toExist()
await locate.graphEditor(page).press(`${CONTROL_KEY}+A`)
await locate.graphEditor(page).press(`${DELETE_KEY}`)
await expect(locate.graphNode(page)).toHaveCount(0)
await locate.addNewNodeButton(page).click()
await expect(locate.componentBrowserInput(page)).toBeVisible()
await page.keyboard.insertText('foo')
await page.keyboard.press(`${CONTROL_KEY}+Enter`)
await expect(locate.graphNode(page)).toHaveCount(1)
await expect(locate.graphNode(page).locator('.WidgetToken')).toHaveText(['foo'])
})