-
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.
Merge branch 'develop' into wip/sb/save-settings-sections
- Loading branch information
Showing
265 changed files
with
5,343 additions
and
3,274 deletions.
There are no files selected for viewing
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
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
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,75 @@ | ||
import test from 'playwright/test' | ||
import * as actions from './actions' | ||
import { expect } from './customExpect' | ||
import { CONTROL_KEY } from './keyboard' | ||
import * as locate from './locate' | ||
|
||
test('Edit comment by click', async ({ page }) => { | ||
await actions.goToGraph(page) | ||
const nodeComment = locate.nodeComment(locate.graphNodeByBinding(page, 'final')) | ||
await expect(nodeComment).toHaveText('This node can be entered') | ||
|
||
await nodeComment.click() | ||
await page.keyboard.press(`${CONTROL_KEY}+A`) | ||
const NEW_COMMENT = 'New comment text' | ||
await nodeComment.fill(NEW_COMMENT) | ||
await page.keyboard.press(`Enter`) | ||
await expect(nodeComment).not.toBeFocused() | ||
await expect(nodeComment).toHaveText(NEW_COMMENT) | ||
}) | ||
|
||
test('Start editing comment via menu', async ({ page }) => { | ||
await actions.goToGraph(page) | ||
const node = locate.graphNodeByBinding(page, 'final') | ||
await node.click() | ||
await locate.circularMenu(node).getByRole('button', { name: 'More' }).click() | ||
await locate.circularMenu(node).getByRole('button', { name: 'Comment' }).click() | ||
await expect(locate.nodeComment(node)).toBeFocused() | ||
}) | ||
|
||
test('Add new comment via menu', async ({ page }) => { | ||
await actions.goToGraph(page) | ||
const INITIAL_NODE_COMMENTS = 1 | ||
await expect(locate.nodeComment(page)).toHaveCount(INITIAL_NODE_COMMENTS) | ||
const node = locate.graphNodeByBinding(page, 'data') | ||
const nodeComment = locate.nodeComment(node) | ||
|
||
await node.click() | ||
await locate.circularMenu(node).getByRole('button', { name: 'More' }).click() | ||
await locate.circularMenu(node).getByRole('button', { name: 'Comment' }).click() | ||
await expect(locate.nodeComment(node)).toBeFocused() | ||
const NEW_COMMENT = 'New comment text' | ||
await nodeComment.fill(NEW_COMMENT) | ||
await page.keyboard.press(`Enter`) | ||
await expect(nodeComment).not.toBeFocused() | ||
await expect(nodeComment).toHaveText(NEW_COMMENT) | ||
await expect(locate.nodeComment(page)).toHaveCount(INITIAL_NODE_COMMENTS + 1) | ||
}) | ||
|
||
test('Delete comment by clearing text', async ({ page }) => { | ||
await actions.goToGraph(page) | ||
const nodeComment = locate.nodeComment(locate.graphNodeByBinding(page, 'final')) | ||
await expect(nodeComment).toHaveText('This node can be entered') | ||
|
||
await nodeComment.click() | ||
await page.keyboard.press(`${CONTROL_KEY}+A`) | ||
await page.keyboard.press(`Delete`) | ||
await page.keyboard.press(`Enter`) | ||
await expect(nodeComment).not.toExist() | ||
}) | ||
|
||
test('URL added to comment is rendered as link', async ({ page }) => { | ||
await actions.goToGraph(page) | ||
const nodeComment = locate.nodeComment(locate.graphNodeByBinding(page, 'final')) | ||
await expect(nodeComment).toHaveText('This node can be entered') | ||
await expect(nodeComment.locator('a')).not.toExist() | ||
|
||
await nodeComment.click() | ||
await page.keyboard.press(`${CONTROL_KEY}+A`) | ||
const NEW_COMMENT = "Here's a URL: https://example.com" | ||
await nodeComment.fill(NEW_COMMENT) | ||
await page.keyboard.press(`Enter`) | ||
await expect(nodeComment).not.toBeFocused() | ||
await expect(nodeComment).toHaveText(NEW_COMMENT) | ||
await expect(nodeComment.locator('a')).toHaveCount(1) | ||
}) |
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
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
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
Oops, something went wrong.