Skip to content

Commit 504952e

Browse files
committed
fix: Legacy modules tests not passing
1 parent a35a211 commit 504952e

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
lines changed

dist/angular-meteor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@
602602
// Returns a callback which fulfills promise
603603
this.fulfill = function (deferred, boundError, boundResult) {
604604
return function (err, result) {
605-
if (err) deferred.reject(boundError === null ? err : boundError);else if (typeof boundResult == "function") deferred.resolve(boundResult === null ? result : boundResult(result));else deferred.resolve(boundResult === null ? result : boundResult);
605+
if (err) deferred.reject(boundError == null ? err : boundError);else if (typeof boundResult == "function") deferred.resolve(boundResult == null ? result : boundResult(result));else deferred.resolve(boundResult == null ? result : boundResult);
606606
};
607607
};
608608

src/modules/angular-meteor-utils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ angularMeteorUtils.service('$meteorUtils', [
5858
this.fulfill = function(deferred, boundError, boundResult) {
5959
return function(err, result) {
6060
if (err)
61-
deferred.reject(boundError === null ? err : boundError);
61+
deferred.reject(boundError == null ? err : boundError);
6262
else if (typeof boundResult == "function")
63-
deferred.resolve(boundResult === null ? result : boundResult(result));
63+
deferred.resolve(boundResult == null ? result : boundResult(result));
6464
else
65-
deferred.resolve(boundResult === null ? result : boundResult);
65+
deferred.resolve(boundResult == null ? result : boundResult);
6666
};
6767
};
6868

tests/integration/pre1.3/angular-meteor-collection-spec.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -497,12 +497,14 @@ describe('$meteorCollection service', function() {
497497
});
498498

499499
it('push updates from client handled correctly', function() {
500-
$rootScope.limit = 10;
500+
var $scope = $rootScope.$new();
501+
$scope.limit = 10;
501502
var $ngCol = $meteorCollection(function() {
502503
return DummyCollection.find({}, {
503-
limit: $rootScope.getReactively('limit') // TODO is not a function
504+
limit: $scope.getReactively('limit')
504505
});
505-
});
506+
// A collection with no name can't be found so we'll need to pass it
507+
}, false, DummyCollection);
506508
spyOn($ngCol, 'save');
507509

508510
// Adds docs on the client.
@@ -517,12 +519,14 @@ describe('$meteorCollection service', function() {
517519
});
518520

519521
it('remove updates from client handled correctly', function() {
520-
$rootScope.limit = 10;
522+
var $scope = $rootScope.$new();
523+
$scope.limit = 10;
521524
var $ngCol = $meteorCollection(function() {
522525
return DummyCollection.find({}, {
523-
limit: $rootScope.getReactively('limit') // TODO is not a function
526+
limit: $scope.getReactively('limit')
524527
});
525-
});
528+
// A collection with no name can't be found so we'll need to pass it
529+
}, false, DummyCollection);
526530
spyOn($ngCol, 'remove').and.callThrough();
527531

528532
// Removes last two docs on the client.

tests/package.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ Package.onTest(function(api) {
5151
'integration/pre1.3/angular-meteor-get-updates-spec.js',
5252
'integration/pre1.3/angular-meteor-diff-array-spec.js',
5353
'integration/pre1.3/angular-meteor-camera-spec.js',
54-
// 'integration/pre1.3/angular-meteor-collection-spec.js' // contains two failing tests (check todo)
54+
'integration/pre1.3/angular-meteor-collection-spec.js',
5555
'integration/pre1.3/angular-meteor-methods-spec.js',
5656
'integration/pre1.3/angular-meteor-object-spec.js',
5757
'integration/pre1.3/angular-meteor-session-spec.js',
5858
'integration/pre1.3/angular-meteor-stopper-spec.js',
59-
'integration/pre1.3/angular-meteor-subscribe-spec.js'
60-
// 'integration/pre1.3/angular-meteor-utils-spec.js' // contains three failing tests
59+
'integration/pre1.3/angular-meteor-subscribe-spec.js',
60+
'integration/pre1.3/angular-meteor-utils-spec.js'
6161
], 'client');
6262
});

0 commit comments

Comments
 (0)