From 1d4013cdaea5012b7b3965722d24e85c3d77a171 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Wed, 19 Aug 2020 11:22:20 +0200 Subject: [PATCH 01/48] add empty example pages --- docs/src/docPages/examples/code-highlighting.md | 1 + docs/src/docPages/examples/collaboration.md | 0 docs/src/docPages/examples/drag-handle.md | 0 docs/src/docPages/examples/embeds.md | 0 docs/src/docPages/examples/export-html-or-json.md | 0 docs/src/docPages/examples/floating-menu.md | 0 docs/src/docPages/examples/focus.md | 0 docs/src/docPages/examples/hiding-menu-bar.md | 0 docs/src/docPages/examples/history.md | 0 docs/src/docPages/examples/images.md | 0 docs/src/docPages/examples/links.md | 0 docs/src/docPages/examples/markdown-shortcuts.md | 0 docs/src/docPages/examples/menu-bubble.md | 0 docs/src/docPages/examples/placeholder.md | 0 docs/src/docPages/examples/search-and-replace.md | 0 docs/src/docPages/examples/suggestions.md | 0 docs/src/docPages/examples/tables.md | 0 docs/src/docPages/examples/title.md | 0 docs/src/docPages/examples/todo-list.md | 0 docs/src/docPages/examples/trailing-paragraph.md | 0 20 files changed, 1 insertion(+) create mode 100644 docs/src/docPages/examples/code-highlighting.md create mode 100644 docs/src/docPages/examples/collaboration.md create mode 100644 docs/src/docPages/examples/drag-handle.md create mode 100644 docs/src/docPages/examples/embeds.md create mode 100644 docs/src/docPages/examples/export-html-or-json.md create mode 100644 docs/src/docPages/examples/floating-menu.md create mode 100644 docs/src/docPages/examples/focus.md create mode 100644 docs/src/docPages/examples/hiding-menu-bar.md create mode 100644 docs/src/docPages/examples/history.md create mode 100644 docs/src/docPages/examples/images.md create mode 100644 docs/src/docPages/examples/links.md create mode 100644 docs/src/docPages/examples/markdown-shortcuts.md create mode 100644 docs/src/docPages/examples/menu-bubble.md create mode 100644 docs/src/docPages/examples/placeholder.md create mode 100644 docs/src/docPages/examples/search-and-replace.md create mode 100644 docs/src/docPages/examples/suggestions.md create mode 100644 docs/src/docPages/examples/tables.md create mode 100644 docs/src/docPages/examples/title.md create mode 100644 docs/src/docPages/examples/todo-list.md create mode 100644 docs/src/docPages/examples/trailing-paragraph.md diff --git a/docs/src/docPages/examples/code-highlighting.md b/docs/src/docPages/examples/code-highlighting.md new file mode 100644 index 00000000..5f8a4386 --- /dev/null +++ b/docs/src/docPages/examples/code-highlighting.md @@ -0,0 +1 @@ +# Code Highlighting \ No newline at end of file diff --git a/docs/src/docPages/examples/collaboration.md b/docs/src/docPages/examples/collaboration.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/src/docPages/examples/drag-handle.md b/docs/src/docPages/examples/drag-handle.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/src/docPages/examples/embeds.md b/docs/src/docPages/examples/embeds.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/src/docPages/examples/export-html-or-json.md b/docs/src/docPages/examples/export-html-or-json.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/src/docPages/examples/floating-menu.md b/docs/src/docPages/examples/floating-menu.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/src/docPages/examples/focus.md b/docs/src/docPages/examples/focus.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/src/docPages/examples/hiding-menu-bar.md b/docs/src/docPages/examples/hiding-menu-bar.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/src/docPages/examples/history.md b/docs/src/docPages/examples/history.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/src/docPages/examples/images.md b/docs/src/docPages/examples/images.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/src/docPages/examples/links.md b/docs/src/docPages/examples/links.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/src/docPages/examples/markdown-shortcuts.md b/docs/src/docPages/examples/markdown-shortcuts.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/src/docPages/examples/menu-bubble.md b/docs/src/docPages/examples/menu-bubble.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/src/docPages/examples/placeholder.md b/docs/src/docPages/examples/placeholder.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/src/docPages/examples/search-and-replace.md b/docs/src/docPages/examples/search-and-replace.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/src/docPages/examples/suggestions.md b/docs/src/docPages/examples/suggestions.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/src/docPages/examples/tables.md b/docs/src/docPages/examples/tables.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/src/docPages/examples/title.md b/docs/src/docPages/examples/title.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/src/docPages/examples/todo-list.md b/docs/src/docPages/examples/todo-list.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/src/docPages/examples/trailing-paragraph.md b/docs/src/docPages/examples/trailing-paragraph.md new file mode 100644 index 00000000..e69de29b From 108a2b8a11533f50fbe3dfa2c8427ad9d645b1ae Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Wed, 19 Aug 2020 11:22:54 +0200 Subject: [PATCH 02/48] =?UTF-8?q?change=20siteName=20to=20=E2=80=9Ctiptap?= =?UTF-8?q?=202=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/gridsome.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/gridsome.config.js b/docs/gridsome.config.js index d91e7519..2fd650e0 100644 --- a/docs/gridsome.config.js +++ b/docs/gridsome.config.js @@ -11,7 +11,7 @@ function addStyleResource(rule) { } module.exports = { - siteName: 'tiptap', + siteName: 'tiptap 2', titleTemplate: '%s', port: 3000, plugins: [ From d21ae6f514da37f1908e03309c726e762b93fecd Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Wed, 19 Aug 2020 17:28:46 +0200 Subject: [PATCH 03/48] use cypress github action --- .github/workflows/main.yml | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 08eec4e0..34d07667 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,10 +11,31 @@ jobs: node-version: [14.x] steps: + - uses: actions/checkout@v2.3.2 + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2.1.1 with: node-version: ${{ matrix.node-version }} - - run: yarn install - - run: yarn run startandtest + + - name: Install dependencies + run: yarn install + + - name: Cypress run + uses: cypress-io/github-action@v2 + with: + browser: chrome + command: yarn run startandtest + + - uses: actions/upload-artifact@v1 + if: failure() + with: + name: cypress-screenshots + path: cypress/screenshots + + - uses: actions/upload-artifact@v1 + if: always() + with: + name: cypress-videos + path: cypress/videos From aff1ca081c56e0ee2cb6542abe427bb54f6f860f Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Wed, 19 Aug 2020 17:30:52 +0200 Subject: [PATCH 04/48] rename job --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 34d07667..f5172bac 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ name: build on: [push, pull_request] jobs: - audit: + test: runs-on: ubuntu-latest strategy: From 8def6c6617a6c674d491d73ff44b8c0429329d0b Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Wed, 19 Aug 2020 17:33:39 +0200 Subject: [PATCH 05/48] fix path to screenshots and screen recordings --- .github/workflows/main.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f5172bac..c17cc79a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,14 +28,16 @@ jobs: browser: chrome command: yarn run startandtest - - uses: actions/upload-artifact@v1 + - name: Export screenshots of failed tests + uses: actions/upload-artifact@v1 if: failure() with: name: cypress-screenshots - path: cypress/screenshots + path: tests/cypress/screenshots - - uses: actions/upload-artifact@v1 + - name: Export screen recording of executed tests + uses: actions/upload-artifact@v1 if: always() with: name: cypress-videos - path: cypress/videos + path: tests/cypress/videos From 3c8379db0a6fdc62c39d9f2b812c9d632e89a63d Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Wed, 19 Aug 2020 17:35:52 +0200 Subject: [PATCH 06/48] cache node dependencies --- .github/workflows/main.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c17cc79a..4d810142 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,6 +19,19 @@ jobs: with: node-version: ${{ matrix.node-version }} + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - name: Restore yarn cache directory + uses: actions/cache@v2 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Install dependencies run: yarn install From 45fb69aef6a76c295549a06c7f4f589792aae1aa Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Wed, 19 Aug 2020 17:38:05 +0200 Subject: [PATCH 07/48] export screen recordings on failure only --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4d810142..0685ac23 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,16 +41,16 @@ jobs: browser: chrome command: yarn run startandtest - - name: Export screenshots of failed tests + - name: Export screenshots (on failure only) uses: actions/upload-artifact@v1 if: failure() with: name: cypress-screenshots path: tests/cypress/screenshots - - name: Export screen recording of executed tests + - name: Export screen recordings (on failure only) uses: actions/upload-artifact@v1 - if: always() + if: failure() with: name: cypress-videos path: tests/cypress/videos From 399be73e7b20a18df1919af706b53c10c61dd65a Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Wed, 19 Aug 2020 17:55:08 +0200 Subject: [PATCH 08/48] add read-only test --- docs/src/demos/ReadOnly/index.spec.js | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/src/demos/ReadOnly/index.spec.js b/docs/src/demos/ReadOnly/index.spec.js index 33182594..96d2394d 100644 --- a/docs/src/demos/ReadOnly/index.spec.js +++ b/docs/src/demos/ReadOnly/index.spec.js @@ -2,4 +2,34 @@ context('read-only', () => { beforeEach(() => { cy.visit('/examples/read-only') }) + + + describe('editable', () => { + it('should be editable', () => { + cy.get('.ProseMirror').window().then(window => { + const { editor } = window + + cy.get('#editable').check() + + editor.insertText('Edited: ') + + cy.get('.ProseMirror h2:first') + .should('contain', 'Edited: ') + }) + }) + + it('should be read-only', () => { + cy.get('.ProseMirror').window().then(window => { + const { editor } = window + + cy.get('#editable').uncheck() + + editor.insertText('Edited: ') + + cy.get('.ProseMirror h2:first') + .should('not.contain', 'Edited: ') + }) + }) + + }) }) \ No newline at end of file From 99f3f1889ba12374345766b103c661b29ca375b0 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Wed, 19 Aug 2020 17:57:55 +0200 Subject: [PATCH 09/48] minor improvements to the read-only example --- docs/src/demos/ReadOnly/index.spec.js | 13 ++++--------- docs/src/demos/ReadOnly/index.vue | 3 --- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/docs/src/demos/ReadOnly/index.spec.js b/docs/src/demos/ReadOnly/index.spec.js index 96d2394d..9ccac0e6 100644 --- a/docs/src/demos/ReadOnly/index.spec.js +++ b/docs/src/demos/ReadOnly/index.spec.js @@ -3,31 +3,26 @@ context('read-only', () => { cy.visit('/examples/read-only') }) - describe('editable', () => { it('should be editable', () => { cy.get('.ProseMirror').window().then(window => { - const { editor } = window - cy.get('#editable').check() + const { editor } = window editor.insertText('Edited: ') - cy.get('.ProseMirror h2:first') - .should('contain', 'Edited: ') + cy.get('.ProseMirror p:first').should('contain', 'Edited: ') }) }) it('should be read-only', () => { cy.get('.ProseMirror').window().then(window => { - const { editor } = window - cy.get('#editable').uncheck() + const { editor } = window editor.insertText('Edited: ') - cy.get('.ProseMirror h2:first') - .should('not.contain', 'Edited: ') + cy.get('.ProseMirror p:first').should('not.contain', 'Edited: ') }) }) diff --git a/docs/src/demos/ReadOnly/index.vue b/docs/src/demos/ReadOnly/index.vue index 5c0f6aa0..c8cd06d5 100644 --- a/docs/src/demos/ReadOnly/index.vue +++ b/docs/src/demos/ReadOnly/index.vue @@ -27,9 +27,6 @@ export default { this.editor = new Editor({ editable: false, content: ` -

