feat: add test experience for get user profile endpoint (#65593)

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
Sem Bauke
2026-01-30 15:20:42 +01:00
committed by GitHub
parent d61ecc789d
commit 19c77d9c16
+21 -1
View File
@@ -498,7 +498,17 @@ describe('get-public-profile helpers', () => {
description: 'description'
}
],
experience: [],
experience: [
{
id: 'exp1',
title: 'Developer',
company: 'Company',
location: 'Location',
startDate: '01/2020',
endDate: '12/2022',
description: 'Description'
}
],
profileUI: {
isLocked: false,
showAbout: true,
@@ -612,6 +622,16 @@ describe('get-public-profile helpers', () => {
});
});
test('returns [] for experience if showExperience is not true', () => {
const userWithoutExperience = {
...user,
profileUI: { ...user.profileUI, showExperience: false }
};
expect(replacePrivateData(userWithoutExperience)).toMatchObject({
experience: []
});
});
test('returns the expected public user object if all showX flags are true', () => {
expect(replacePrivateData(user)).toEqual(omit(user, ['id', 'profileUI']));
});