Skip to content

Commit

Permalink
adjust system test logic to match actual apiResponse
Browse files Browse the repository at this point in the history
Signed-off-by: Trae Yelovich <[email protected]>
  • Loading branch information
traeok committed Jan 15, 2025
1 parent e2d8735 commit d654e2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ describe("List command group", () => {
expect(error).toBeFalsy();
expect(response).toBeTruthy();
expect(response.success).toBeTruthy();
expect(response.commandResponse).toBe("1 members(s) were found matching pattern.");
expect(response.commandResponse).toBe(null);
expect(response.apiResponse.items.length).toBe(1);
expect(response.apiResponse.items[0].dsname).toEqual(dsname);
});
Expand Down Expand Up @@ -815,8 +815,8 @@ describe("List command group", () => {
expect(response).toBeTruthy();
expect(response.success).toBeTruthy();
expect(response.commandResponse).toBe("1 members(s) were found matching pattern.");
expect(response.apiResponse.items.length).toBe(1);
expect(response.apiResponse.items[0].member).toEqual(members[0]);
expect(response.apiResponse.length).toBe(1);
expect(response.apiResponse[0].member).toEqual(members[0]);
});

it("should return a list starting with the given member in the start option", async () => {
Expand All @@ -834,8 +834,9 @@ describe("List command group", () => {
expect(response).toBeTruthy();
expect(response.success).toBeTruthy();
expect(response.commandResponse).toBe("3 members(s) were found matching pattern.");
expect(response.apiResponse.items.length).toBe(3);
expect(response.apiResponse.items[0].member).toEqual(members[1]);
console.log(JSON.stringify(response.apiResponse.items));
expect(response.apiResponse.length).toBe(3);
expect(response.apiResponse[0].member).toEqual(members[1]);
});
});

Expand Down
2 changes: 1 addition & 1 deletion packages/zosfiles/src/methods/list/List.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export class List {

// Exclude names of members
for (const pattern of options.excludePatterns || []) {
const response = await List.allMembers(session, dataSetName, {pattern});
const response = await List.allMembers(session, dataSetName, { pattern });
response.apiResponse.items.forEach((membersObj: IZosmfListResponse) => {
const responseIndex = zosmfResponses.findIndex(response=> response.member === membersObj.member);
if (responseIndex !== -1) {
Expand Down

0 comments on commit d654e2b

Please sign in to comment.