-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Render tables in documentation. (#11564)
* Render tables in documentation. Also: - Separate parser for our flavor of Markdown from the CodeMirror integration; move the parser into ydoc-shared and use for Markdown line-wrapping. - Introduce our own version of yCollab extension; initially just the upstream version translated to Typescript and our code style. - Refactor CodeEditor. * CHANGELOG, prettier * Apply @farmaazon review. * Fix * Lint * Cleanup * Integration tests for GraphNodeComment Also a little refactoring in preparation for new implementation. * Workaround stuck CI * Revert "Workaround stuck CI" This reverts commit 7431384. * Fix merge --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
1477051
commit 3a33e81
Showing
39 changed files
with
1,977 additions
and
794 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
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
Oops, something went wrong.