Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/create_cluster/eks_cluster/store/actions_spec.js')
-rw-r--r--spec/frontend/create_cluster/eks_cluster/store/actions_spec.js28
1 files changed, 27 insertions, 1 deletions
diff --git a/spec/frontend/create_cluster/eks_cluster/store/actions_spec.js b/spec/frontend/create_cluster/eks_cluster/store/actions_spec.js
index f12f300872a..f14a555f357 100644
--- a/spec/frontend/create_cluster/eks_cluster/store/actions_spec.js
+++ b/spec/frontend/create_cluster/eks_cluster/store/actions_spec.js
@@ -186,7 +186,7 @@ describe('EKS Cluster Store Actions', () => {
role_external_id: payload.externalId,
region: DEFAULT_REGION,
})
- .reply(400, error);
+ .reply(400, null);
});
it('dispatches createRoleError action', () =>
@@ -198,6 +198,32 @@ describe('EKS Cluster Store Actions', () => {
[{ type: 'requestCreateRole' }, { type: 'createRoleError', payload: { error } }],
));
});
+
+ describe('when request fails with a message', () => {
+ beforeEach(() => {
+ const errResp = { message: 'Something failed' };
+
+ mock
+ .onPost(state.createRolePath, {
+ role_arn: payload.roleArn,
+ role_external_id: payload.externalId,
+ region: DEFAULT_REGION,
+ })
+ .reply(4, errResp);
+ });
+
+ it('dispatches createRoleError action', () =>
+ testAction(
+ actions.createRole,
+ payload,
+ state,
+ [],
+ [
+ { type: 'requestCreateRole' },
+ { type: 'createRoleError', payload: { error: 'Something failed' } },
+ ],
+ ));
+ });
});
describe('requestCreateRole', () => {