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
795c8e55
Commit
795c8e55
authored
Jul 14, 2020
by
derek-knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply feedback - improved logic in spec
parent
9cf189f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
spec/frontend/vue_shared/components/rich_content_editor/services/renderers/build_uneditable_token_spec.js
..._editor/services/renderers/build_uneditable_token_spec.js
+2
-0
spec/frontend/vue_shared/components/rich_content_editor/services/renderers/mock_data.js
...nents/rich_content_editor/services/renderers/mock_data.js
+8
-8
No files found.
spec/frontend/vue_shared/components/rich_content_editor/services/renderers/build_uneditable_token_spec.js
View file @
795c8e55
...
...
@@ -66,6 +66,8 @@ describe('Build Uneditable Token renderer helper', () => {
it
(
'
returns a 3-item array of tokens with the htmlBlockNode wrapped as a text token in the middle of block tokens
'
,
()
=>
{
const
result
=
buildUneditableHtmlAsTextTokens
(
htmlBlockNode
);
expect
(
result
[
1
].
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 @
795c8e55
...
...
@@ -17,7 +17,7 @@ export const htmlBlockNode = {
// Token spec helpers
const
buildUneditableOpenToken
=
type
=>
{
const
build
Mock
UneditableOpenToken
=
type
=>
{
return
{
type
:
'
openTag
'
,
tagName
:
type
,
...
...
@@ -28,7 +28,7 @@ const buildUneditableOpenToken = type => {
};
};
const
buildUneditableCloseToken
=
type
=>
{
const
build
Mock
UneditableCloseToken
=
type
=>
{
return
{
type
:
'
closeTag
'
,
tagName
:
type
};
};
...
...
@@ -36,8 +36,8 @@ export const originToken = {
type
:
'
text
'
,
content
:
'
{:.no_toc .hidden-md .hidden-lg}
'
,
};
export
const
uneditableCloseToken
=
buildUneditableCloseToken
(
'
div
'
);
export
const
uneditableOpenTokens
=
[
buildUneditableOpenToken
(
'
div
'
),
originToken
];
export
const
uneditableCloseToken
=
build
Mock
UneditableCloseToken
(
'
div
'
);
export
const
uneditableOpenTokens
=
[
build
Mock
UneditableOpenToken
(
'
div
'
),
originToken
];
export
const
uneditableCloseTokens
=
[
originToken
,
uneditableCloseToken
];
export
const
uneditableTokens
=
[...
uneditableOpenTokens
,
uneditableCloseToken
];
...
...
@@ -46,17 +46,17 @@ export const originInlineToken = {
content
:
'
<i>Inline</i> content
'
,
};
export
const
uneditableInlineTokens
=
[
buildUneditableOpenToken
(
'
a
'
),
build
Mock
UneditableOpenToken
(
'
a
'
),
originInlineToken
,
buildUneditableCloseToken
(
'
a
'
),
build
Mock
UneditableCloseToken
(
'
a
'
),
];
export
const
uneditableBlockTokens
=
[
buildUneditableOpenToken
(
'
div
'
),
build
Mock
UneditableOpenToken
(
'
div
'
),
{
type
:
'
text
'
,
tagName
:
null
,
content
:
'
<div><h1>Some header</h1><p>Some paragraph</p></div>
'
,
},
buildUneditableCloseToken
(
'
div
'
),
build
Mock
UneditableCloseToken
(
'
div
'
),
];
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