Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d2fc5226
Commit
d2fc5226
authored
Jul 14, 2020
by
derek-knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply feedback - add clarity to htmlBlockNode test
parent
62c56d0a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
spec/frontend/vue_shared/components/rich_content_editor/services/renderers/build_uneditable_token_spec.js
..._editor/services/renderers/build_uneditable_token_spec.js
+7
-3
spec/frontend/vue_shared/components/rich_content_editor/services/renderers/mock_data.js
...nents/rich_content_editor/services/renderers/mock_data.js
+0
-5
No files found.
spec/frontend/vue_shared/components/rich_content_editor/services/renderers/build_uneditable_token_spec.js
View file @
d2fc5226
...
...
@@ -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
);
...
...
spec/frontend/vue_shared/components/rich_content_editor/services/renderers/mock_data.js
View file @
d2fc5226
...
...
@@ -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
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment