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
0574f7f6
Commit
0574f7f6
authored
Aug 13, 2020
by
Suzanne Selhorn
Committed by
Andrew Fontaine
Aug 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated gl-deprecated-button to gl-button
Related to:
https://gitlab.com/gitlab-org/gitlab/-/issues/219814
parent
db4ed7aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
21 deletions
+20
-21
app/assets/javascripts/ci_variable_list/components/ci_variable_modal.vue
...scripts/ci_variable_list/components/ci_variable_modal.vue
+7
-8
spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js
...end/ci_variable_list/components/ci_variable_modal_spec.js
+13
-13
No files found.
app/assets/javascripts/ci_variable_list/components/ci_variable_modal.vue
View file @
0574f7f6
...
...
@@ -3,7 +3,6 @@ import {
GlAlert
,
GlButton
,
GlCollapse
,
GlDeprecatedButton
,
GlFormCheckbox
,
GlFormCombobox
,
GlFormGroup
,
...
...
@@ -39,7 +38,6 @@ export default {
GlAlert
,
GlButton
,
GlCollapse
,
GlDeprecatedButton
,
GlFormCheckbox
,
GlFormCombobox
,
GlFormGroup
,
...
...
@@ -340,24 +338,25 @@ export default {
</gl-alert>
</gl-collapse>
<
template
#modal-footer
>
<gl-
deprecated-button
@
click=
"hideModal"
>
{{
__
(
'
Cancel
'
)
}}
</gl-deprecated
-button>
<gl-
deprecated-
button
<gl-
button
@
click=
"hideModal"
>
{{
__
(
'
Cancel
'
)
}}
</gl
-button>
<gl-button
v-if=
"variableBeingEdited"
ref=
"deleteCiVariable"
category=
"secondary"
variant=
"danger"
category=
"secondary"
data-qa-selector=
"ci_variable_delete_button"
@
click=
"deleteVarAndClose"
>
{{
__
(
'
Delete variable
'
)
}}
</gl-
deprecated-
button
>
{{
__
(
'
Delete variable
'
)
}}
</gl-button
>
<gl-
deprecated-
button
<gl-button
ref=
"updateOrAddVariable"
:disabled=
"!canSubmit"
variant=
"success"
category=
"primary"
data-qa-selector=
"ci_variable_save_button"
@
click=
"updateOrAddVariable"
>
{{
modalActionText
}}
</gl-
deprecated-
button>
</gl-button>
</
template
>
</gl-modal>
</template>
spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js
View file @
0574f7f6
import
Vuex
from
'
vuex
'
;
import
{
createLocalVue
,
shallowMount
,
mount
}
from
'
@vue/test-utils
'
;
import
{
Gl
Deprecated
Button
,
GlFormCombobox
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlFormCombobox
}
from
'
@gitlab/ui
'
;
import
{
AWS_ACCESS_KEY_ID
}
from
'
~/ci_variable_list/constants
'
;
import
CiVariableModal
from
'
~/ci_variable_list/components/ci_variable_modal.vue
'
;
import
createStore
from
'
~/ci_variable_list/store
'
;
...
...
@@ -29,14 +29,14 @@ describe('Ci variable modal', () => {
};
const
findModal
=
()
=>
wrapper
.
find
(
ModalStub
);
const
addOrUpdateButton
=
index
=>
const
findAddorUpdateButton
=
()
=>
findModal
()
.
findAll
(
Gl
Deprecated
Button
)
.
at
(
index
);
.
findAll
(
GlButton
)
.
wrappers
.
find
(
button
=>
button
.
props
(
'
variant
'
)
===
'
success
'
);
const
deleteVariableButton
=
()
=>
findModal
()
.
findAll
(
Gl
Deprecated
Button
)
.
at
(
1
);
.
findAll
(
GlButton
)
.
wrappers
.
find
(
button
=>
button
.
props
(
'
variant
'
)
===
'
danger
'
);
afterEach
(()
=>
{
wrapper
.
destroy
();
...
...
@@ -69,7 +69,7 @@ describe('Ci variable modal', () => {
});
it
(
'
button is disabled when no key/value pair are present
'
,
()
=>
{
expect
(
addOrUpdateButton
(
1
).
attributes
(
'
disabled
'
)).
toBeTruthy
();
expect
(
findAddorUpdateButton
(
).
attributes
(
'
disabled
'
)).
toBeTruthy
();
});
});
...
...
@@ -82,11 +82,11 @@ describe('Ci variable modal', () => {
});
it
(
'
button is enabled when key/value pair are present
'
,
()
=>
{
expect
(
addOrUpdateButton
(
1
).
attributes
(
'
disabled
'
)).
toBeFalsy
();
expect
(
findAddorUpdateButton
(
).
attributes
(
'
disabled
'
)).
toBeFalsy
();
});
it
(
'
Add variable button dispatches addVariable action
'
,
()
=>
{
addOrUpdateButton
(
1
).
vm
.
$emit
(
'
click
'
);
findAddorUpdateButton
(
).
vm
.
$emit
(
'
click
'
);
expect
(
store
.
dispatch
).
toHaveBeenCalledWith
(
'
addVariable
'
);
});
...
...
@@ -152,11 +152,11 @@ describe('Ci variable modal', () => {
});
it
(
'
button text is Update variable when updating
'
,
()
=>
{
expect
(
addOrUpdateButton
(
2
).
text
()).
toBe
(
'
Update variable
'
);
expect
(
findAddorUpdateButton
(
).
text
()).
toBe
(
'
Update variable
'
);
});
it
(
'
Update variable button dispatches updateVariable with correct variable
'
,
()
=>
{
addOrUpdateButton
(
2
).
vm
.
$emit
(
'
click
'
);
findAddorUpdateButton
(
).
vm
.
$emit
(
'
click
'
);
expect
(
store
.
dispatch
).
toHaveBeenCalledWith
(
'
updateVariable
'
);
});
...
...
@@ -189,7 +189,7 @@ describe('Ci variable modal', () => {
});
it
(
'
disables the submit button
'
,
()
=>
{
expect
(
addOrUpdateButton
(
1
).
attributes
(
'
disabled
'
)).
toBeTruthy
();
expect
(
findAddorUpdateButton
(
).
attributes
(
'
disabled
'
)).
toBeTruthy
();
});
it
(
'
shows the correct error text
'
,
()
=>
{
...
...
@@ -213,7 +213,7 @@ describe('Ci variable modal', () => {
});
it
(
'
does not disable the submit button
'
,
()
=>
{
expect
(
addOrUpdateButton
(
1
).
attributes
(
'
disabled
'
)).
toBeFalsy
();
expect
(
findAddorUpdateButton
(
).
attributes
(
'
disabled
'
)).
toBeFalsy
();
});
});
});
...
...
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