Commit d2fc5226 authored by derek-knox's avatar derek-knox

Apply feedback - add clarity to htmlBlockNode test

parent 62c56d0a
......@@ -8,7 +8,6 @@ import {
} from '~/vue_shared/components/rich_content_editor/services/renderers/build_uneditable_token';
import {
htmlBlockNode,
originInlineToken,
originToken,
uneditableOpenTokens,
......@@ -64,10 +63,15 @@ describe('Build Uneditable Token renderer helper', () => {
describe('buildUneditableHtmlAsTextTokens', () => {
it('returns a 3-item array of tokens with the htmlBlockNode wrapped as a text token in the middle of block tokens', () => {
const htmlBlockNode = {
type: 'htmlBlock',
literal: '<div data-tomark-pass ><h1>Some header</h1><p>Some paragraph</p></div>',
};
const result = buildUneditableHtmlAsTextTokens(htmlBlockNode);
const { type, content } = result[1];
expect(result[1].type).toBe('text');
expect(result[1].content).not.toMatch(/ data-tomark-pass /);
expect(type).toBe('text');
expect(content).not.toMatch(/ data-tomark-pass /);
expect(result).toHaveLength(3);
expect(result).toStrictEqual(uneditableBlockTokens);
......
......@@ -10,11 +10,6 @@ export const buildMockTextNode = literal => {
export const normalTextNode = buildMockTextNode('This is just normal text.');
export const htmlBlockNode = {
type: 'htmlBlock',
literal: '<div data-tomark-pass ><h1>Some header</h1><p>Some paragraph</p></div>',
};
// Token spec helpers
const buildMockUneditableOpenToken = type => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment