Skip to content

Commit

Permalink
🐛Add computed styles to fake win (ampproject#26514)
Browse files Browse the repository at this point in the history
  • Loading branch information
calebcordry authored Jan 28, 2020
1 parent f5f3434 commit c78dcb4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/unit/test-runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -1625,7 +1625,7 @@ describes.realWin(

it('should ignore unknown script', () => {
expectAsyncConsoleError(
'[runtime] - unknown script: [object HTMLScriptElement] ' +
'[multidoc-manager] - unknown script: [object HTMLScriptElement] ' +
'https://cdn.ampproject.org/other.js'
);

Expand Down Expand Up @@ -1711,7 +1711,7 @@ describes.realWin(

it('should ignore inline script if javascript', () => {
expectAsyncConsoleError(
'[runtime] - unallowed inline javascript: ' +
'[multidoc-manager] - unallowed inline javascript: ' +
'[object HTMLScriptElement]',
2
);
Expand Down
5 changes: 5 additions & 0 deletions testing/fake-dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@ export class FakeWindow {
* @const
*/
this.requestAnimationFrame = raf;

// Styles.
this.getComputedStyle = function() {
return window.getComputedStyle.apply(window, arguments);
};
}

/** polyfill addEventListener. */
Expand Down

0 comments on commit c78dcb4

Please sign in to comment.