Skip to content

Commit

Permalink
fix: test cases for font size
Browse files Browse the repository at this point in the history
  • Loading branch information
kart-c committed Nov 30, 2024
1 parent a94c9e2 commit 19891d0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions demos/src/Extensions/FontSize/React/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default () => {
</button>
<button
onClick={() => editor.chain().focus().unsetFontSize().run()}
data-test-id="unsetFontSize"
>
Unset font size
</button>
Expand Down
2 changes: 1 addition & 1 deletion demos/src/Extensions/FontSize/React/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ context('/src/Extensions/FontSize/React/', () => {
cy.get('[data-test-id="28px"]').click()
cy.get('.tiptap').find('span').should('have.attr', 'style', 'font-size: 28px')
cy.get('[data-test-id="unsetFontSize"]').click()
cy.get('.tiptap').find('span').should('not.have.attr', 'style', 'font-size: 28px')
cy.get('.tiptap').get('span').should('not.exist')
})
})
2 changes: 1 addition & 1 deletion demos/src/Extensions/FontSize/Vue/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ context('/src/Extensions/FontSize/Vue/', () => {
cy.get('[data-test-id="28px"]').click()
cy.get('.tiptap').find('span').should('have.attr', 'style', 'font-size: 28px')
cy.get('[data-test-id="unsetFontSize"]').click()
cy.get('.tiptap').find('span').should('not.have.attr', 'style', 'font-size: 28px')
cy.get('.tiptap').get('span').should('not.exist')
})
})
6 changes: 3 additions & 3 deletions demos/src/Extensions/FontSize/Vue/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<div v-if="editor" class="container">
<div class="control-group">
<div class="button-group">
<button @click="editor.chain().focus().setFontSize('28px').run()" :class="{ 'is-active': editor.isActive('textStyle', { fontSize: '28px' }) }" data-test-id="'28px'">
<button @click="editor.chain().focus().setFontSize('28px').run()" :class="{ 'is-active': editor.isActive('textStyle', { fontSize: '28px' }) }" data-test-id="28px">
Font size 28px
</button>
<button @click="editor.chain().focus().setFontSize('32px').run()" :class="{ 'is-active': editor.isActive('textStyle', { fontSize: '32px' }) }" data-test-id="'32px'">
<button @click="editor.chain().focus().setFontSize('32px').run()" :class="{ 'is-active': editor.isActive('textStyle', { fontSize: '32px' }) }" data-test-id="32px">
Font size 32px
</button>
<button @click="editor.chain().focus().unsetFontSize().run()">
<button @click="editor.chain().focus().unsetFontSize().run()" data-test-id="unsetFontSize">
Unset font size
</button>
</div>
Expand Down

0 comments on commit 19891d0

Please sign in to comment.