diff --git a/test/ui/ad_ui_unit.js b/test/ui/ad_ui_unit.js index 35cc66e4b4..acc325e26b 100644 --- a/test/ui/ad_ui_unit.js +++ b/test/ui/ad_ui_unit.js @@ -25,15 +25,6 @@ describe('Ad UI', () => { shaka.Player.setAdManagerFactory(() => new shaka.test.FakeAdManager()); }); - afterEach(async () => { - await UiUtils.cleanupUI(); - }); - - afterAll(() => { - document.head.removeChild(cssLink); - shaka.Player.setAdManagerFactory(() => new shaka.ads.AdManager()); - }); - beforeEach(() => { container = /** @type {!HTMLElement} */ (document.createElement('div')); @@ -45,6 +36,15 @@ describe('Ad UI', () => { adManager = video['ui'].getControls().getPlayer().getAdManager(); }); + afterEach(async () => { + await UiUtils.cleanupUI(); + }); + + afterAll(() => { + document.head.removeChild(cssLink); + shaka.Player.setAdManagerFactory(() => new shaka.ads.AdManager()); + }); + it('is invisible if no ad is playing', () => { const adControlsContainer = UiUtils.getElementByClassName(container, 'shaka-ad-controls');