Skip to content

Commit

Permalink
jridgewell@ nit
Browse files Browse the repository at this point in the history
  • Loading branch information
samouri committed Jan 23, 2020
1 parent 68a9ffb commit 4d6b2d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions extensions/amp-script/0.1/amp-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ export class AmpScript extends AMP.BaseElement {
/**
* @override
*/
onLayoutMeasure() {
super.onLayoutMeasure();
onMeasureChanged() {
super.onMeasureChanged();
if (this.layoutCompleted_) {
return;
}
Expand Down
6 changes: 3 additions & 3 deletions extensions/amp-script/0.1/test/unit/test-amp-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ describes.fakeWin('AmpScript', {amp: {runtimeOn: false}}, env => {
it('should not warn when there is positive width/height', () => {
const warnStub = env.sandbox.stub(user(), 'warn');
env.sandbox.stub(script, 'getLayoutBox').returns({height: 1, width: 1});
script.onLayoutMeasure();
script.onMeasureChanged();
expect(warnStub).to.have.callCount(0);
});

it('should warn if there is zero width/height', () => {
const warnStub = env.sandbox.stub(user(), 'warn');
env.sandbox.stub(script, 'getLayoutBox').returns({height: 0, width: 0});
script.onLayoutMeasure();
script.onMeasureChanged();

expect(warnStub).calledWith(
'amp-script',
Expand All @@ -120,7 +120,7 @@ describes.fakeWin('AmpScript', {amp: {runtimeOn: false}}, env => {
allowConsoleError(() => {
script.layoutCallback();
});
script.onLayoutMeasure();
script.onMeasureChanged();
expect(warnStub).to.have.callCount(0);
});
});
Expand Down

0 comments on commit 4d6b2d8

Please sign in to comment.