Skip to content

Commit

Permalink
Merge branch 'article-cypress-tests-v1' of github.com:bbc/simorgh int…
Browse files Browse the repository at this point in the history
…o article-cypress-tests-v1
  • Loading branch information
karinathomasbbc committed Feb 5, 2025
2 parents 7f68521 + aeb8eba commit 939a79e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
12 changes: 12 additions & 0 deletions src/app/components/ATIAnalytics/atiUrl/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,11 @@ describe('Reverb', () => {
x18: 'isLocServeCookieSet',
},
};
const userParans = { isSignedIn: false };

expect(reverbAnalyticsModel.params.page).toEqual(pageParams);
expect(reverbAnalyticsModel.params.user).toEqual(userParans);

expect(reverbAnalyticsModel.eventDetails).toEqual({
eventName: 'pageView',
});
Expand Down Expand Up @@ -439,5 +442,14 @@ describe('Reverb', () => {
container: '1234',
});
});

it('should return the correct Reverb user object configuration', () => {
const reverbPageSectionViewEventModel =
buildReverbPageSectionEventModel(input);

expect(reverbPageSectionViewEventModel.params.user).toEqual({
isSignedIn: false,
});
});
});
});
2 changes: 0 additions & 2 deletions src/app/components/ATIAnalytics/atiUrl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,6 @@ export const buildReverbAnalyticsModel = ({
},
},
user: {
hashedId: getAtUserId(),
isSignedIn: false,
},
},
Expand Down Expand Up @@ -529,7 +528,6 @@ export const buildReverbPageSectionEventModel = ({
},
},
user: {
hashedId: getAtUserId(),
isSignedIn: false,
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/app/lib/analyticsUtils/sendBeacon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const setReverbPageValues = async ({ pageVars, userVars }) => {
});

window.bbcuser = {
getHashedId: () => [userVars.hashedId],
getHashedId: () => null,
isSignedIn: () => Promise.resolve(userVars.isSignedIn),
};
};
Expand Down

0 comments on commit 939a79e

Please sign in to comment.