mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-18 14:13:21 +08:00
test: add extension option tests
This commit is contained in:
parent
94b0f4b1d9
commit
47032bf96d
58
tests/cypress/integration/core/extensionOptions.spec.ts
Normal file
58
tests/cypress/integration/core/extensionOptions.spec.ts
Normal file
@ -0,0 +1,58 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
import { Extension } from '@tiptap/core/src/Extension'
|
||||
|
||||
describe('extension options', () => {
|
||||
it('should pass through', () => {
|
||||
const extension = Extension.create({
|
||||
defaultOptions: {
|
||||
foo: 1,
|
||||
bar: 1,
|
||||
},
|
||||
})
|
||||
|
||||
expect(extension.options).to.deep.eq({
|
||||
foo: 1,
|
||||
bar: 1,
|
||||
})
|
||||
})
|
||||
|
||||
it('should be configurable', () => {
|
||||
const extension = Extension
|
||||
.create({
|
||||
defaultOptions: {
|
||||
foo: 1,
|
||||
bar: 1,
|
||||
},
|
||||
})
|
||||
.configure({
|
||||
bar: 2,
|
||||
})
|
||||
|
||||
expect(extension.options).to.deep.eq({
|
||||
foo: 1,
|
||||
bar: 2,
|
||||
})
|
||||
})
|
||||
|
||||
// TODO: this fails. not sure about it
|
||||
|
||||
// it('should be extendable', () => {
|
||||
// const extension = Extension
|
||||
// .create({
|
||||
// defaultOptions: {
|
||||
// foo: 1,
|
||||
// bar: 1,
|
||||
// },
|
||||
// })
|
||||
// .extend({
|
||||
// defaultOptions: {
|
||||
// baz: 1,
|
||||
// },
|
||||
// })
|
||||
|
||||
// expect(extension.options).to.deep.eq({
|
||||
// baz: 1,
|
||||
// })
|
||||
// })
|
||||
})
|
Loading…
Reference in New Issue
Block a user