Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

test($parse): add one-time/interceptor tests #16043

Merged
merged 1 commit into from
Jun 13, 2017

Conversation

jbedard
Copy link
Collaborator

@jbedard jbedard commented Jun 9, 2017

I realized that 189461f changed this a little - previously the second test failed for two reasons

  1. one-time literals did not use .inputs unlike the normal one-time delegate, so the identity interceptor would throw an infdig because the literal recreated each digest was being watched
  2. one-time literals with interceptors only check isDefined to determine when the one time is "done" which is unlike the one-time watch delegate that checks all the values in the literal, so the interceptor thought the "one-time" was done right away for literals

I think both of these changes are correct and want to make sure we don't revert them. This should probably only go into 1.7 since this change will probably be reverted in 1.6.

@jbedard jbedard added this to the 1.7.0 milestone Jun 9, 2017
@jbedard jbedard force-pushed the one-time-int-tests branch 2 times, most recently from 5fb7856 to 220537c Compare June 10, 2017 04:02
@@ -3321,6 +3321,32 @@ describe('parser', function() {
scope.$digest();
expect(called).toBe(true);
}));

it('should not effect when a one-time binding becomes stable', inject(function($parse) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

effect -> affect, I think

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for correcting my engrish :)

Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

except for the typo, this LGTM

@jbedard jbedard force-pushed the one-time-int-tests branch from 220537c to eb3efe1 Compare June 13, 2017 04:34
@jbedard jbedard merged commit b85926b into angular:master Jun 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants