Merge branch 'main' into feature/vue-node-views

This commit is contained in:
Philipp Kühn
2020-11-19 09:38:23 +01:00
25 changed files with 211 additions and 83 deletions

View File

@@ -124,15 +124,15 @@ context('/api/marks/highlight', () => {
it('the keyboard shortcut should highlight the selected text', () => {
cy.get('.ProseMirror')
.trigger('keydown', { modKey: true, key: 'e' })
.trigger('keydown', { modKey: true, shiftKey: true, key: 'h' })
.find('mark')
.should('contain', 'Example Text')
})
it('the keyboard shortcut should toggle the selected text highlighted', () => {
cy.get('.ProseMirror')
.trigger('keydown', { modKey: true, key: 'e' })
.trigger('keydown', { modKey: true, key: 'e' })
.trigger('keydown', { modKey: true, shiftKey: true, key: 'h' })
.trigger('keydown', { modKey: true, shiftKey: true, key: 'h' })
.find('mark')
.should('not.exist')
})

View File

@@ -64,15 +64,15 @@ context('/api/marks/strike', () => {
it('the keyboard shortcut should strike the selected text', () => {
cy.get('.ProseMirror')
.trigger('keydown', { modKey: true, key: 'd' })
.trigger('keydown', { modKey: true, shiftKey: true, key: 'x' })
.find('s')
.should('contain', 'Example Text')
})
it('the keyboard shortcut should toggle the selected text striked', () => {
cy.get('.ProseMirror')
.trigger('keydown', { modKey: true, key: 'd' })
.trigger('keydown', { modKey: true, key: 'd' })
.trigger('keydown', { modKey: true, shiftKey: true, key: 'x' })
.trigger('keydown', { modKey: true, shiftKey: true, key: 'x' })
.find('s')
.should('not.exist')
})

View File

@@ -73,7 +73,7 @@ context('/api/nodes/blockquote', () => {
it('the keyboard shortcut should make the selected line a blockquote', () => {
cy.get('.ProseMirror')
.trigger('keydown', { shiftKey: true, modKey: true, key: '9' })
.trigger('keydown', { shiftKey: true, modKey: true, key: 'b' })
.find('blockquote')
.should('contain', 'Example Text')
})
@@ -83,13 +83,13 @@ context('/api/nodes/blockquote', () => {
.should('not.exist')
cy.get('.ProseMirror')
.trigger('keydown', { shiftKey: true, modKey: true, key: '9' })
.trigger('keydown', { shiftKey: true, modKey: true, key: 'b' })
.find('blockquote')
.should('contain', 'Example Text')
cy.get('.ProseMirror')
.type('{selectall}')
.trigger('keydown', { shiftKey: true, modKey: true, key: '9' })
.trigger('keydown', { shiftKey: true, modKey: true, key: 'b' })
cy.get('.ProseMirror blockquote')
.should('not.exist')

View File

@@ -49,3 +49,17 @@ export default {
},
}
</script>
<style lang="scss">
/* Basic editor styles */
.ProseMirror {
> * + * {
margin-top: 0.75em;
}
blockquote {
padding-left: 1rem;
border-left: 2px solid rgba(#0D0D0D, 0.1);
}
}
</style>

View File

@@ -53,20 +53,20 @@ context('/api/nodes/code-block', () => {
it('the keyboard shortcut should make the selected line a code block', () => {
cy.get('.ProseMirror')
.trigger('keydown', { shiftKey: true, modKey: true, key: 'c' })
.trigger('keydown', { modKey: true, altKey: true, key: 'c' })
.find('pre')
.should('contain', 'Example Text')
})
it('the keyboard shortcut should toggle the code block', () => {
cy.get('.ProseMirror')
.trigger('keydown', { shiftKey: true, modKey: true, key: 'c' })
.trigger('keydown', { modKey: true, altKey: true, key: 'c' })
.find('pre')
.should('contain', 'Example Text')
cy.get('.ProseMirror')
.type('{selectall}')
.trigger('keydown', { shiftKey: true, modKey: true, key: 'c' })
.trigger('keydown', { modKey: true, altKey: true, key: 'c' })
cy.get('.ProseMirror pre')
.should('not.exist')