Skip to content

Commit

Permalink
Fixing unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmajoulet committed Jan 11, 2019
1 parent ba59bcd commit 4514774
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions extensions/amp-story/1.0/test/test-amp-story-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {registerServiceBuilder} from '../../../../src/service';
describes.realWin('amp-story-page', {amp: true}, env => {
let win;
let element;
let gridLayerEl;
let page;

beforeEach(() => {
Expand All @@ -44,7 +45,9 @@ describes.realWin('amp-story-page', {amp: true}, env => {
story.getImpl = () => Promise.resolve(mediaPoolRoot);

element = win.document.createElement('amp-story-page');
gridLayerEl = win.document.createElement('amp-story-grid-layer');
element.getAmpDoc = () => new AmpDocSingle(win);
element.appendChild(gridLayerEl);
story.appendChild(element);
win.document.body.appendChild(story);

Expand Down Expand Up @@ -117,7 +120,7 @@ describes.realWin('amp-story-page', {amp: true}, env => {
it('should perform media operations when state becomes active', done => {
const videoEl = win.document.createElement('video');
videoEl.setAttribute('src', 'https://example.com/video.mp3');
element.appendChild(videoEl);
gridLayerEl.appendChild(videoEl);

let mediaPoolMock;

Expand Down Expand Up @@ -184,7 +187,7 @@ describes.realWin('amp-story-page', {amp: true}, env => {
it('should pause/rewind media when state becomes not active', done => {
const videoEl = win.document.createElement('video');
videoEl.setAttribute('src', 'https://example.com/video.mp3');
element.appendChild(videoEl);
gridLayerEl.appendChild(videoEl);

let mediaPoolMock;

Expand Down Expand Up @@ -224,7 +227,7 @@ describes.realWin('amp-story-page', {amp: true}, env => {
it('should pause media when state becomes paused', done => {
const videoEl = win.document.createElement('video');
videoEl.setAttribute('src', 'https://example.com/video.mp3');
element.appendChild(videoEl);
gridLayerEl.appendChild(videoEl);

let mediaPoolMock;

Expand Down

0 comments on commit 4514774

Please sign in to comment.