Skip to content
This repository has been archived by the owner on Sep 4, 2019. It is now read-only.

Initialized successHandled to false, added naming to spies for better un... #683

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/functional/automatic/blackberry.invoked.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ describe("blackberry.invoked", function () {
});

it("should sucessfully send and receive invocations", function () {
var successHandled = true,
onSuccess = jasmine.createSpy().andCallFake(function () { successHandled = true;}),
onError = jasmine.createSpy(),
var successHandled = false,
invocationHandled = false,
onSuccess = jasmine.createSpy('onSuccess').andCallFake(function () {successHandled = true;}),
onError = jasmine.createSpy('onError'),
invokedTarget, invokedType, invokedAction, invokedData;

blackberry.event.addEventListener("invoked", function (invocationInfo) {
Expand Down Expand Up @@ -52,7 +52,7 @@ describe("blackberry.invoked", function () {

waitsFor(function () {
return invocationHandled && successHandled;
}, "invocation handler did not finish", 1000);
}, "invocation handler did not finish or onSuccess callback was not called", 1000);

runs(function () {
expect(onSuccess).toHaveBeenCalled();
Expand Down