Skip to content
Prev Previous commit
Next Next commit
better test
  • Loading branch information
processprocess committed Mar 17, 2022
commit d891cc26be5a5748282eb27ec40e62f4276d9514
8 changes: 5 additions & 3 deletions extensions/amp-video/0.1/test/test-video-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ describes.realWin('amp-video cached-sources', {amp: true}, (env) => {
});

describe('captions_url field', async () => {
it('should append track element if the cache responds with captions_url', async () => {
it.only('should append track element if the cache responds with captions_url', async () => {
env.sandbox.stub(xhrService, 'fetch').resolves({
json: () =>
Promise.resolve({
Expand Down Expand Up @@ -526,8 +526,10 @@ describes.realWin('amp-video cached-sources', {amp: true}, (env) => {
videoEl.appendChild(<track />);
await fetchCachedSources(videoEl, env.ampdoc);

const trackEl = videoEl.querySelector('track');
expect(trackEl).to.exist;
const trackEl = videoEl.querySelector(
'track[src="captions_url_response.vtt"]'
);
expect(trackEl).to.not.exist;
});
it('should not append track element if captions_url does not exist', async () => {
env.sandbox.stub(xhrService, 'fetch').resolves({
Expand Down