Skip to content

Commit 99b7b53

Browse files
committed
Add failling test for scope with property as helper name
1 parent 01e045a commit 99b7b53

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

packages/angular-meteor-data/tests/integration/angular-meteor-reactive-context.spec.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,22 @@ describe('angular-meteor', function () {
6969
expect(reactiveContextInstance.context['myHelper']).toBe(10);
7070
});
7171

72+
it('should not explode when there is property on the context with the helper name', function () {
73+
var scope = $rootScope.$new();
74+
75+
scope.myHelper = 'oops';
76+
var instance = $reactive(scope).helpers({
77+
myHelper: function() {
78+
return 10;
79+
}
80+
});
81+
82+
// TODO: I don't know what should be the expected value here
83+
// Does the helper should override the current one?
84+
expect(instance.stoppables.length).toBe(1);
85+
expect(instance.context['myHelper']).toBe(10);
86+
});
87+
7288
it('Should register string helper', function() {
7389
reactiveContextInstance.helpers({
7490
myHelper: function() {

0 commit comments

Comments
 (0)