From 5a76b49170c0c22fc623f849ed2b4b2636dfac61 Mon Sep 17 00:00:00 2001 From: Jason Slavin Date: Tue, 10 Sep 2024 11:55:17 -0700 Subject: [PATCH] Revert "MWPW-154363: Add param anaylitics sandbox" --- scripts/aa-university.js | 21 +++++++-------------- test/scripts/aa-university.test.js | 16 ---------------- 2 files changed, 7 insertions(+), 30 deletions(-) diff --git a/scripts/aa-university.js b/scripts/aa-university.js index 1706691..85488df 100644 --- a/scripts/aa-university.js +++ b/scripts/aa-university.js @@ -3,23 +3,16 @@ export default function registerAAUniversity() { const lastName = document.querySelector('input[name="LastName"]'); const email = document.querySelector('input[name="Email"]'); const country = document.querySelector('select[name="Country"]'); - const group = document.querySelector('meta[name="sandboxgroup"]'); - - const postBody = { - first_name: firstName?.value, - last_name: lastName?.value, - email: email?.value, - university: 'none', - country: country?.value, - }; - - if (group) postBody.group = group.content; fetch('https://us-central1-adobe---aa-university.cloudfunctions.net/register', { method: 'POST', - body: JSON.stringify(postBody), + body: JSON.stringify({ + first_name: firstName?.value, + last_name: lastName?.value, + email: email?.value, + university: 'none', + country: country?.value, + }), }) .catch((error) => window.lana.log(`Marketo AA University Error: ${error}`)); - - return postBody; } diff --git a/test/scripts/aa-university.test.js b/test/scripts/aa-university.test.js index 272d82e..976ab04 100644 --- a/test/scripts/aa-university.test.js +++ b/test/scripts/aa-university.test.js @@ -29,20 +29,4 @@ describe('AA University', async () => { window.fetch = ogFetch; window.lana = ogLana; }); - - it('Sends the group parameter with POST if found', () => { - const meta = document.createElement('meta'); - meta.setAttribute('name', 'sandboxgroup'); - meta.setAttribute('content', 'group'); - document.body.prepend(meta); - const body = registerAAUniversity(); - expect(body.group).to.equal('group'); - - document.querySelector('meta').remove(); - }); - - it('Does not send the group parameter with POST if not found', () => { - const body = registerAAUniversity(); - expect(body.group).to.be.undefined; - }); });