fix tests

This commit is contained in:
Philipp Kühn 2020-11-17 22:15:05 +01:00
parent 34a25c7ea0
commit 786c86f4b8
2 changed files with 10 additions and 10 deletions

View File

@ -24,7 +24,7 @@ context('/api/marks/highlight', () => {
it('should highlight the text in a specific color', () => { it('should highlight the text in a specific color', () => {
cy.get('.ProseMirror').then(([{ editor }]) => { cy.get('.ProseMirror').then(([{ editor }]) => {
editor.commands.highlight({ color: 'red' }) editor.commands.toggleHighlight({ color: 'red' })
cy.get('.ProseMirror') cy.get('.ProseMirror')
.find('mark') .find('mark')
@ -39,7 +39,7 @@ context('/api/marks/highlight', () => {
.chain() .chain()
.setContent('<p><mark style="background-color: blue;">Example Text</mark></p>') .setContent('<p><mark style="background-color: blue;">Example Text</mark></p>')
.selectAll() .selectAll()
.highlight({ color: 'rgb(255, 0, 0)' }) .toggleHighlight({ color: 'rgb(255, 0, 0)' })
.run() .run()
cy.get('.ProseMirror') cy.get('.ProseMirror')
@ -54,7 +54,7 @@ context('/api/marks/highlight', () => {
.chain() .chain()
.setContent('<p><mark style="background-color: rgb(255, 0, 0);">Example Text</mark></p>') .setContent('<p><mark style="background-color: rgb(255, 0, 0);">Example Text</mark></p>')
.selectAll() .selectAll()
.highlight({ color: 'rgb(255, 0, 0)' }) .toggleHighlight({ color: 'rgb(255, 0, 0)' })
.run() .run()
cy.get('.ProseMirror') cy.get('.ProseMirror')

View File

@ -7,7 +7,7 @@
highlight (any) highlight (any)
</button> </button>
<button <button
@click="editor.chain().focus().highlight({ @click="editor.chain().focus().toggleHighlight({
color: '' color: ''
}).run()" }).run()"
:class="{ 'is-active': editor.isActive('highlight', { :class="{ 'is-active': editor.isActive('highlight', {
@ -16,22 +16,22 @@
> >
highlight (default) highlight (default)
</button> </button>
<button @click="editor.chain().focus().highlight({ color: 'red' }).run()" :class="{ 'is-active': editor.isActive('highlight', { color: 'red' }) }"> <button @click="editor.chain().focus().toggleHighlight({ color: 'red' }).run()" :class="{ 'is-active': editor.isActive('highlight', { color: 'red' }) }">
"red" "red"
</button> </button>
<button @click="editor.chain().focus().highlight({ color: '#ffa8a8' }).run()" :class="{ 'is-active': editor.isActive('highlight', { color: '#ffa8a8' }) }"> <button @click="editor.chain().focus().toggleHighlight({ color: '#ffa8a8' }).run()" :class="{ 'is-active': editor.isActive('highlight', { color: '#ffa8a8' }) }">
red red
</button> </button>
<button @click="editor.chain().focus().highlight({ color: '#ffc078' }).run()" :class="{ 'is-active': editor.isActive('highlight', { color: '#ffc078' }) }"> <button @click="editor.chain().focus().toggleHighlight({ color: '#ffc078' }).run()" :class="{ 'is-active': editor.isActive('highlight', { color: '#ffc078' }) }">
orange orange
</button> </button>
<button @click="editor.chain().focus().highlight({ color: '#8ce99a' }).run()" :class="{ 'is-active': editor.isActive('highlight', { color: '#8ce99a' }) }"> <button @click="editor.chain().focus().toggleHighlight({ color: '#8ce99a' }).run()" :class="{ 'is-active': editor.isActive('highlight', { color: '#8ce99a' }) }">
green green
</button> </button>
<button @click="editor.chain().focus().highlight({ color: '#74c0fc' }).run()" :class="{ 'is-active': editor.isActive('highlight', { color: '#74c0fc' }) }"> <button @click="editor.chain().focus().toggleHighlight({ color: '#74c0fc' }).run()" :class="{ 'is-active': editor.isActive('highlight', { color: '#74c0fc' }) }">
blue blue
</button> </button>
<button @click="editor.chain().focus().highlight({ color: '#b197fc' }).run()" :class="{ 'is-active': editor.isActive('highlight', { color: '#b197fc' }) }"> <button @click="editor.chain().focus().toggleHighlight({ color: '#b197fc' }).run()" :class="{ 'is-active': editor.isActive('highlight', { color: '#b197fc' }) }">
purple purple
</button> </button>