-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix node removing bug, caused by spurious watchEffect effect. (#11099)
Fixes [#11062](#11062) Modified watchEffect to be consistent with Vue behavior + tests. Before the scheduled effects were run even if stopped. Why it fixes nodes removal? See [this comment](#11062 (comment))
- Loading branch information
Showing
5 changed files
with
92 additions
and
52 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
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('Deleting selected node with backspace key', async ({ page }) => { | ||
await actions.goToGraph(page) | ||
|
||
const nodesCount = await locate.graphNode(page).count() | ||
const deletedNode = locate.graphNodeByBinding(page, 'final') | ||
await deletedNode.click() | ||
await page.keyboard.press('Backspace') | ||
await expect(locate.graphNode(page)).toHaveCount(nodesCount - 1) | ||
}) | ||
|
||
test('Deleting selected node with delete key', async ({ page }) => { | ||
await actions.goToGraph(page) | ||
|
||
const nodesCount = await locate.graphNode(page).count() | ||
const deletedNode = locate.graphNodeByBinding(page, 'final') | ||
await deletedNode.click() | ||
await page.keyboard.press('Delete') | ||
await expect(locate.graphNode(page)).toHaveCount(nodesCount - 1) | ||
}) | ||
|
||
test('Graph can be empty', async ({ page }) => { | ||
await actions.goToGraph(page) | ||
|
||
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']) | ||
}) | ||
|
||
test('Removing connected nodes', async ({ page }) => { | ||
await actions.goToGraph(page) | ||
const nodesCount = await locate.graphNode(page).count() | ||
await page.keyboard.down('Shift') | ||
await locate.graphNodeByBinding(page, 'five').click() | ||
await expect(locate.selectedNodes(page)).toHaveCount(1) | ||
await locate.graphNodeByBinding(page, 'sum').click() | ||
await expect(locate.selectedNodes(page)).toHaveCount(2) | ||
await page.keyboard.up('Shift') | ||
await page.keyboard.press('Delete') | ||
await expect(locate.graphNode(page)).toHaveCount(nodesCount - 2) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters