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
f688762e
Commit
f688762e
authored
Sep 14, 2020
by
Kev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add jest test to parseHeaderLine
parent
656f5f4d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
app/assets/javascripts/jobs/store/utils.js
app/assets/javascripts/jobs/store/utils.js
+1
-1
spec/frontend/jobs/store/utils_spec.js
spec/frontend/jobs/store/utils_spec.js
+8
-0
No files found.
app/assets/javascripts/jobs/store/utils.js
View file @
f688762e
...
...
@@ -17,7 +17,7 @@ export const parseLine = (line = {}, lineNumber) => ({
* @param Number lineNumber
*/
export
const
parseHeaderLine
=
(
line
=
{},
lineNumber
)
=>
({
isClosed
:
line
.
section_options
?
line
.
section_options
.
collapsed
===
'
true
'
:
false
,
isClosed
:
line
.
section_options
?.
collapsed
===
'
true
'
,
isHeader
:
true
,
line
:
parseLine
(
line
,
lineNumber
),
lines
:
[],
...
...
spec/frontend/jobs/store/utils_spec.js
View file @
f688762e
...
...
@@ -35,6 +35,14 @@ describe('Jobs Store Utils', () => {
lines
:
[],
});
});
it
(
'
pre-closes a section when specified in options
'
,
()
=>
{
const
headerLine
=
{
content
:
[{
text
:
'
foo
'
}],
section_options
:
{
collapsed
:
'
true
'
}
};
const
parsedHeaderLine
=
parseHeaderLine
(
headerLine
,
2
);
expect
(
parsedHeaderLine
.
isClosed
).
toBe
(
true
);
});
});
describe
(
'
parseLine
'
,
()
=>
{
...
...
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