@gcorevideo/player 2.28.19 → 2.28.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -132,6 +132,7 @@ describe('ClosedCaptions', () => {
132
132
  describe('when subtitle is changed', () => {
133
133
  beforeEach(async () => {
134
134
  emitSubtitleAvailable(core)
135
+ cc.$el.find('#gplayer-cc-button').click()
135
136
  await new Promise((resolve) => setTimeout(resolve, 100))
136
137
  core.activePlayback.getCurrentTime = vi.fn().mockReturnValue(7)
137
138
  core.activeContainer.getCurrentTime = vi.fn().mockReturnValue(7)
@@ -167,11 +168,16 @@ describe('ClosedCaptions', () => {
167
168
  ),
168
169
  },
169
170
  ]
171
+ cc.$el.find('#gplayer-cc-menu li:nth-child(2) a').click()
172
+ await new Promise((resolve) => setTimeout(resolve, 100))
173
+ // TODO test explicitly that PLAYBACK_SUBTITLE_CHANGED event does not cause track switch
170
174
  core.activePlayback.emit(Events.PLAYBACK_SUBTITLE_CHANGED, { id: 2 })
175
+ await new Promise((resolve) => setTimeout(resolve, 100))
176
+
171
177
  })
172
178
  it('should activate subtitle track', () => {
173
179
  expect(core.activePlayback.closedCaptionsTracks[1].track.mode).toBe(
174
- 'showing',
180
+ 'hidden',
175
181
  )
176
182
  expect(core.activePlayback.closedCaptionsTracks[0].track.mode).toBe(
177
183
  'hidden',
@@ -188,8 +194,8 @@ describe('ClosedCaptions', () => {
188
194
  emitSubtitleAvailable(core)
189
195
  cc.$el.find('#gplayer-cc-menu li:nth-child(2) a').click()
190
196
  })
191
- it('should activate subtitle track', () => {
192
- expect(core.activePlayback.closedCaptionsTrackId).toEqual(2)
197
+ it('should deactivate native subtitles track', () => {
198
+ expect(core.activePlayback.closedCaptionsTrackId).toEqual(-1)
193
199
  })
194
200
  it('should highlight selected menu item', () => {
195
201
  expect(