- Read-Only -

This text is read-only. You are not able to edit something. Links to fancy websites are still working.

From bfc5512d8429ef37c6626a3e87382eef1a9c9ad9 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Wed, 19 Aug 2020 17:58:44 +0200 Subject: [PATCH 10/48] fall back to default value in data --- docs/src/demos/ReadOnly/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/demos/ReadOnly/index.vue b/docs/src/demos/ReadOnly/index.vue index c8cd06d5..3d1135fb 100644 --- a/docs/src/demos/ReadOnly/index.vue +++ b/docs/src/demos/ReadOnly/index.vue @@ -25,7 +25,7 @@ export default { mounted() { this.editor = new Editor({ - editable: false, + editable: this.editable, content: `

This text is read-only. You are not able to edit something. Links to fancy websites are still working. From af84e6f8fe51f19bbd76de902e29e74fed2454d0 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Wed, 19 Aug 2020 17:59:33 +0200 Subject: [PATCH 11/48] fix heighlighted lines --- docs/src/docPages/examples/read-only.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/docPages/examples/read-only.md b/docs/src/docPages/examples/read-only.md index a25de92c..45a64ba8 100644 --- a/docs/src/docPages/examples/read-only.md +++ b/docs/src/docPages/examples/read-only.md @@ -1,3 +1,3 @@ # Read-Only - \ No newline at end of file + \ No newline at end of file From 0a6b2e02390d5a17b6531adebf1c175b8c581ad2 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Wed, 19 Aug 2020 18:01:28 +0200 Subject: [PATCH 12/48] add titles to all examples --- docs/src/docPages/examples/collaboration.md | 1 + docs/src/docPages/examples/drag-handle.md | 1 + docs/src/docPages/examples/embeds.md | 1 + docs/src/docPages/examples/export-html-or-json.md | 1 + docs/src/docPages/examples/floating-menu.md | 1 + docs/src/docPages/examples/focus.md | 1 + docs/src/docPages/examples/hiding-menu-bar.md | 1 + docs/src/docPages/examples/history.md | 1 + docs/src/docPages/examples/images.md | 1 + docs/src/docPages/examples/links.md | 1 + docs/src/docPages/examples/markdown-shortcuts.md | 1 + docs/src/docPages/examples/menu-bubble.md | 1 + docs/src/docPages/examples/placeholder.md | 1 + docs/src/docPages/examples/search-and-replace.md | 1 + docs/src/docPages/examples/suggestions.md | 1 + docs/src/docPages/examples/tables.md | 1 + docs/src/docPages/examples/title.md | 1 + docs/src/docPages/examples/todo-list.md | 1 + docs/src/docPages/examples/trailing-paragraph.md | 1 + 19 files changed, 19 insertions(+) diff --git a/docs/src/docPages/examples/collaboration.md b/docs/src/docPages/examples/collaboration.md index e69de29b..01ddb0cb 100644 --- a/docs/src/docPages/examples/collaboration.md +++ b/docs/src/docPages/examples/collaboration.md @@ -0,0 +1 @@ +# Collaboration \ No newline at end of file diff --git a/docs/src/docPages/examples/drag-handle.md b/docs/src/docPages/examples/drag-handle.md index e69de29b..3384db3f 100644 --- a/docs/src/docPages/examples/drag-handle.md +++ b/docs/src/docPages/examples/drag-handle.md @@ -0,0 +1 @@ +# Drag Handle \ No newline at end of file diff --git a/docs/src/docPages/examples/embeds.md b/docs/src/docPages/examples/embeds.md index e69de29b..ed286ec1 100644 --- a/docs/src/docPages/examples/embeds.md +++ b/docs/src/docPages/examples/embeds.md @@ -0,0 +1 @@ +# Embeds \ No newline at end of file diff --git a/docs/src/docPages/examples/export-html-or-json.md b/docs/src/docPages/examples/export-html-or-json.md index e69de29b..a6d5070c 100644 --- a/docs/src/docPages/examples/export-html-or-json.md +++ b/docs/src/docPages/examples/export-html-or-json.md @@ -0,0 +1 @@ +# Export HTML or JSON \ No newline at end of file diff --git a/docs/src/docPages/examples/floating-menu.md b/docs/src/docPages/examples/floating-menu.md index e69de29b..26384079 100644 --- a/docs/src/docPages/examples/floating-menu.md +++ b/docs/src/docPages/examples/floating-menu.md @@ -0,0 +1 @@ +# Floating Menu \ No newline at end of file diff --git a/docs/src/docPages/examples/focus.md b/docs/src/docPages/examples/focus.md index e69de29b..6b1a14e7 100644 --- a/docs/src/docPages/examples/focus.md +++ b/docs/src/docPages/examples/focus.md @@ -0,0 +1 @@ +# Focus \ No newline at end of file diff --git a/docs/src/docPages/examples/hiding-menu-bar.md b/docs/src/docPages/examples/hiding-menu-bar.md index e69de29b..cf78381d 100644 --- a/docs/src/docPages/examples/hiding-menu-bar.md +++ b/docs/src/docPages/examples/hiding-menu-bar.md @@ -0,0 +1 @@ +# Hiding Menu Bar \ No newline at end of file diff --git a/docs/src/docPages/examples/history.md b/docs/src/docPages/examples/history.md index e69de29b..8d32e8ea 100644 --- a/docs/src/docPages/examples/history.md +++ b/docs/src/docPages/examples/history.md @@ -0,0 +1 @@ +# History \ No newline at end of file diff --git a/docs/src/docPages/examples/images.md b/docs/src/docPages/examples/images.md index e69de29b..d14d0008 100644 --- a/docs/src/docPages/examples/images.md +++ b/docs/src/docPages/examples/images.md @@ -0,0 +1 @@ +# Images \ No newline at end of file diff --git a/docs/src/docPages/examples/links.md b/docs/src/docPages/examples/links.md index e69de29b..8794cf32 100644 --- a/docs/src/docPages/examples/links.md +++ b/docs/src/docPages/examples/links.md @@ -0,0 +1 @@ +# Links \ No newline at end of file diff --git a/docs/src/docPages/examples/markdown-shortcuts.md b/docs/src/docPages/examples/markdown-shortcuts.md index e69de29b..cc7558c1 100644 --- a/docs/src/docPages/examples/markdown-shortcuts.md +++ b/docs/src/docPages/examples/markdown-shortcuts.md @@ -0,0 +1 @@ +# Markdown Shortcuts \ No newline at end of file diff --git a/docs/src/docPages/examples/menu-bubble.md b/docs/src/docPages/examples/menu-bubble.md index e69de29b..52ae51ec 100644 --- a/docs/src/docPages/examples/menu-bubble.md +++ b/docs/src/docPages/examples/menu-bubble.md @@ -0,0 +1 @@ +# Menu Bubble \ No newline at end of file diff --git a/docs/src/docPages/examples/placeholder.md b/docs/src/docPages/examples/placeholder.md index e69de29b..867e2c84 100644 --- a/docs/src/docPages/examples/placeholder.md +++ b/docs/src/docPages/examples/placeholder.md @@ -0,0 +1 @@ +# Placeholder \ No newline at end of file diff --git a/docs/src/docPages/examples/search-and-replace.md b/docs/src/docPages/examples/search-and-replace.md index e69de29b..f34d0f48 100644 --- a/docs/src/docPages/examples/search-and-replace.md +++ b/docs/src/docPages/examples/search-and-replace.md @@ -0,0 +1 @@ +# Search and Replace \ No newline at end of file diff --git a/docs/src/docPages/examples/suggestions.md b/docs/src/docPages/examples/suggestions.md index e69de29b..c07178b2 100644 --- a/docs/src/docPages/examples/suggestions.md +++ b/docs/src/docPages/examples/suggestions.md @@ -0,0 +1 @@ +# Suggestions \ No newline at end of file diff --git a/docs/src/docPages/examples/tables.md b/docs/src/docPages/examples/tables.md index e69de29b..eedf1fde 100644 --- a/docs/src/docPages/examples/tables.md +++ b/docs/src/docPages/examples/tables.md @@ -0,0 +1 @@ +# Tables \ No newline at end of file diff --git a/docs/src/docPages/examples/title.md b/docs/src/docPages/examples/title.md index e69de29b..8a38d58c 100644 --- a/docs/src/docPages/examples/title.md +++ b/docs/src/docPages/examples/title.md @@ -0,0 +1 @@ +# Title \ No newline at end of file diff --git a/docs/src/docPages/examples/todo-list.md b/docs/src/docPages/examples/todo-list.md index e69de29b..f7fe2a83 100644 --- a/docs/src/docPages/examples/todo-list.md +++ b/docs/src/docPages/examples/todo-list.md @@ -0,0 +1 @@ +# Todo List \ No newline at end of file diff --git a/docs/src/docPages/examples/trailing-paragraph.md b/docs/src/docPages/examples/trailing-paragraph.md index e69de29b..86826b3e 100644 --- a/docs/src/docPages/examples/trailing-paragraph.md +++ b/docs/src/docPages/examples/trailing-paragraph.md @@ -0,0 +1 @@ +# Trailing Paragraph \ No newline at end of file From 6f0ddebe045c5aab39d33e787539fdd464dc52b5 Mon Sep 17 00:00:00 2001 From: Hans Pagel Date: Wed, 19 Aug 2020 18:12:36 +0200 Subject: [PATCH 13/48] add (broken) focus example --- docs/src/demos/Focus/index.spec.js | 13 +++++ docs/src/demos/Focus/index.vue | 82 +++++++++++++++++++++++++++++ docs/src/demos/Focus/style.scss | 4 ++ docs/src/docPages/examples/focus.md | 4 +- 4 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 docs/src/demos/Focus/index.spec.js create mode 100644 docs/src/demos/Focus/index.vue create mode 100644 docs/src/demos/Focus/style.scss diff --git a/docs/src/demos/Focus/index.spec.js b/docs/src/demos/Focus/index.spec.js new file mode 100644 index 00000000..c8251f4b --- /dev/null +++ b/docs/src/demos/Focus/index.spec.js @@ -0,0 +1,13 @@ +context('read-only', () => { + beforeEach(() => { + cy.visit('/examples/focus') + }) + + describe('editable', () => { + it('should have class', () => { + cy.get('.ProseMirror').window().then(window => { + cy.get('.ProseMirror p:first').should('have.class', 'has-focus') + }) + }) + }) +}) \ No newline at end of file diff --git a/docs/src/demos/Focus/index.vue b/docs/src/demos/Focus/index.vue new file mode 100644 index 00000000..4bd6400e --- /dev/null +++ b/docs/src/demos/Focus/index.vue @@ -0,0 +1,82 @@ + + + + +