Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/maintenance' into check-creds-bug
Browse files Browse the repository at this point in the history
Signed-off-by: Billie Simmons <[email protected]>
  • Loading branch information
JillieBeanSim committed Jul 25, 2023
2 parents 255f498 + 53eed46 commit 9833349
Show file tree
Hide file tree
Showing 8 changed files with 192 additions and 82 deletions.
7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"vscode": "^1.53.2"
},
"dependencies": {
"@zowe/cli": "7.16.2",
"@zowe/cli": "7.16.6",
"vscode-nls": "4.1.2"
},
"devDependencies": {
Expand Down Expand Up @@ -45,11 +45,6 @@
"vscode-test": "^1.4.0",
"yarn": "1.22.19"
},
"resolutions": {
"**/json5": "^2.2.2",
"**/optionator": "^0.9.3",
"**/semver": "^7.5.2"
},
"scripts": {
"clean": "yarn workspaces run clean",
"fresh-clone": "yarn workspaces run fresh-clone && rimraf node_modules",
Expand Down
2 changes: 1 addition & 1 deletion packages/zowe-explorer-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@types/semver": "^7.5.0"
},
"dependencies": {
"@zowe/cli": "^7.16.2",
"@zowe/cli": "^7.16.6",
"semver": "^7.5.3"
},
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions packages/zowe-explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen
- Added jobs not found message when no results are returned from filter [#2362](https://github.com/zowe/vscode-extension-for-zowe/issues/2362)
- Fixed loop when user selects Cancel on the Check Credentials message. [#2262](https://github.com/zowe/vscode-extension-for-zowe/issues/2262)
- Fixed issue where job session nodes were not adding new job nodes when refreshed. [#2370](https://github.com/zowe/vscode-extension-for-zowe/issues/2370)
- Fixed error when listing data set members that include control characters in the name.

## `2.9.1`

Expand Down
42 changes: 41 additions & 1 deletion packages/zowe-explorer/__tests__/__unit__/ZoweNode.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,50 @@ describe("Unit Tests (Jest)", () => {
expect((await pds.getChildren())[0].label).toEqual("BRTVS99");
});

/*************************************************************************************************************
* Multiple member names returned
*************************************************************************************************************/
it("Testing what happens when response has multiple members", async () => {
Object.defineProperty(Profiles, "getInstance", {
value: jest.fn(() => {
return {
loadNamedProfile: jest.fn().mockReturnValue(profileOne),
};
}),
});
// Creating a rootNode
const pds = new ZoweDatasetNode(
"[root]: something",
vscode.TreeItemCollapsibleState.Collapsed,
{ getSessionNode: jest.fn() } as unknown as ZoweDatasetNode,
session,
undefined,
undefined,
profileOne
);
pds.dirty = true;
pds.contextValue = globals.DS_PDS_CONTEXT;
const allMembers = jest.fn();
allMembers.mockImplementationOnce(() => {
return {
success: true,
apiResponse: {
items: [{ member: "BADMEM\ufffd" }, { member: "GOODMEM1" }],
},
};
});
Object.defineProperty(List, "allMembers", { value: allMembers });
const pdsChildren = await pds.getChildren();
expect(pdsChildren[0].label).toEqual("BADMEM\ufffd");
expect(pdsChildren[0].contextValue).toEqual(globals.DS_FILE_ERROR_CONTEXT);
expect(pdsChildren[1].label).toEqual("GOODMEM1");
expect(pdsChildren[1].contextValue).toEqual(globals.DS_MEMBER_CONTEXT);
});

/*************************************************************************************************************
* No values returned
*************************************************************************************************************/
it("Testing what happens when response is zero", async () => {
it("Testing what happens when response has no members", async () => {
Object.defineProperty(Profiles, "getInstance", {
value: jest.fn(() => {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ describe("Dataset Tree Unit Tests - Function getChildren", () => {
expect(children).toEqual(sampleChildren);
spyOnDataSetsMatchingPattern.mockRestore();
});
it("Checking that we fallback to old dataSet API if newer dataSetsMattchingPattern does not exist", async () => {
it("Checking that we fallback to old dataSet API if newer dataSetsMatchingPattern does not exist", async () => {
createGlobalMocks();
const blockMocks = createBlockMocks();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"getChildren.search": "Use the search button to display data sets",
"getChildren.error.invalidNode": "Invalid node",
"getChildren.responses.error": "The response from Zowe CLI was not successful",
"getChildren.invalidMember": "Cannot access member with control characters in the name: {0}",
"getChildren.noDataset": "No data sets found"
}
11 changes: 9 additions & 2 deletions packages/zowe-explorer/src/dataset/ZoweDatasetNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,16 +216,23 @@ export class ZoweDatasetNode extends ZoweTreeNode implements IZoweDatasetTreeNod
elementChildren[temp.label.toString()] = temp;
} else {
// Creates a ZoweDatasetNode for a PDS member
const memberInvalid = item.member?.includes("\ufffd");
const temp = new ZoweDatasetNode(
item.member,
vscode.TreeItemCollapsibleState.None,
this,
null,
undefined,
memberInvalid ? globals.DS_FILE_ERROR_CONTEXT : undefined,
undefined,
this.getProfile()
);
temp.command = { command: "zowe.ds.ZoweNode.openPS", title: "", arguments: [temp] };
if (!memberInvalid) {
temp.command = { command: "zowe.ds.ZoweNode.openPS", title: "", arguments: [temp] };
} else {
temp.errorDetails = new zowe.imperative.ImperativeError({
msg: localize("getChildren.invalidMember", "Cannot access member with control characters in the name: {0}", item.member),
});
}
elementChildren[temp.label.toString()] = temp;
}
}
Expand Down
Loading

0 comments on commit 9833349

Please sign in to comment.