Skip to content

Commit

Permalink
added test
Browse files Browse the repository at this point in the history
  • Loading branch information
bdbch committed Aug 17, 2023
1 parent ea67919 commit b7f35ea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
3 changes: 0 additions & 3 deletions demos/src/Marks/Link/React/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ export default () => {
Code,
Link.configure({
openOnClick: false,
HTMLAttributes: {
class: 'my-class',
},
}),
],
content: `
Expand Down
14 changes: 14 additions & 0 deletions demos/src/Marks/Link/React/index.spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Link from '@tiptap/extension-link'

context('/src/Marks/Link/React/', () => {
before(() => {
cy.visit('/src/Marks/Link/React/')
Expand All @@ -10,6 +12,18 @@ context('/src/Marks/Link/React/', () => {
})
})

it('should add a custom class to a link', () => {
const linkExtension = Link.configure({
HTMLAttributes: {
class: 'foo',
},
})

expect(linkExtension.options.HTMLAttributes).to.deep.include({
class: 'foo',
})
})

it('should parse a tags correctly', () => {
cy.get('.tiptap').then(([{ editor }]) => {
editor.commands.setContent('<p><a href="#">Example Text</a></p>')
Expand Down

0 comments on commit b7f35ea

Please sign in to comment.