Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions libs/features/mep/addons/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export default async function init(eventId) {
const consentCookieValue = getCookie('OptanonConsent');
if (consentCookieValue?.includes('C0002:0')) return false;

const eventDetails = await fetchFromRainfocus(eventId);
return eventDetails?.isRegistered === true;
const config = getConfig();
config.mep ??= {};
config.mep.eventDetails = await fetchFromRainfocus(eventId);
return config.mep.eventDetails?.isRegistered === true;
}
1 change: 1 addition & 0 deletions libs/features/personalization/personalization.js
Original file line number Diff line number Diff line change
Expand Up @@ -1676,6 +1676,7 @@ export async function init(enablements = {}) {
} else {
for (const [key, promise] of Object.entries(promises)) promises[key] = await promise;
config.mep = {
...(config.mep || {}),
updateFragDataProps,
Comment thread
vgoodric marked this conversation as resolved.
preview: (mepButton !== 'off'
&& (config.env?.name !== 'prod' || mepParam || mepParam === '' || mepButton)),
Expand Down
2 changes: 2 additions & 0 deletions test/features/mep/addons/event.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { expect } from '@esm-bundle/chai';
import { stub } from 'sinon';
import init from '../../../../libs/features/mep/addons/event.js';
import { getConfig } from '../../../../libs/utils/utils.js';

const getFetchPromise = (data, type = 'json') => new Promise((resolve) => {
resolve({
Expand Down Expand Up @@ -72,6 +73,7 @@ describe('event', () => {
isRegistered: true,
});
const event = await init('adobe-max-2025');
expect(getConfig().mep.eventDetails.isRegistered).to.equal(true);
expect(event).to.equal(true);
});
});
Loading