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 320a35b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 4 additions & 1 deletion extensions/amp-bind/0.1/test/test-amp-state.js
Expand Up @@ -86,16 +86,18 @@ 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'});
});
});

it('should parse child and fetch `src` if both proided at build', () => {
it('should parse child and fetch `src` if both provided at build', () => {
ampState.innerHTML = '<script type="application/json">' +
'{"foo": "bar"}</script>';
ampState.setAttribute('src', 'https://foo.com/bar?baz=1');
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 320a35b

Please sign in to comment.