Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added tests
  • Loading branch information
mszylkowski committed Oct 8, 2021
commit 05eff39c5a23eaff1954132c7a5e00c2f6f76032
22 changes: 22 additions & 0 deletions extensions/amp-story/1.0/test/test-amp-story-system-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,26 @@ describes.fakeWin('amp-story system layer', {amp: true}, (env) => {
expect(storeService.get(StateProperty.PAUSED_STATE)).to.be.true;
expect(systemLayer.getShadowRoot()).to.have.attribute('paused');
});

describe('system layer equalizer', () => {
it('should not show the equalizer if there is no audio', () => {
systemLayer.build();

storeService.dispatch(Action.TOGGLE_PAGE_HAS_AUDIO, false);
expect(systemLayer.equalizer_).to.not.have.class('amp-video-eq-play');
});

it('should show the equalizer if page has audio', () => {
systemLayer.build();

storeService.dispatch(Action.TOGGLE_PAGE_HAS_AUDIO, true);
expect(systemLayer.equalizer_).to.have.class('amp-video-eq-play');
});

it('should show the equalizer if story has background audio', () => {
storeService.dispatch(Action.TOGGLE_STORY_HAS_BACKGROUND_AUDIO, true);
systemLayer.build();
expect(systemLayer.equalizer_).to.have.class('amp-video-eq-play');
});
});
});