summaryrefslogtreecommitdiff
path: root/spec/frontend/clusters/components/application_row_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/clusters/components/application_row_spec.js')
-rw-r--r--spec/frontend/clusters/components/application_row_spec.js23
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', () => {