Skip to content

Commit

Permalink
Updated runAction() test references to re-located functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
barnettwilliam committed Mar 22, 2024
1 parent cfdfaba commit 313b3ad
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions platform/test/spec/testEducationPlatformAppSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,20 @@ describe("EducationPlatformApp", () => {
platform.activityManager = activityManagerSpy;

// tools manager
let toolsManagerSpy = jasmine.createSpyObj(['getActionFunction']);
let toolsManagerSpy = jasmine.createSpyObj(['getActionFunction', 'invokeActionFunction']);
toolsManagerSpy.getActionFunction.and.returnValue(new ActionFunction({
parameters: [
{name: "language", type: "text"}
]
}));
platform.toolsManager = toolsManagerSpy;

// platform - invoke action function

invokeReturnedPromise = new Promise(function(resolve) {
resolve(true);
})
spyInvokeActionFunction = spyOn(EducationPlatformApp.prototype, "invokeActionFunction").and.returnValue(invokeReturnedPromise);

spyInvokeActionFunction = toolsManagerSpy.invokeActionFunction.and.returnValue(invokeReturnedPromise);

platform.toolsManager = toolsManagerSpy;

// platform - handle response
spyOn(EducationPlatformApp.prototype, "handleResponseActionFunction");

Expand All @@ -87,7 +87,7 @@ describe("EducationPlatformApp", () => {
platform.runAction(PANEL_ID, BUTTON_ID);

// Check the expected results
expect(platform.invokeActionFunction).toHaveBeenCalledWith(
expect(platform.toolsManager.invokeActionFunction).toHaveBeenCalledWith(
jasmine.anything(), jasmine.mapContaining( new Map([expectedLanguageEntry]) )
);
})
Expand All @@ -102,7 +102,7 @@ describe("EducationPlatformApp", () => {
platform.runAction(PANEL_ID, BUTTON_ID);

// Check the expected results
expect(platform.invokeActionFunction).toHaveBeenCalledWith(ACTION_FUNCTION_ID, expectedParamMap);
expect(platform.toolsManager.invokeActionFunction).toHaveBeenCalledWith(ACTION_FUNCTION_ID, expectedParamMap);
})

it("calls handleResponseActionFunction with the current action and the invoked function's result promise", () => {
Expand Down

0 comments on commit 313b3ad

Please sign in to comment.