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
a2486975
Commit
a2486975
authored
Jun 21, 2020
by
Fernando
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add unit tests for descriptions
* Add specs
parent
deb63d42
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
1 deletion
+31
-1
ee/app/assets/javascripts/vue_shared/license_compliance/components/add_license_form.vue
...shared/license_compliance/components/add_license_form.vue
+1
-1
ee/spec/frontend/vue_shared/license_compliance/components/add_license_form_spec.js
...ed/license_compliance/components/add_license_form_spec.js
+30
-0
No files found.
ee/app/assets/javascripts/vue_shared/license_compliance/components/add_license_form.vue
View file @
a2486975
...
...
@@ -89,7 +89,7 @@ export default {
v-for=
"option in $options.approvalStatusOptions"
:key=
"option.value"
class=
"form-check"
v-bind
:class=
"
{ 'mb-3': isDescriptionEnabled }"
:class=
"
{ 'mb-3': isDescriptionEnabled }"
>
<input
:id=
"`js-$
{option.value}-license-radio`"
...
...
ee/spec/frontend/vue_shared/license_compliance/components/add_license_form_spec.js
View file @
a2486975
...
...
@@ -11,6 +11,7 @@ describe('AddLicenseForm', () => {
const
findCancelButton
=
()
=>
vm
.
$el
.
querySelector
(
'
.js-cancel
'
);
beforeEach
(()
=>
{
window
.
gon
=
{
features
:
{
licenseComplianceDeniesMr
:
false
}
};
vm
=
mountComponent
(
Component
);
});
...
...
@@ -121,6 +122,35 @@ describe('AddLicenseForm', () => {
});
});
it
(
'
shows dropdown descriptions, if licenseComplianceDeniesMr feature flag is enabled
'
,
done
=>
{
window
.
gon
=
{
features
:
{
licenseComplianceDeniesMr
:
true
}
};
vm
=
mountComponent
(
Component
,
{
managedLicenses
:
[{
name
:
'
FOO
'
}]
});
vm
.
licenseName
=
'
FOO
'
;
Vue
.
nextTick
(()
=>
{
const
feedbackElement
=
vm
.
$el
.
querySelectorAll
(
'
.text-secondary
'
);
expect
(
feedbackElement
[
0
].
innerText
.
trim
()).
toBe
(
'
Acceptable license to be used in the project
'
,
);
expect
(
feedbackElement
[
1
].
innerText
.
trim
()).
toBe
(
'
Disallow merge request if detected and will instruct developer to remove
'
,
);
done
();
});
});
it
(
'
does not show dropdown descriptions, if licenseComplianceDeniesMr feature flag is disabled
'
,
done
=>
{
vm
=
mountComponent
(
Component
,
{
managedLicenses
:
[{
name
:
'
FOO
'
}]
});
vm
.
licenseName
=
'
FOO
'
;
Vue
.
nextTick
(()
=>
{
const
feedbackElement
=
vm
.
$el
.
querySelectorAll
(
'
.text-secondary
'
);
expect
(
feedbackElement
.
length
).
toBe
(
0
);
done
();
});
});
it
(
'
disables submit, if the form is invalid
'
,
done
=>
{
vm
.
licenseName
=
''
;
Vue
.
nextTick
(()
=>
{
...
...
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