Skip to content

Commit

Permalink
more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kmh287 committed May 8, 2017
1 parent 9e9bba2 commit af057a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 3 additions & 0 deletions extensions/amp-bind/0.1/test/test-amp-state.js
Expand Up @@ -86,11 +86,13 @@ describes.realWin('AmpState', {
ampState.build();

// IMPORTANT: No parsing should happen until viewer is visible.
expect(fetchSpy).to.not.have.been.called;
expect(batchedJsonStub).to.not.have.been.called;
expect(updateStub).to.not.have.been.called;

whenFirstVisiblePromiseResolve();
return whenFirstVisiblePromise.then(() => {
expect(fetchSpy).calledWithExactly(/* isInit */true);
expect(updateStub).calledWithMatch({foo: 'bar'});
});
});
Expand Down Expand Up @@ -124,6 +126,7 @@ describes.realWin('AmpState', {
const isVisibleStub = env.sandbox.stub(viewer, 'isVisible');
isVisibleStub.returns(false);
ampState.mutatedAttributesCallback({src: 'https://foo.com/bar?baz=1'});
expect(fetchSpy).to.not.have.been.called;
expect(batchedJsonStub).to.not.have.been.called;

isVisibleStub.returns(true);
Expand Down
1 change: 0 additions & 1 deletion extensions/amp-bind/0.1/validator-amp-bind.protoascii
Expand Up @@ -50,7 +50,6 @@ tags: { # <amp-state>
html_format: AMP
tag_name: "AMP-STATE"
spec_name: "amp-state"
satisfies: "amp-state"
requires: "amp-bind extension .js script"
requires: "amp-bind extension .json script"
disallowed_ancestor: "AMP-SIDEBAR"
Expand Down

0 comments on commit af057a1

Please sign in to comment.