Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('removes the toggled type', () => {
const from = doc(h1('toggled'));
const to = doc(p('toggled'));
expect(
toggleBlockItem({
type: schema.nodes.heading,
toggleType: schema.nodes.paragraph,
attrs: { level: 1 },
}),
).toTransformNode({
from,
to,
});
});
});
it('toggles to the specified type', () => {
const from = doc(p('toggled'));
const to = doc(h1('toggled'));
expect(
toggleBlockItem({
type: schema.nodes.heading,
toggleType: schema.nodes.paragraph,
attrs: { level: 1 },
}),
).toTransformNode({
from,
to,
});
});
it('can specify from and to', () => {
const from = doc(p('Ignore'), '');
const to = doc(p('Ignore'), h1('Content'));
expect(
replaceText({
appendText: '',
type: schema.nodes.heading,
content: 'Content',
range: { from: 8, to: 8 },
}),
).toTransformNode({
from,
to,
});
});