Skip to content

Commit d5eec49

Browse files
author
Amit Joshi
committed
Fix command registration check in ActionsHubTreeDataProvider tests
1 parent 0871936 commit d5eec49

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/client/test/Integration/power-pages/actions-hub/ActionsHubTreeDataProvider.test.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,17 @@ describe("ActionsHubTreeDataProvider", () => {
269269

270270
expect(registerCommandStub.calledWith("microsoft.powerplatform.pages.actionsHub.currentActiveSite.runCodeQLScreening")).to.be.true;
271271

272-
await registerCommandStub.getCall(16).args[1]();
273-
expect(mockCommandHandler.calledOnce).to.be.true;
272+
// Find the CodeQL command in the registered commands
273+
const codeQLCall = registerCommandStub.getCalls().find(call =>
274+
call.args[0] === "microsoft.powerplatform.pages.actionsHub.currentActiveSite.runCodeQLScreening"
275+
);
276+
277+
if (codeQLCall) {
278+
await codeQLCall.args[1]();
279+
expect(mockCommandHandler.calledOnce).to.be.true;
280+
} else {
281+
throw new Error("CodeQL command was not registered");
282+
}
274283
});
275284
});
276285

0 commit comments

Comments
 (0)