mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-24 03:39:01 +08:00
test bold and link regex
This commit is contained in:
parent
f070ddc9fc
commit
f9860c54a9
26
tests/cypress/integration/extensions/bold.spec.ts
Normal file
26
tests/cypress/integration/extensions/bold.spec.ts
Normal file
@ -0,0 +1,26 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
import {
|
||||
starInputRegex,
|
||||
starPasteRegex,
|
||||
underscoreInputRegex,
|
||||
underscorePasteRegex,
|
||||
} from '@tiptap/extension-bold'
|
||||
|
||||
describe('bold regex test', () => {
|
||||
it('star input regex matches', () => {
|
||||
expect('**Test**').to.match(starInputRegex)
|
||||
})
|
||||
|
||||
it('star paste regex matches', () => {
|
||||
expect('**Test**').to.match(starPasteRegex)
|
||||
})
|
||||
|
||||
it('underscore input regex matches', () => {
|
||||
expect('__Test__').to.match(underscoreInputRegex)
|
||||
})
|
||||
|
||||
it('underscore paste regex matches', () => {
|
||||
expect('__Test__').to.match(underscorePasteRegex)
|
||||
})
|
||||
})
|
11
tests/cypress/integration/extensions/link.spec.ts
Normal file
11
tests/cypress/integration/extensions/link.spec.ts
Normal file
@ -0,0 +1,11 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
import { pasteRegex } from '@tiptap/extension-link'
|
||||
|
||||
describe('link regex test', () => {
|
||||
|
||||
it('paste regex matches url', () => {
|
||||
expect('https://www.example.com/with-spaces?var=true&foo=bar+3').to.match(pasteRegex)
|
||||
})
|
||||
|
||||
})
|
Loading…
Reference in New Issue
Block a user