Fix intermittent JS test failure (Fixes #14319) (#14321)

This commit is contained in:
Alex Gibson 2024-03-15 00:39:26 +00:00 коммит произвёл GitHub
Родитель 88f6723a93
Коммит db24baab99
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -75,7 +75,7 @@ describe('datalayer-begincheckout.es6.js', function () {
});
afterEach(function () {
window.dataLayer = [];
delete window.dataLayer;
});
it('will append the begin_checkout event to the dataLayer', function () {

Просмотреть файл

@ -300,7 +300,9 @@ describe('TrackProductDownload.handleLink', function () {
const download_button = `<a href="https://download.mozilla.org/?product=firefox-latest-ssl&amp;os=win64&amp;lang=en-CA" id="download-button-primary" class="mzp-c-button mzp-t-product c-download-button">Download Now</a>`;
beforeEach(function () {
window.dataLayer = [];
// stub out google tag manager
window.dataLayer = sinon.stub();
window.dataLayer.push = sinon.stub();
document.body.insertAdjacentHTML('beforeend', download_button);
const downloadButton = document.getElementById(
@ -318,7 +320,6 @@ describe('TrackProductDownload.handleLink', function () {
afterEach(function () {
document.getElementById('download-button-primary').remove();
window.dataLayer = [];
});
it('should call the full chain of functions', function () {

Просмотреть файл

@ -83,6 +83,10 @@ describe('WaitListForm', function () {
</div>`;
document.body.insertAdjacentHTML('beforeend', form);
// stub out google tag manager
window.dataLayer = sinon.stub();
window.dataLayer.push = sinon.stub();
});
afterEach(function () {