diff options
author | Jacques Erasmus <jerasmus@gitlab.com> | 2019-04-25 14:50:57 +0000 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2019-04-25 14:50:57 +0000 |
commit | 1dc5b6ab378caa4c61ad405080e276760a49b336 (patch) | |
tree | 9068db0b5ba1c1e05cef16985dd520a45b08a7a3 /spec | |
parent | 93f4e5e8b327758033347749009eeeeab27228af (diff) | |
download | gitlab-ce-1dc5b6ab378caa4c61ad405080e276760a49b336.tar.gz |
Implement toast component
Implemented the toast component for success messages
Diffstat (limited to 'spec')
-rw-r--r-- | spec/frontend/clusters/components/application_row_spec.js | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/spec/frontend/clusters/components/application_row_spec.js b/spec/frontend/clusters/components/application_row_spec.js index 038d2be9e98..d26fad54ebe 100644 --- a/spec/frontend/clusters/components/application_row_spec.js +++ b/spec/frontend/clusters/components/application_row_spec.js @@ -1,6 +1,11 @@ import Vue from 'vue'; import eventHub from '~/clusters/event_hub'; -import { APPLICATION_STATUS, REQUEST_SUBMITTED, REQUEST_FAILURE } from '~/clusters/constants'; +import { + APPLICATION_STATUS, + REQUEST_SUBMITTED, + REQUEST_FAILURE, + UPGRADE_REQUESTED, +} from '~/clusters/constants'; import applicationRow from '~/clusters/components/application_row.vue'; import mountComponent from 'helpers/vue_mount_component_helper'; import { DEFAULT_APPLICATION_STATE } from '../services/mock_data'; @@ -314,6 +319,22 @@ describe('Application Row', () => { 'Update failed. Please check the logs and try again.', ); }); + + it('displays a success toast message if application upgrade was successful', () => { + vm = mountComponent(ApplicationRow, { + ...DEFAULT_APPLICATION_STATE, + title: 'GitLab Runner', + requestStatus: UPGRADE_REQUESTED, + status: APPLICATION_STATUS.UPDATE_ERRORED, + }); + + vm.$toast = { show: jest.fn() }; + vm.status = APPLICATION_STATUS.UPDATED; + + vm.$nextTick(() => { + expect(vm.$toast.show).toHaveBeenCalledWith('GitLab Runner upgraded successfully.'); + }); + }); }); describe('Version', () => { |