mirror of
https://github.com/enso-org/enso.git
synced 2024-12-23 18:34:03 +03:00
85ddbc5f24
Add remove-warnings button to Warnings Visualization. Part of #9226. https://github.com/enso-org/enso/assets/1047859/1b00a62e-8f3b-4697-af10-34a4b93ca8ff
40 lines
1.8 KiB
TypeScript
40 lines
1.8 KiB
TypeScript
import { test } from '@playwright/test'
|
|
import * as actions from './actions'
|
|
import { expect } from './customExpect'
|
|
import * as locate from './locate'
|
|
|
|
test('node can open and load visualization', async ({ page }) => {
|
|
await actions.goToGraph(page)
|
|
const node = locate.graphNode(page).last()
|
|
await node.click({ position: { x: 8, y: 8 } })
|
|
await expect(locate.circularMenu(page)).toExist()
|
|
await locate.toggleVisualizationButton(page).click()
|
|
await expect(locate.anyVisualization(page)).toExist()
|
|
await locate.showVisualizationSelectorButton(page).click()
|
|
await page.getByText('JSON').click()
|
|
await expect(locate.jsonVisualization(page)).toExist()
|
|
// The default JSON viz data contains an object.
|
|
await expect(locate.jsonVisualization(page)).toContainText('{')
|
|
})
|
|
|
|
test('Warnings visualization', async ({ page }) => {
|
|
await actions.goToGraph(page)
|
|
|
|
// Create a node, attach a warning, open the warnings-visualization.
|
|
await locate.addNewNodeButton(page).click()
|
|
const input = locate.componentBrowserInput(page).locator('input')
|
|
await input.fill('Warning.attach "Uh oh" 42')
|
|
await page.keyboard.press('Enter')
|
|
await expect(locate.componentBrowser(page)).not.toBeVisible()
|
|
await expect(locate.circularMenu(page)).toExist()
|
|
await locate.toggleVisualizationButton(page).click()
|
|
await expect(locate.anyVisualization(page)).toExist()
|
|
await locate.showVisualizationSelectorButton(page).click()
|
|
await page.locator('.VisualizationSelector').getByRole('button', { name: 'Warnings' }).click()
|
|
await expect(locate.warningsVisualization(page)).toExist()
|
|
// Click the remove-warnings button, and ensure a node is created.
|
|
const nodeCount = await locate.graphNode(page).count()
|
|
await page.getByTestId('remove-warnings-button').click()
|
|
await expect(locate.graphNode(page)).toHaveCount(nodeCount + 1)
|
|
})
|