Skip to content

Commit

Permalink
Revert "MWPW-154363: Add param anaylitics sandbox"
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonHowellSlavin authored Sep 10, 2024
1 parent 229705f commit 5a76b49
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 30 deletions.
21 changes: 7 additions & 14 deletions scripts/aa-university.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
16 changes: 0 additions & 16 deletions test/scripts/aa-university.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
});

0 comments on commit 5a76b49

Please sign in to comment.