Skip to content

Commit

Permalink
tests: add case for dismissing location prompt
Browse files Browse the repository at this point in the history
Signed-off-by: Trae Yelovich <[email protected]>
  • Loading branch information
traeok committed Oct 4, 2024
1 parent 5405165 commit ad87579
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,19 @@ describe("USS Action Unit Tests - Function createUSSNode", () => {
createApiMock.mockRestore();
});

it("returns early if a location was never provided", async () => {
const globalMocks = createGlobalMocks();
const blockMocks = createBlockMocks(globalMocks);

globalMocks.mockShowInputBox.mockResolvedValueOnce(undefined);
const createApiMock = jest.spyOn(blockMocks.ussApi, "create").mockImplementation();
blockMocks.ussNode.getParent().fullPath = "";

await USSActions.createUSSNode(blockMocks.ussNode.getParent(), blockMocks.testUSSTree, "directory");
expect(createApiMock).not.toHaveBeenCalled();
createApiMock.mockRestore();
});

it("Tests if createUSSNode is executed successfully with Unverified profile", async () => {
const globalMocks = createGlobalMocks();
const blockMocks = createBlockMocks(globalMocks);
Expand Down

0 comments on commit ad87579

Please sign in to comment.