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
9e3e81b1
Commit
9e3e81b1
authored
Apr 08, 2021
by
Paul Gascou-Vaillancourt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use more meaningful examples in insertTips specs
parent
36efeee5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
26 deletions
+18
-26
ee/spec/frontend/security_configuration/api_fuzzing/utils_spec.js
...frontend/security_configuration/api_fuzzing/utils_spec.js
+18
-26
No files found.
ee/spec/frontend/security_configuration/api_fuzzing/utils_spec.js
View file @
9e3e81b1
...
...
@@ -68,14 +68,10 @@ default:
describe
(
'
insertTips
'
,
()
=>
{
const
validTips
=
[
{
tip
:
'
Tip 1
'
,
token
:
'
stages:
'
,
},
{
tip
:
'
Tip 2
'
,
token
:
'
variables:
'
,
},
{
tip
:
'
Tip 1
'
,
token
:
'
default:
'
},
{
tip
:
'
Tip 2
'
,
token
:
'
artifacts:
'
},
{
tip
:
'
Tip 3
'
,
token
:
'
expire_in:
'
},
{
tip
:
'
Tip 4
'
,
token
:
'
tags:
'
},
];
it
.
each
(
nonStringValues
)(
'
throws if snippet is not a string
'
,
(
snippet
)
=>
{
...
...
@@ -103,24 +99,20 @@ describe('insertTips', () => {
});
it
(
'
returns the snippet with properly inserted tips
'
,
()
=>
{
const
snippet
=
`
---
stages:
- fuzz
include:
- template: template.gitlab-cy.yml
variables:
- FOO: bar`
;
const
expected
=
`
---
# Tip 1
stages:
- fuzz
include:
- template: template.gitlab-cy.yml
# Tip 2
variables:
- FOO: bar`
;
const
snippet
=
`default:
artifacts:
expire_in: 30 days
tags:
- gitlab-org`
;
const
expected
=
`# Tip 1
default:
# Tip 2
artifacts:
# Tip 3
expire_in: 30 days
# Tip 4
tags:
- gitlab-org`
;
expect
(
insertTips
(
snippet
,
validTips
)).
toBe
(
expected
);
});
});
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