Commit 62d07844 authored by Vitaly Slobodin's avatar Vitaly Slobodin

Merge branch '229211-knative-domain-loading-button' into 'master'

Migrate knative domain loading button

Closes #229211

See merge request gitlab-org/gitlab!39774
parents 81c86e6d cbb53c38
...@@ -6,8 +6,8 @@ import { ...@@ -6,8 +6,8 @@ import {
GlLoadingIcon, GlLoadingIcon,
GlSearchBoxByType, GlSearchBoxByType,
GlSprintf, GlSprintf,
GlButton,
} from '@gitlab/ui'; } from '@gitlab/ui';
import LoadingButton from '~/vue_shared/components/loading_button.vue';
import ClipboardButton from '../../vue_shared/components/clipboard_button.vue'; import ClipboardButton from '../../vue_shared/components/clipboard_button.vue';
import { __, s__ } from '~/locale'; import { __, s__ } from '~/locale';
...@@ -17,7 +17,7 @@ const { UPDATING, UNINSTALLING } = APPLICATION_STATUS; ...@@ -17,7 +17,7 @@ const { UPDATING, UNINSTALLING } = APPLICATION_STATUS;
export default { export default {
components: { components: {
LoadingButton, GlButton,
ClipboardButton, ClipboardButton,
GlLoadingIcon, GlLoadingIcon,
GlDeprecatedDropdown, GlDeprecatedDropdown,
...@@ -215,13 +215,16 @@ export default { ...@@ -215,13 +215,16 @@ export default {
}} }}
</p> </p>
<loading-button <gl-button
class="btn-success js-knative-save-domain-button mt-3 ml-3" class="js-knative-save-domain-button gl-mt-5 gl-ml-5"
variant="success"
category="primary"
:loading="saving" :loading="saving"
:disabled="saveButtonDisabled" :disabled="saveButtonDisabled"
:label="saveButtonLabel"
@click="$emit('save')" @click="$emit('save')"
/> >
{{ saveButtonLabel }}
</gl-button>
</template> </template>
</div> </div>
</template> </template>
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlDeprecatedDropdownItem } from '@gitlab/ui'; import { GlDeprecatedDropdownItem, GlButton } from '@gitlab/ui';
import KnativeDomainEditor from '~/clusters/components/knative_domain_editor.vue'; import KnativeDomainEditor from '~/clusters/components/knative_domain_editor.vue';
import LoadingButton from '~/vue_shared/components/loading_button.vue';
import { APPLICATION_STATUS } from '~/clusters/constants'; import { APPLICATION_STATUS } from '~/clusters/constants';
const { UPDATING } = APPLICATION_STATUS; const { UPDATING } = APPLICATION_STATUS;
...@@ -79,7 +78,7 @@ describe('KnativeDomainEditor', () => { ...@@ -79,7 +78,7 @@ describe('KnativeDomainEditor', () => {
}); });
it('triggers save event and pass current knative hostname', () => { it('triggers save event and pass current knative hostname', () => {
wrapper.find(LoadingButton).vm.$emit('click'); wrapper.find(GlButton).vm.$emit('click');
return wrapper.vm.$nextTick().then(() => { return wrapper.vm.$nextTick().then(() => {
expect(wrapper.emitted('save').length).toEqual(1); expect(wrapper.emitted('save').length).toEqual(1);
}); });
...@@ -166,15 +165,15 @@ describe('KnativeDomainEditor', () => { ...@@ -166,15 +165,15 @@ describe('KnativeDomainEditor', () => {
}); });
it('renders loading spinner in save button', () => { it('renders loading spinner in save button', () => {
expect(wrapper.find(LoadingButton).props('loading')).toBe(true); expect(wrapper.find(GlButton).props('loading')).toBe(true);
}); });
it('renders disabled save button', () => { it('renders disabled save button', () => {
expect(wrapper.find(LoadingButton).props('disabled')).toBe(true); expect(wrapper.find(GlButton).props('disabled')).toBe(true);
}); });
it('renders save button with "Saving" label', () => { it('renders save button with "Saving" label', () => {
expect(wrapper.find(LoadingButton).props('label')).toBe('Saving'); expect(wrapper.find(GlButton).text()).toBe('Saving');
}); });
}); });
}); });
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