Skip to content

Commit 4e02fbd

Browse files
authored
test(client-iam): check for IAM.getUser instead of listUsers (#1710)
The test fails if there are more than 100 users, as it parses users from first page of results. This code change explicitly requests for the created user to ensure it doesn't return pages of results.
1 parent 11bc793 commit 4e02fbd

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

Diff for: features/iam/iam.feature

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Feature: IAM
77
Scenario: Users
88
Given I have an IAM username "js-test"
99
And I create an IAM user with the username
10-
And I list the IAM users
11-
Then the list should contain the user
10+
And I get the IAM user
11+
Then the IAM user should exist
1212
And I delete the IAM user
1313

1414
Scenario: Roles

Diff for: features/iam/step_definitions/iam.js

+4-7
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,12 @@ Given("I create an IAM user with the username", function (callback) {
3131
);
3232
});
3333

34-
Given("I list the IAM users", function (callback) {
35-
this.request("iam", "listUsers", {}, callback);
34+
Given("I get the IAM user", function (callback) {
35+
this.request("iam", "getUser", { UserName: this.iamUser }, callback);
3636
});
3737

38-
Then("the list should contain the user", function (callback) {
39-
const name = this.iamUser;
40-
this.assert.contains(this.data.Users, function (user) {
41-
return user.UserName === name;
42-
});
38+
Then("the IAM user should exist", function (callback) {
39+
this.assert.equal(this.data.User.UserName, this.iamUser);
4340
callback();
4441
});
4542

0 commit comments

Comments
 (0)