Skip to content

Commit

Permalink
Changelog Updated
Browse files Browse the repository at this point in the history
Signed-off-by: likhithanimma1 <[email protected]>
  • Loading branch information
likhithanimma1 committed Jan 12, 2025
1 parent ce768bf commit d8edfaa
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 8 deletions.
1 change: 1 addition & 0 deletions packages/zowe-explorer-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ All notable changes to the "zowe-explorer-api" extension will be documented in t
- Added optional `setEncoding`, `getEncoding`, and `getEncodingInMap` functions to the `IZoweJobTreeNode` interface. [#3361](https://github.com/zowe/zowe-explorer-vscode/pull/3361)
- Added an `AuthHandler` class with functions for locking/unlocking profiles, prompting for credentials and SSO login support. Extenders can now lock profiles after an authentication error, ensuring that an invalid profile is not used asynchronously until the error is resolved. [#3329](https://github.com/zowe/zowe-explorer-vscode/issues/3329)
- Added individual user settings for MVS, TSO, and Unix commands. [#3079](https://github.com/zowe/zowe-explorer-vscode/pull/3079)
- Added new `copyDataSetCrossLpar` API to provide ability to copy/paste datasets cross lpars. [#3012](https://github.com/zowe/zowe-explorer-vscode/issues/3012)

### Bug fixes

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 @@ -19,6 +19,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen
- You can now add multiple partitioned data sets or USS directories to your workspace at once using the "Add to Workspace" feature. [#3324](https://github.com/zowe/zowe-explorer-vscode/issues/3324)
- Exposed read and write access to local storage keys for Zowe Explorer extenders. [#3180](https://github.com/zowe/zowe-explorer-vscode/issues/3180)
- Added `Open with Encoding` to the context menu of Job Spool files. [#1941](https://github.com/zowe/zowe-explorer-vscode/issues/1941)
- Implemented copy/paste functionality of datasets within and cross lpars. [#3012](https://github.com/zowe/zowe-explorer-vscode/issues/3012)

### Bug fixes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,39 @@ describe("Dataset Actions Unit Tests - Function pasteDataSet", () => {
await expect(DatasetActions.pasteDataSet(blockMocks.testDatasetTree, node)).resolves.not.toThrow();
});

it("If isCancellationRequested is true", async () => {
const globalMocks = createGlobalMocks();
const blockMocks = createBlockMocks();
const node = new ZoweDatasetNode({
label: "HLQ.TEST.DATASET",
collapsibleState: vscode.TreeItemCollapsibleState.None,
parentNode: blockMocks.datasetSessionNode,
});
node.contextValue = Constants.DS_DS_CONTEXT;
clipboard.writeText(
JSON.stringify([
{
dataSetName: "HLQ.TEST.BEFORE.NODE",
profileName: "sestest1",
contextValue: Constants.DS_DS_CONTEXT,
},
])
);
mocked(vscode.window.withProgress).mockImplementation((progLocation, callback) => {
const progress = {
report: jest.fn(),
};
const token = {
isCancellationRequested: true,
onCancellationRequested: jest.fn(),
};
return callback(progress, token);
});
globalMocks.showInputBox.mockResolvedValueOnce("CopyNode");
jest.spyOn(DatasetActions, "determineReplacement").mockResolvedValueOnce("notFound");
await expect(DatasetActions.pasteDataSet(blockMocks.testDatasetTree, node)).resolves.not.toThrow();
});

it("Testing copyPartitionedDatasets() successfully runs within same profile", async () => {
createGlobalMocks();
const blockMocks = createBlockMocks();
Expand Down Expand Up @@ -1504,7 +1537,47 @@ describe("Dataset Actions Unit Tests - Function pasteDataSet", () => {
await expect(DatasetActions.pasteDataSet(blockMocks.testDatasetTree, dsNode)).resolves.not.toThrow();
});

it("Testing copyDatasetMembers() succesfully runs on same profile", async () => {
it("Testing isCancellationRequested true on copyPartitionedDatasets()", async () => {
const globalMocks = createGlobalMocks();
const blockMocks = createBlockMocks();
const parentNode = new ZoweDatasetNode({
label: "parent",
collapsibleState: vscode.TreeItemCollapsibleState.None,
parentNode: blockMocks.datasetSessionNode,
});
const dsNode = new ZoweDatasetNode({
label: "dsNode",
collapsibleState: vscode.TreeItemCollapsibleState.Expanded,
parentNode,
session: blockMocks.zosmfSession,
profile: blockMocks.imperativeProfile,
});
dsNode.contextValue = Constants.DS_PDS_CONTEXT;
clipboard.writeText(
JSON.stringify([
{
dataSetName: "HLQ.TEST.BEFORE.NODE",
profileName: "sestest1",
contextValue: Constants.DS_PDS_CONTEXT,
},
])
);
mocked(vscode.window.withProgress).mockImplementation((progLocation, callback) => {
const progress = {
report: jest.fn(),
};
const token = {
isCancellationRequested: true,
onCancellationRequested: jest.fn(),
};
return callback(progress, token);
});
globalMocks.showInputBox.mockResolvedValueOnce("pdsTest");
jest.spyOn(DatasetActions, "determineReplacement").mockResolvedValueOnce("notFound");
await expect(DatasetActions.pasteDataSet(blockMocks.testDatasetTree, dsNode)).resolves.not.toThrow();
});

it("Testing copyDatasetMembers() succesfully runs", async () => {
createGlobalMocks();
const blockMocks = createBlockMocks();
const memberNode = new ZoweDatasetNode({
Expand Down Expand Up @@ -1545,8 +1618,18 @@ describe("Dataset Actions Unit Tests - Function pasteDataSet", () => {
});
jest.spyOn(DatasetActions, "determineReplacement").mockResolvedValueOnce("notFound");
await expect(DatasetActions.pasteDataSet(blockMocks.testDatasetTree, memberNode)).resolves.not.toThrow();
});

//for cross lpar copy paste of members
it("Testing copyDatasetMembers() succesfully runs on cross profile", async () => {
createGlobalMocks();
const blockMocks = createBlockMocks();
const memberNode = new ZoweDatasetNode({
label: "memberNode",
collapsibleState: vscode.TreeItemCollapsibleState.None,
parentNode: blockMocks.pdsSessionNode,
profile: blockMocks.imperativeProfile,
});
memberNode.contextValue = Constants.DS_MEMBER_CONTEXT;
clipboard.writeText(
JSON.stringify([
{
Expand All @@ -1556,6 +1639,21 @@ describe("Dataset Actions Unit Tests - Function pasteDataSet", () => {
},
])
);
mocked(vscode.window.showInputBox).mockImplementationOnce((options) => {
options.validateInput("pdsTest");
return Promise.resolve("pdsTest");
});
mocked(vscode.window.withProgress).mockImplementation((progLocation, callback) => {
const progress = {
report: jest.fn(),
};
const token = {
isCancellationRequested: false,
onCancellationRequested: jest.fn(),
};
return callback(progress, token);
});
jest.spyOn(DatasetActions, "determineReplacement").mockResolvedValueOnce("notFound");
const copySpyCrossLpar = jest.spyOn(blockMocks.mvsApi, "copyDataSetCrossLpar");
copySpyCrossLpar.mockResolvedValue({
success: true,
Expand All @@ -1565,7 +1663,7 @@ describe("Dataset Actions Unit Tests - Function pasteDataSet", () => {
await expect(DatasetActions.pasteDataSet(blockMocks.testDatasetTree, memberNode)).resolves.not.toThrow();
});

it("Testing copyDatasetMembers() succesfully runs on cross profile", async () => {
it("if isCancellationRequested is true for copyDatasetMembers()", async () => {
createGlobalMocks();
const blockMocks = createBlockMocks();
const memberNode = new ZoweDatasetNode({
Expand Down Expand Up @@ -1593,17 +1691,16 @@ describe("Dataset Actions Unit Tests - Function pasteDataSet", () => {
report: jest.fn(),
};
const token = {
isCancellationRequested: false,
isCancellationRequested: true,
onCancellationRequested: jest.fn(),
};
return callback(progress, token);
});
jest.spyOn(DatasetActions, "determineReplacement").mockResolvedValueOnce("notFound");
const copySpyCrossLpar = jest.spyOn(blockMocks.mvsApi, "copyDataSetCrossLpar");
copySpyCrossLpar.mockResolvedValue({
const allmembersspy = jest.spyOn(blockMocks.mvsApi, "allMembers");
allmembersspy.mockResolvedValue({
success: true,
commandResponse: "",
apiResponse: {},
apiResponse: { items: [{ member: "PDSTEST" }] },
});
await expect(DatasetActions.pasteDataSet(blockMocks.testDatasetTree, memberNode)).resolves.not.toThrow();
});
Expand Down Expand Up @@ -1728,6 +1825,18 @@ describe("Dataset Actions Unit Tests - Function pasteDataSet", () => {
const errorSpy = jest.spyOn(Gui, "errorMessage").mockResolvedValue("Not supported");
await expect(DatasetActions.pasteDataSet(blockMocks.testDatasetTree, node)).resolves.not.toThrow();
expect(errorSpy).toHaveBeenCalled();

//for partitioned
clipboard.writeText(
JSON.stringify([
{
dataSetName: "HLQ.TEST.BEFORE.NODE",
profileName: "sestest1",
contextValue: Constants.DS_PDS_CONTEXT,
},
])
);
await expect(DatasetActions.pasteDataSet(blockMocks.testDatasetTree, node)).resolves.not.toThrow();
});
});

Expand Down

0 comments on commit d8edfaa

Please sign in to comment.