From fb9d8b9b493c9f7f548876c0b63ac83c83c2cff1 Mon Sep 17 00:00:00 2001 From: Dennis Tang Date: Wed, 23 May 2018 19:59:32 +0200 Subject: [PATCH] use testAction for validateProjectBilling --- .../stores/actions_spec.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/spec/javascripts/projects/gke_cluster_dropdowns/stores/actions_spec.js b/spec/javascripts/projects/gke_cluster_dropdowns/stores/actions_spec.js index d9292abc5e8..46085fe97aa 100644 --- a/spec/javascripts/projects/gke_cluster_dropdowns/stores/actions_spec.js +++ b/spec/javascripts/projects/gke_cluster_dropdowns/stores/actions_spec.js @@ -69,14 +69,17 @@ describe('GCP Cluster Dropdown Store Actions', () => { describe('validateProjectBilling', () => { it('checks project billing status from Google API', done => { - store - .dispatch('validateProjectBilling') - .then(() => { - expect(store.state.projectHasBillingEnabled).toBeTruthy(); - - done(); - }) - .catch(done.fail); + testAction( + actions.validateProjectBilling, + true, + { + selectedProject: selectedProjectMock, + projectHasBillingEnabled: null, + }, + [{ type: 'SET_PROJECT_BILLING_STATUS', payload: true }], + [], + done, + ); }); });