Skip to content

Commit

Permalink
Exclude amp-twitter
Browse files Browse the repository at this point in the history
  • Loading branch information
caroqliu committed Jun 28, 2021
1 parent 101d72c commit 1776293
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
5 changes: 1 addition & 4 deletions extensions/amp-twitter/1.0/amp-twitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,7 @@ class AmpTwitter extends BaseElement {
/** @override */
init() {
return dict({
'requestResize': (height) =>
this.attemptChangeHeight(height).catch(() => {
/* ignore failures */
}),
'requestResize': (height) => this.forceChangeHeight(height),
});
}

Expand Down
8 changes: 2 additions & 6 deletions extensions/amp-twitter/1.0/test/test-amp-twitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,7 @@ describes.realWin(
await waitForRender();

const impl = await element.getImpl(false);
const attemptChangeHeightStub = env.sandbox.stub(
impl,
'attemptChangeHeight'
);
attemptChangeHeightStub.returns(Promise.resolve());
const forceChangeHeightStub = env.sandbox.stub(impl, 'forceChangeHeight');

const mockEvent = new CustomEvent('message');
const sentinel = JSON.parse(
Expand All @@ -90,7 +86,7 @@ describes.realWin(
mockEvent.source =
element.shadowRoot.querySelector('iframe').contentWindow;
win.dispatchEvent(mockEvent);
expect(attemptChangeHeightStub).to.be.calledOnce.calledWith(1000);
expect(forceChangeHeightStub).to.be.calledOnce.calledWith(1000);
});

it('should replace iframe after tweetid mutation', async () => {
Expand Down

0 comments on commit 1776293

Please sign in to comment.