Skip to content

Commit

Permalink
fix refresh and add refresh tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip-Carneiro-KX committed May 23, 2024
1 parent b0a830d commit 24ec222
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions test/suite/services.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ describe("connectionManagerService", () => {
});
});

describe("refreshGetMetas", () => {
describe("refreshAllGetMetas && refreshGetMeta", () => {
let getMetaStub: sinon.SinonStub;
beforeEach(() => {
getMetaStub = sinon.stub(insightsConn, "getMeta");
Expand All @@ -1063,14 +1063,24 @@ describe("connectionManagerService", () => {
ext.connectedConnectionList.length = 0;
});

it("Should not refresh getMetas if connection is not InsightsConnection", async () => {
await connectionManagerService.refreshGetMetas();
it("Should not refreshAllgetMetas if connection is not InsightsConnection", async () => {
await connectionManagerService.refreshAllGetMetas();
sinon.assert.notCalled(getMetaStub);
});

it("Should refresh getMetas if connection is InsightsConnection", async () => {
it("Should refreshAllgetMetas if connection is InsightsConnection", async () => {
ext.connectedConnectionList.push(insightsConn);
await connectionManagerService.refreshGetMetas();
await connectionManagerService.refreshAllGetMetas();
sinon.assert.calledOnce(getMetaStub);
});
it("Should not refreshGetMeta if connection is not InsightsConnection", async () => {
await connectionManagerService.refreshGetMeta("test");
sinon.assert.notCalled(getMetaStub);
});

it("Should refreshGetMeta if connection is InsightsConnection", async () => {
ext.connectedConnectionList.push(insightsConn);
await connectionManagerService.refreshGetMeta(insightsConn.connLabel);
sinon.assert.calledOnce(getMetaStub);
});
});
Expand Down

0 comments on commit 24ec222

Please sign in to comment.