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
20ffe9b0
Commit
20ffe9b0
authored
Jul 07, 2020
by
derek-knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup spec mock_data.js use
Two MRs in parallel resulted in two mock_data.js files. This cleans that up.
parent
0cd724f8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
73 deletions
+27
-73
spec/frontend/vue_shared/components/rich_content_editor/mock_data.js
...nd/vue_shared/components/rich_content_editor/mock_data.js
+0
-56
spec/frontend/vue_shared/components/rich_content_editor/services/renderers/mock_data.js
...nents/rich_content_editor/services/renderers/mock_data.js
+0
-14
spec/frontend/vue_shared/components/rich_content_editor/services/renderers/render_identifier_paragraph_spec.js
...or/services/renderers/render_identifier_paragraph_spec.js
+11
-1
spec/frontend/vue_shared/components/rich_content_editor/services/renderers/render_kramdown_list_spec.js
...nt_editor/services/renderers/render_kramdown_list_spec.js
+16
-2
No files found.
spec/frontend/vue_shared/components/rich_content_editor/mock_data.js
deleted
100644 → 0
View file @
0cd724f8
const
buildMockTextNode
=
literal
=>
{
return
{
firstChild
:
null
,
literal
,
type
:
'
text
'
,
};
};
const
buildMockListNode
=
literal
=>
{
return
{
firstChild
:
{
firstChild
:
{
firstChild
:
buildMockTextNode
(
literal
),
type
:
'
paragraph
'
,
},
type
:
'
item
'
,
},
type
:
'
list
'
,
};
};
export
const
buildMockParagraphNode
=
literal
=>
{
return
{
firstChild
:
buildMockTextNode
(
literal
),
type
:
'
paragraph
'
,
};
};
export
const
kramdownListNode
=
buildMockListNode
(
'
TOC
'
);
export
const
normalListNode
=
buildMockListNode
(
'
Just another bullet point
'
);
export
const
kramdownTextNode
=
buildMockTextNode
(
'
{:toc}
'
);
export
const
identifierTextNode
=
buildMockTextNode
(
'
[Some text]: https://link.com
'
);
export
const
embeddedRubyTextNode
=
buildMockTextNode
(
'
<%= partial("some/path") %>
'
);
export
const
normalTextNode
=
buildMockTextNode
(
'
This is just normal text.
'
);
export
const
normalParagraphNode
=
buildMockParagraphNode
(
'
This is just normal paragraph. It has multiple sentences.
'
,
);
const
uneditableOpenToken
=
{
type
:
'
openTag
'
,
tagName
:
'
div
'
,
attributes
:
{
contenteditable
:
false
},
classNames
:
[
'
gl-px-4 gl-py-2 gl-opacity-5 gl-bg-gray-100 gl-user-select-none gl-cursor-not-allowed
'
,
],
};
export
const
uneditableCloseToken
=
{
type
:
'
closeTag
'
,
tagName
:
'
div
'
};
export
const
originToken
=
{
type
:
'
text
'
,
content
:
'
{:.no_toc .hidden-md .hidden-lg}
'
,
};
export
const
uneditableOpenTokens
=
[
uneditableOpenToken
,
originToken
];
export
const
uneditableCloseTokens
=
[
originToken
,
uneditableCloseToken
];
export
const
uneditableTokens
=
[...
uneditableOpenTokens
,
uneditableCloseToken
];
spec/frontend/vue_shared/components/rich_content_editor/services/renderers/mock_data.js
View file @
20ffe9b0
...
...
@@ -8,21 +8,7 @@ export const buildMockTextNode = literal => {
};
};
export
const
buildMockListNode
=
literal
=>
{
return
{
firstChild
:
{
firstChild
:
{
firstChild
:
buildMockTextNode
(
literal
),
type
:
'
paragraph
'
,
},
type
:
'
item
'
,
},
type
:
'
list
'
,
};
};
export
const
normalTextNode
=
buildMockTextNode
(
'
This is just normal text.
'
);
export
const
normalListNode
=
buildMockListNode
(
'
Just another bullet point
'
);
// Token spec helpers
...
...
spec/frontend/vue_shared/components/rich_content_editor/services/renderers/render_identifier_paragraph_spec.js
View file @
20ffe9b0
...
...
@@ -4,8 +4,18 @@ import {
buildUneditableCloseToken
,
}
from
'
~/vue_shared/components/rich_content_editor/services/renderers/build_uneditable_token
'
;
import
{
buildMock
ParagraphNode
,
normalParagraphNode
}
from
'
../.
./mock_data
'
;
import
{
buildMock
TextNode
}
from
'
./mock_data
'
;
const
buildMockParagraphNode
=
literal
=>
{
return
{
firstChild
:
buildMockTextNode
(
literal
),
type
:
'
paragraph
'
,
};
};
const
normalParagraphNode
=
buildMockParagraphNode
(
'
This is just normal paragraph. It has multiple sentences.
'
,
);
const
identifierParagraphNode
=
buildMockParagraphNode
(
`[another-identifier]: https://example.com "This example has a title" [identifier]: http://example1.com [this link]: http://example2.com`
,
);
...
...
spec/frontend/vue_shared/components/rich_content_editor/services/renderers/render_kramdown_list_spec.js
View file @
20ffe9b0
...
...
@@ -4,8 +4,22 @@ import {
buildUneditableCloseToken
,
}
from
'
~/vue_shared/components/rich_content_editor/services/renderers/build_uneditable_token
'
;
import
{
buildMockListNode
,
normalListNode
}
from
'
./mock_data
'
;
import
{
buildMockTextNode
}
from
'
./mock_data
'
;
const
buildMockListNode
=
literal
=>
{
return
{
firstChild
:
{
firstChild
:
{
firstChild
:
buildMockTextNode
(
literal
),
type
:
'
paragraph
'
,
},
type
:
'
item
'
,
},
type
:
'
list
'
,
};
};
const
normalListNode
=
buildMockListNode
(
'
Just another bullet point
'
);
const
kramdownListNode
=
buildMockListNode
(
'
TOC
'
);
describe
(
'
Render Kramdown List renderer
'
,
()
=>
{
...
...
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