diff options
Diffstat (limited to 'spec/frontend/clusters/clusters_bundle_spec.js')
-rw-r--r-- | spec/frontend/clusters/clusters_bundle_spec.js | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/spec/frontend/clusters/clusters_bundle_spec.js b/spec/frontend/clusters/clusters_bundle_spec.js index 317d3f3012b..199e11401a9 100644 --- a/spec/frontend/clusters/clusters_bundle_spec.js +++ b/spec/frontend/clusters/clusters_bundle_spec.js @@ -286,16 +286,21 @@ describe('Clusters', () => { }); describe('installApplication', () => { - it.each(APPLICATIONS)('tries to install %s', applicationId => { - jest.spyOn(cluster.service, 'installApplication').mockResolvedValueOnce(); + it.each(APPLICATIONS)('tries to install %s', (applicationId, done) => { + jest.spyOn(cluster.service, 'installApplication').mockResolvedValue(); cluster.store.state.applications[applicationId].status = INSTALLABLE; - cluster.installApplication({ id: applicationId }); - - expect(cluster.store.state.applications[applicationId].status).toEqual(INSTALLING); - expect(cluster.store.state.applications[applicationId].requestReason).toEqual(null); - expect(cluster.service.installApplication).toHaveBeenCalledWith(applicationId, undefined); + // eslint-disable-next-line promise/valid-params + cluster + .installApplication({ id: applicationId }) + .then(() => { + expect(cluster.store.state.applications[applicationId].status).toEqual(INSTALLING); + expect(cluster.store.state.applications[applicationId].requestReason).toEqual(null); + expect(cluster.service.installApplication).toHaveBeenCalledWith(applicationId, undefined); + done(); + }) + .catch(); }); it('sets error request status when the request fails', () => { |