diff --git a/network-api/networkapi/utility/templatetags/mofo_common.py b/network-api/networkapi/utility/templatetags/mofo_common.py index a5cc0a72e6a..28dfc685ddb 100644 --- a/network-api/networkapi/utility/templatetags/mofo_common.py +++ b/network-api/networkapi/utility/templatetags/mofo_common.py @@ -21,14 +21,15 @@ def onetrust_data_domain(): Get the OneTrust cookie "data-domain-script" script attribute. Data domain is taken from the data-domain-script script attribute via - OneTrust's cookie script integration. While the test / production data - domain id currently only differ by a suffix, this may change in the future + OneTrust's cookie script integration. We have two scripts & properties set up + in OneTrust. One for production (foundation.mozilla.org) and one for + dev/staging (foundation.mofostaging.net). """ - data_domain = "0191beda-31c8-76ff-9093-4055176ccf8c" + if get_app_environment() == "Production": - return data_domain + return "0191beda-31c8-76ff-9093-4055176ccf8c" else: - return data_domain + "-test" + return "0190e65a-dbec-7548-89af-4b67155ee70a-test" def get_app_environment(): diff --git a/tests/integration/newsletter/001-default-layout.spec.js b/tests/integration/newsletter/001-default-layout.spec.js index 81aaf996dea..fa37d7ba636 100644 --- a/tests/integration/newsletter/001-default-layout.spec.js +++ b/tests/integration/newsletter/001-default-layout.spec.js @@ -79,7 +79,7 @@ test.describe("Blog body newsletter signup form", () => { const requiredFields = await form.locator(`[required]`); errorMessages = form.locator(".error-message"); await submitButton.waitFor({ state: "attached" }); - await submitButton.click(); + await submitButton.dispatchEvent("click"); expect(await errorMessages.count()).toBe(await requiredFields.count()); // test if putting focus on the email field triggers the toggleable fields @@ -125,7 +125,7 @@ test.describe("Blog body newsletter signup form", () => { const apiUrl = await moduleContainer.getAttribute("data-api-url"); const fetchRequest = page.waitForRequest(apiUrl); - await submitButton.click(); + await submitButton.dispatchEvent("click"); expect(await errorMessages.count()).toBe(0); expect(await innerWrapper.getAttribute("data-submission-status")).toBe( "pending" @@ -162,7 +162,7 @@ test.describe("Blog body newsletter signup form", () => { const apiUrl = await moduleContainer.getAttribute("data-api-url"); const fetchRequest = page.waitForRequest(apiUrl); - await submitButton.click(); + await submitButton.dispatchEvent("click"); expect(await errorMessages.count()).toBe(0); expect(await innerWrapper.getAttribute("data-submission-status")).toBe( "pending" diff --git a/tests/integration/petition/001-petition-form.spec.js b/tests/integration/petition/001-petition-form.spec.js index d15c7c059f3..ffd2401ab24 100644 --- a/tests/integration/petition/001-petition-form.spec.js +++ b/tests/integration/petition/001-petition-form.spec.js @@ -93,7 +93,7 @@ test.describe("FormAssembly petition form", () => { // test if submitting the form without filling out the required fields creates validation errors // wait for submitButton's click event to be attached await submitButton.waitFor({ state: "attached" }); - await submitButton.click(); + await submitButton.dispatchEvent("click"); expect(await page.locator(".errFld").count()).toBe(4); expect(await page.locator(".errMsg").count()).toBe(4); @@ -101,7 +101,7 @@ test.describe("FormAssembly petition form", () => { await firstNameInput.fill("Integration"); await lastNameInput.fill("Test"); await emailInput.fill(`test-${TIMESTAMP}-${localeToTest}@example.com`); - await privacyInput.check(); + await privacyInput.dispatchEvent("click"); // Update campaign id to TEST_CAMPAIGN_ID so this test can be submitted to FormAssembly // We can't use locator because the campaign id field is hidden @@ -124,7 +124,7 @@ test.describe("FormAssembly petition form", () => { // prepare to wait for the form to submit const navigationPromise = page.waitForNavigation(); - await submitButton.click(); + await submitButton.dispatchEvent("click"); await navigationPromise; });