Commit f2c10787 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '267536-vsa-move-custom-value-stream-fields-to-component' into 'master'

Refactor custom stage form specs

See merge request gitlab-org/gitlab!49651
parents 0e949d15 3e5bccea
...@@ -138,7 +138,7 @@ export default { ...@@ -138,7 +138,7 @@ export default {
/> />
</gl-form-group> </gl-form-group>
</div> </div>
<div v-if="endEventRequiresLabel" class="w-50 ml-1"> <div v-if="endEventRequiresLabel" class="gl-w-half gl-ml-2">
<gl-form-group <gl-form-group
data-testid="custom-stage-end-event-label" data-testid="custom-stage-end-event-label"
:label="$options.I18N.FORM_FIELD_END_EVENT_LABEL" :label="$options.I18N.FORM_FIELD_END_EVENT_LABEL"
......
...@@ -172,7 +172,7 @@ export default { ...@@ -172,7 +172,7 @@ export default {
<div v-if="isLoading"> <div v-if="isLoading">
<gl-loading-icon class="mt-4" size="md" /> <gl-loading-icon class="mt-4" size="md" />
</div> </div>
<form v-else class="custom-stage-form m-4 mt-0"> <form v-else class="custom-stage-form m-4 gl-mt-0">
<div class="gl-mb-1 gl-display-flex gl-justify-content-space-between gl-align-items-center"> <div class="gl-mb-1 gl-display-flex gl-justify-content-space-between gl-align-items-center">
<h4>{{ formTitle }}</h4> <h4>{{ formTitle }}</h4>
<gl-dropdown <gl-dropdown
...@@ -191,7 +191,7 @@ export default { ...@@ -191,7 +191,7 @@ export default {
>{{ stage.title }}</gl-dropdown-item >{{ stage.title }}</gl-dropdown-item
> >
</template> </template>
<p v-else class="mx-3 my-2">{{ $options.I18N.RECOVER_STAGES_VISIBLE }}</p> <p v-else class="gl-mx-5 gl-my-3">{{ $options.I18N.RECOVER_STAGES_VISIBLE }}</p>
</gl-dropdown> </gl-dropdown>
</div> </div>
<custom-stage-form-fields <custom-stage-form-fields
...@@ -201,7 +201,7 @@ export default { ...@@ -201,7 +201,7 @@ export default {
:events="events" :events="events"
@update="handleUpdateFields" @update="handleUpdateFields"
/> />
<div class="custom-stage-form-actions"> <div>
<gl-button <gl-button
:disabled="!isDirty" :disabled="!isDirty"
category="primary" category="primary"
...@@ -221,7 +221,7 @@ export default { ...@@ -221,7 +221,7 @@ export default {
{{ saveStageText }} {{ saveStageText }}
</gl-button> </gl-button>
</div> </div>
<div class="mt-2"> <div class="gl-mt-3">
<gl-sprintf <gl-sprintf
:message=" :message="
__( __(
......
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`CustomStageForm Editing a custom stage isSavingCustomStage=true displays a loading icon 1`] = ` exports[`CustomStageForm Editing a custom stage isSavingCustomStage=true displays a loading icon 1`] = `
"<button data-testid=\\"save-custom-stage\\" type=\\"button\\" disabled=\\"disabled\\" class=\\"btn btn-success btn-md disabled gl-button\\"> "<gl-button-stub category=\\"primary\\" variant=\\"success\\" size=\\"medium\\" icon=\\"\\" buttontextclasses=\\"\\" disabled=\\"true\\" data-testid=\\"save-custom-stage\\">
<!----> <gl-loading-icon-stub label=\\"Loading\\" size=\\"sm\\" color=\\"dark\\" inline=\\"true\\"></gl-loading-icon-stub>
<!----> <span class=\\"gl-button-text\\"><span class=\\"gl-spinner-container\\"><span aria-label=\\"Loading\\" class=\\"align-text-bottom gl-spinner gl-spinner-dark gl-spinner-sm\\"></span></span>
Update stage Update stage
</span></button>" </gl-button-stub>"
`; `;
exports[`CustomStageForm isSavingCustomStage=true displays a loading icon 1`] = ` exports[`CustomStageForm isSavingCustomStage=true displays a loading icon 1`] = `
"<button data-testid=\\"save-custom-stage\\" type=\\"button\\" disabled=\\"disabled\\" class=\\"btn btn-success btn-md disabled gl-button\\"> "<gl-button-stub category=\\"primary\\" variant=\\"success\\" size=\\"medium\\" icon=\\"\\" buttontextclasses=\\"\\" disabled=\\"true\\" data-testid=\\"save-custom-stage\\">
<!----> <gl-loading-icon-stub label=\\"Loading\\" size=\\"sm\\" color=\\"dark\\" inline=\\"true\\"></gl-loading-icon-stub>
<!----> <span class=\\"gl-button-text\\"><span class=\\"gl-spinner-container\\"><span aria-label=\\"Loading\\" class=\\"align-text-bottom gl-spinner gl-spinner-dark gl-spinner-sm\\"></span></span>
Add stage Add stage
</span></button>" </gl-button-stub>"
`; `;
...@@ -91,7 +91,7 @@ describe('CustomStageFields', () => { ...@@ -91,7 +91,7 @@ describe('CustomStageFields', () => {
describe.each([ describe.each([
['Start event label', findStartEventLabel], ['Start event label', findStartEventLabel],
['End event label', findStartEventLabel], ['End event label', findEndEventLabel],
])('Default state', (field, finder) => { ])('Default state', (field, finder) => {
it(`field '${field}' is hidden by default`, () => { it(`field '${field}' is hidden by default`, () => {
expect(finder(wrapper).exists()).toBe(false); expect(finder(wrapper).exists()).toBe(false);
...@@ -172,7 +172,7 @@ describe('CustomStageFields', () => { ...@@ -172,7 +172,7 @@ describe('CustomStageFields', () => {
}); });
}); });
it('will display the start event label field if a label event is selected', () => { it('will display the end event label field if a label event is selected', () => {
expect(findEndEventLabel(wrapper).exists()).toEqual(true); expect(findEndEventLabel(wrapper).exists()).toEqual(true);
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment