diff options
Diffstat (limited to 'spec/frontend/monitoring/store/actions_spec.js')
-rw-r--r-- | spec/frontend/monitoring/store/actions_spec.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/frontend/monitoring/store/actions_spec.js b/spec/frontend/monitoring/store/actions_spec.js index 7c559aed2c5..b37c10791bf 100644 --- a/spec/frontend/monitoring/store/actions_spec.js +++ b/spec/frontend/monitoring/store/actions_spec.js @@ -6,6 +6,7 @@ import statusCodes from '~/lib/utils/http_status'; import * as commonUtils from '~/lib/utils/common_utils'; import createFlash from '~/flash'; import { defaultTimeRange } from '~/vue_shared/constants'; +import { ENVIRONMENT_AVAILABLE_STATE } from '~/monitoring/constants'; import store from '~/monitoring/stores'; import * as types from '~/monitoring/stores/mutation_types'; @@ -157,17 +158,21 @@ describe('Monitoring store actions', () => { variables: { projectPath: state.projectPath, search: searchTerm, + states: [ENVIRONMENT_AVAILABLE_STATE], }, }; state.environmentsSearchTerm = searchTerm; - mockMutate.mockReturnValue(Promise.resolve()); + mockMutate.mockResolvedValue({}); return testAction( fetchEnvironmentsData, null, state, [], - [{ type: 'requestEnvironmentsData' }, { type: 'receiveEnvironmentsDataFailure' }], + [ + { type: 'requestEnvironmentsData' }, + { type: 'receiveEnvironmentsDataSuccess', payload: [] }, + ], () => { expect(mockMutate).toHaveBeenCalledWith(mutationVariables); }, |