Skip to content

Commit

Permalink
test(media_control): fix broken tests after container reference change
Browse files Browse the repository at this point in the history
  • Loading branch information
towerz committed Nov 13, 2018
1 parent 4dc3d40 commit f8ec828
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/plugins/media_control_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ describe('MediaControl', function() {
this.container = new Container({ playback: this.playback })
this.core = new Core({ playerId: 0 })
this.mediaControl = new MediaControl(this.core)
this.core.trigger(Events.CORE_ACTIVE_CONTAINER_CHANGED, this.container)
this.core.activeContainer = this.container
localStorage.removeItem('clappr.localhost.volume')
})

describe('#constructor', function() {
it('can be built muted', function() {
const container = new Container({ playback: this.playback, mute: true })
const mediaControl = new MediaControl(this.core)
this.core.trigger(Events.CORE_ACTIVE_CONTAINER_CHANGED, container)
this.core.activeContainer = container
expect(mediaControl.muted).to.be.equal(true)
expect(mediaControl.volume).to.be.equal(0)
})
Expand Down Expand Up @@ -82,7 +82,7 @@ describe('MediaControl', function() {

Object.assign(this.core.options, { persistConfig: true })
const mediacontrol = new MediaControl(this.core)
this.core.trigger(Events.CORE_ACTIVE_CONTAINER_CHANGED, this.container)
this.core.activeContainer = this.container
mediacontrol.setVolume(78)

expect(Config.restore('volume')).to.be.equal(78)
Expand All @@ -94,7 +94,7 @@ describe('MediaControl', function() {
const container = new Container({ playback: this.playback, mute: true })
const mediacontrol = new MediaControl(this.core)

this.core.trigger(Events.CORE_ACTIVE_CONTAINER_CHANGED, container)
this.core.activeContainer = container

container.configure({ mute: false })

Expand All @@ -110,7 +110,7 @@ describe('MediaControl', function() {

new MediaControl(this.core)

this.core.trigger(Events.CORE_ACTIVE_CONTAINER_CHANGED, container)
this.core.activeContainer = container

Config.persist.should.not.have.been.called
})
Expand All @@ -130,7 +130,7 @@ describe('MediaControl', function() {
return Playback.NO_OP
}
const mediaControl = new MediaControl(this.core)
this.core.trigger(Events.CORE_ACTIVE_CONTAINER_CHANGED, this.container)
this.core.activeContainer = this.container
mediaControl.render()
mediaControl.enable()
expect(mediaControl.$el.hasClass('media-control-hide')).to.be.true
Expand All @@ -157,7 +157,7 @@ describe('MediaControl', function() {
const container = new Container({ playback: this.playback, mute: true })
const mediaControl = new MyMediaControl(this.core)

this.core.trigger(Events.CORE_ACTIVE_CONTAINER_CHANGED, container)
this.core.activeContainer = container

mediaControl.render()
expect(mediaControl.muted).to.be.equal(true)
Expand Down

0 comments on commit f8ec828

Please sign in to comment.