Skip to content

Commit

Permalink
adjust vue tests to expect the new behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
bdbch committed Nov 30, 2024
1 parent a6a424f commit 8e1d93d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions demos/src/Extensions/TextAlign/Vue/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@ context('/src/Extensions/TextAlign/Vue/', () => {
})
})

it('should parse a null alignment correctly', () => {
cy.get('.tiptap').then(([{ editor }]) => {
editor.commands.setContent('<p>Example Text</p>')
expect(editor.getHTML()).to.eq('<p>Example Text</p>')
})
})

it('should parse left align text correctly (and not render)', () => {
cy.get('.tiptap').then(([{ editor }]) => {
editor.commands.setContent('<p style="text-align: left">Example Text</p>')
expect(editor.getHTML()).to.eq('<p>Example Text</p>')
expect(editor.getHTML()).to.eq('<p style="text-align: left">Example Text</p>')
})
})

Expand Down Expand Up @@ -58,7 +65,7 @@ context('/src/Extensions/TextAlign/Vue/', () => {

cy.get('.tiptap')
.find('p')
.should('not.have.css', 'text-align', 'left')
.should('have.css', 'text-align', 'left')
})

it('aligns the text center on the 2nd button', () => {
Expand Down Expand Up @@ -101,7 +108,7 @@ context('/src/Extensions/TextAlign/Vue/', () => {
cy.get('.tiptap')
.trigger('keydown', { modKey: true, shiftKey: true, key: 'l' })
.find('p')
.should('not.have.css', 'text-align', 'left')
.should('have.css', 'text-align', 'left')
})

it('aligns the text center when pressing the keyboard shortcut', () => {
Expand Down

0 comments on commit 8e1d93d

Please sign in to comment.