From 394ce0b5e61ffc823b7ca9b943cfa8c46f805420 Mon Sep 17 00:00:00 2001 From: Jaissica Date: Fri, 16 Jan 2026 16:22:29 -0500 Subject: [PATCH 01/13] feat: add devPassedAttributes to selectPlacements --- src/roktManager.ts | 1 + test/jest/roktManager.spec.ts | 201 ++++++++++++++++++++++++++++++++-- 2 files changed, 190 insertions(+), 12 deletions(-) diff --git a/src/roktManager.ts b/src/roktManager.ts index 44fbe074d..0be07f500 100644 --- a/src/roktManager.ts +++ b/src/roktManager.ts @@ -283,6 +283,7 @@ export default class RoktManager { const enrichedOptions = { ...options, attributes: enrichedAttributes, + devPassedAttributes: attributes, }; return this.kit.selectPlacements(enrichedOptions); diff --git a/test/jest/roktManager.spec.ts b/test/jest/roktManager.spec.ts index c37e6873b..21f082cd7 100644 --- a/test/jest/roktManager.spec.ts +++ b/test/jest/roktManager.spec.ts @@ -761,6 +761,10 @@ describe('RoktManager', () => { attributes: { mapped_key: 'test_value', // This key should be mapped other_attr: 'other_value' // This key should remain unchanged + }, + devPassedAttributes: { + original_key: 'test_value', + other_attr: 'other_value' } }; @@ -886,7 +890,10 @@ describe('RoktManager', () => { } as IRoktSelectPlacementsOptions; roktManager.selectPlacements(options); - expect(kit.selectPlacements).toHaveBeenCalledWith(options); + expect(kit.selectPlacements).toHaveBeenCalledWith({ + attributes: {}, + devPassedAttributes: {} + }); }); it('should call kit.selectPlacements with passed in attributes', async () => { @@ -918,7 +925,22 @@ describe('RoktManager', () => { }; await roktManager.selectPlacements(options); - expect(kit.selectPlacements).toHaveBeenCalledWith(options); + expect(kit.selectPlacements).toHaveBeenCalledWith({ + attributes: { + age: 25, + score: 100.5, + isSubscribed: true, + isActive: false, + interests: 'sports,music,books' + }, + devPassedAttributes: { + age: 25, + score: 100.5, + isSubscribed: true, + isActive: false, + interests: 'sports,music,books' + } + }); }); it('should queue the selectPlacements method if no launcher or kit is attached', () => { @@ -984,7 +1006,10 @@ describe('RoktManager', () => { expect(roktManager['kit']).not.toBeNull(); expect(roktManager['messageQueue'].size).toBe(0); - expect(kit.selectPlacements).toHaveBeenCalledWith(options); + expect(kit.selectPlacements).toHaveBeenCalledWith({ + attributes: {}, + devPassedAttributes: {} + }); expect(result).toEqual(expectedResult); }); @@ -1024,9 +1049,26 @@ describe('RoktManager', () => { } }; + const expectedOptions = { + attributes: { + age: 25, + score: 100.5, + isSubscribed: true, + isActive: false, + interests: 'sports,music,books' + }, + devPassedAttributes: { + age: 25, + score: 100.5, + isSubscribed: true, + isActive: false, + interests: 'sports,music,books' + } + }; + roktManager.selectPlacements(options); - expect(kit.selectPlacements).toHaveBeenCalledWith(options); - expect(kit.launcher.selectPlacements).toHaveBeenCalledWith(options); + expect(kit.selectPlacements).toHaveBeenCalledWith(expectedOptions); + expect(kit.launcher.selectPlacements).toHaveBeenCalledWith(expectedOptions); }); it('should pass sandbox flag as an attribute through to kit.selectPlacements', () => { @@ -1056,7 +1098,17 @@ describe('RoktManager', () => { }; roktManager.selectPlacements(options); - expect(kit.selectPlacements).toHaveBeenCalledWith(options); + expect(kit.selectPlacements).toHaveBeenCalledWith({ + attributes: { + customAttr: 'value', + sandbox: true + }, + identifier: 'test-identifier', + devPassedAttributes: { + customAttr: 'value', + sandbox: true + } + }); }); it('should NOT override global sandbox in placement attributes when initialized as true', () => { @@ -1088,7 +1140,16 @@ describe('RoktManager', () => { roktManager.selectPlacements(options); expect(roktManager['sandbox']).toBeTruthy(); - expect(kit.selectPlacements).toHaveBeenCalledWith(options); + expect(kit.selectPlacements).toHaveBeenCalledWith({ + attributes: { + customAttr: 'value', + sandbox: false + }, + devPassedAttributes: { + customAttr: 'value', + sandbox: false + } + }); }); it('should set sandbox in placement attributes when not initialized globally', () => { @@ -1119,7 +1180,17 @@ describe('RoktManager', () => { }; roktManager.selectPlacements(options); - expect(kit.selectPlacements).toHaveBeenCalledWith(options); + expect(kit.selectPlacements).toHaveBeenCalledWith({ + attributes: { + customAttr: 'value', + sandbox: true + }, + identifier: 'test-identifier', + devPassedAttributes: { + customAttr: 'value', + sandbox: true + } + }); }); it('should pass mapped attributes to kit.launcher.selectPlacements', () => { @@ -1164,6 +1235,11 @@ describe('RoktManager', () => { firstname: 'John', lastname: 'Doe', score: 42, + }, + devPassedAttributes: { + 'f.name': 'John', + 'last_name': 'Doe', + 'score': 42, } }; @@ -1197,7 +1273,101 @@ describe('RoktManager', () => { }; roktManager.selectPlacements(options); - expect(kit.selectPlacements).toHaveBeenCalledWith(options); + expect(kit.selectPlacements).toHaveBeenCalledWith({ + attributes: { + 'f.name': 'John', + 'last_name': 'Doe', + 'score': 42, + 'age': 25, + }, + devPassedAttributes: { + 'f.name': 'John', + 'last_name': 'Doe', + 'score': 42, + 'age': 25, + } + }); + }); + + it('should pass devPassedAttributes to kit for event logging', () => { + const kit: Partial = { + launcher: { + selectPlacements: jest.fn(), + hashAttributes: jest.fn(), + use: jest.fn(), + }, + hashAttributes: jest.fn(), + selectPlacements: jest.fn(), + setExtensionData: jest.fn(), + use: jest.fn(), + }; + + roktManager.kit = kit as IRoktKit; + roktManager['placementAttributesMapping'] = []; + + const options: IRoktSelectPlacementsOptions = { + attributes: { + 'customAttr': 'value', + } + }; + + roktManager.selectPlacements(options); + + expect(kit.selectPlacements).toHaveBeenCalledWith( + expect.objectContaining({ + devPassedAttributes: { + 'customAttr': 'value', + } + }) + ); + }); + + it('should include original attributes in devPassedAttributes even after mapping', () => { + const kit: Partial = { + launcher: { + selectPlacements: jest.fn(), + hashAttributes: jest.fn(), + use: jest.fn(), + }, + hashAttributes: jest.fn(), + selectPlacements: jest.fn(), + setExtensionData: jest.fn(), + use: jest.fn(), + }; + + roktManager.kit = kit as IRoktKit; + roktManager['placementAttributesMapping'] = [ + { + jsmap: null, + map: 'f.name', + maptype: 'UserAttributeClass.Name', + value: 'firstname' + } + ]; + + const options: IRoktSelectPlacementsOptions = { + attributes: { + 'f.name': 'John', + 'userId': 'user123', + } + }; + + roktManager.selectPlacements(options); + + // devPassedAttributes should contain the ORIGINAL unmapped attributes + expect(kit.selectPlacements).toHaveBeenCalledWith( + expect.objectContaining({ + devPassedAttributes: { + 'f.name': 'John', + 'userId': 'user123', + }, + // attributes should be mapped + attributes: { + 'firstname': 'John', + 'userId': 'user123', + } + }) + ); }); it('should set the mapped attributes on the current user via setUserAttributes', async () => { @@ -1286,9 +1456,16 @@ describe('RoktManager', () => { } }; - await roktManager.selectPlacements(options); - expect(kit.selectPlacements).toHaveBeenCalledWith(options); - expect(setUserAttributesSpy).not.toHaveBeenCalledWith({ + roktManager.selectPlacements(options); + expect(kit.selectPlacements).toHaveBeenCalledWith({ + attributes: { + 'sandbox': true + }, + devPassedAttributes: { + 'sandbox': true + } + }); + expect(roktManager['currentUser'].setUserAttributes).not.toHaveBeenCalledWith({ sandbox: true }); }); From c2c95f403742e660453b5bdec56f8ecb1859f075 Mon Sep 17 00:00:00 2001 From: Jaissica Date: Wed, 21 Jan 2026 10:35:52 -0500 Subject: [PATCH 02/13] resolve merge conflict and update related test --- test/jest/roktManager.spec.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/jest/roktManager.spec.ts b/test/jest/roktManager.spec.ts index 21f082cd7..5c25d9a62 100644 --- a/test/jest/roktManager.spec.ts +++ b/test/jest/roktManager.spec.ts @@ -1459,13 +1459,17 @@ describe('RoktManager', () => { roktManager.selectPlacements(options); expect(kit.selectPlacements).toHaveBeenCalledWith({ attributes: { + 'email': 'test@example.com', 'sandbox': true }, devPassedAttributes: { - 'sandbox': true + 'email': 'test@example.com', + 'sandbox': true, } }); expect(roktManager['currentUser'].setUserAttributes).not.toHaveBeenCalledWith({ + + expect(setUserAttributesSpy).not.toHaveBeenCalledWith({ sandbox: true }); }); From 0e7fb16f44ce00ed93018c7d2b6277db4d7a246b Mon Sep 17 00:00:00 2001 From: Jaissica Date: Wed, 21 Jan 2026 18:00:29 -0500 Subject: [PATCH 03/13] rename devPassedAttributes to debugAttributes --- src/roktManager.ts | 2 +- test/jest/roktManager.spec.ts | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/roktManager.ts b/src/roktManager.ts index 0be07f500..6d49590d7 100644 --- a/src/roktManager.ts +++ b/src/roktManager.ts @@ -283,7 +283,7 @@ export default class RoktManager { const enrichedOptions = { ...options, attributes: enrichedAttributes, - devPassedAttributes: attributes, + debugAttributes: attributes, }; return this.kit.selectPlacements(enrichedOptions); diff --git a/test/jest/roktManager.spec.ts b/test/jest/roktManager.spec.ts index 5c25d9a62..fd9ebc985 100644 --- a/test/jest/roktManager.spec.ts +++ b/test/jest/roktManager.spec.ts @@ -762,7 +762,7 @@ describe('RoktManager', () => { mapped_key: 'test_value', // This key should be mapped other_attr: 'other_value' // This key should remain unchanged }, - devPassedAttributes: { + debugAttributes: { original_key: 'test_value', other_attr: 'other_value' } @@ -892,7 +892,7 @@ describe('RoktManager', () => { roktManager.selectPlacements(options); expect(kit.selectPlacements).toHaveBeenCalledWith({ attributes: {}, - devPassedAttributes: {} + debugAttributes: {} }); }); @@ -933,7 +933,7 @@ describe('RoktManager', () => { isActive: false, interests: 'sports,music,books' }, - devPassedAttributes: { + debugAttributes: { age: 25, score: 100.5, isSubscribed: true, @@ -1008,7 +1008,7 @@ describe('RoktManager', () => { expect(roktManager['messageQueue'].size).toBe(0); expect(kit.selectPlacements).toHaveBeenCalledWith({ attributes: {}, - devPassedAttributes: {} + debugAttributes: {} }); expect(result).toEqual(expectedResult); }); @@ -1057,7 +1057,7 @@ describe('RoktManager', () => { isActive: false, interests: 'sports,music,books' }, - devPassedAttributes: { + debugAttributes: { age: 25, score: 100.5, isSubscribed: true, @@ -1104,7 +1104,7 @@ describe('RoktManager', () => { sandbox: true }, identifier: 'test-identifier', - devPassedAttributes: { + debugAttributes: { customAttr: 'value', sandbox: true } @@ -1145,7 +1145,7 @@ describe('RoktManager', () => { customAttr: 'value', sandbox: false }, - devPassedAttributes: { + debugAttributes: { customAttr: 'value', sandbox: false } @@ -1186,7 +1186,7 @@ describe('RoktManager', () => { sandbox: true }, identifier: 'test-identifier', - devPassedAttributes: { + debugAttributes: { customAttr: 'value', sandbox: true } @@ -1236,7 +1236,7 @@ describe('RoktManager', () => { lastname: 'Doe', score: 42, }, - devPassedAttributes: { + debugAttributes: { 'f.name': 'John', 'last_name': 'Doe', 'score': 42, @@ -1280,7 +1280,7 @@ describe('RoktManager', () => { 'score': 42, 'age': 25, }, - devPassedAttributes: { + debugAttributes: { 'f.name': 'John', 'last_name': 'Doe', 'score': 42, @@ -1289,7 +1289,7 @@ describe('RoktManager', () => { }); }); - it('should pass devPassedAttributes to kit for event logging', () => { + it('should pass debugAttributes to kit for event logging', () => { const kit: Partial = { launcher: { selectPlacements: jest.fn(), @@ -1315,14 +1315,14 @@ describe('RoktManager', () => { expect(kit.selectPlacements).toHaveBeenCalledWith( expect.objectContaining({ - devPassedAttributes: { + debugAttributes: { 'customAttr': 'value', } }) ); }); - it('should include original attributes in devPassedAttributes even after mapping', () => { + it('should include original attributes in debugAttributes even after mapping', () => { const kit: Partial = { launcher: { selectPlacements: jest.fn(), @@ -1354,10 +1354,10 @@ describe('RoktManager', () => { roktManager.selectPlacements(options); - // devPassedAttributes should contain the ORIGINAL unmapped attributes + // debugAttributes should contain the ORIGINAL unmapped attributes expect(kit.selectPlacements).toHaveBeenCalledWith( expect.objectContaining({ - devPassedAttributes: { + debugAttributes: { 'f.name': 'John', 'userId': 'user123', }, @@ -1462,7 +1462,7 @@ describe('RoktManager', () => { 'email': 'test@example.com', 'sandbox': true }, - devPassedAttributes: { + debugAttributes: { 'email': 'test@example.com', 'sandbox': true, } From 6c8482a36b83eb76b9d70edc4eb77826202d64b8 Mon Sep 17 00:00:00 2001 From: Jaissica Date: Thu, 22 Jan 2026 16:57:42 -0500 Subject: [PATCH 04/13] rename debugAttributes to initialAttributes --- src/roktManager.ts | 2 +- test/jest/roktManager.spec.ts | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/roktManager.ts b/src/roktManager.ts index 6d49590d7..cfeaf0bbc 100644 --- a/src/roktManager.ts +++ b/src/roktManager.ts @@ -283,7 +283,7 @@ export default class RoktManager { const enrichedOptions = { ...options, attributes: enrichedAttributes, - debugAttributes: attributes, + initialAttributes: attributes, }; return this.kit.selectPlacements(enrichedOptions); diff --git a/test/jest/roktManager.spec.ts b/test/jest/roktManager.spec.ts index fd9ebc985..e91d4807c 100644 --- a/test/jest/roktManager.spec.ts +++ b/test/jest/roktManager.spec.ts @@ -762,7 +762,7 @@ describe('RoktManager', () => { mapped_key: 'test_value', // This key should be mapped other_attr: 'other_value' // This key should remain unchanged }, - debugAttributes: { + initialAttributes: { original_key: 'test_value', other_attr: 'other_value' } @@ -892,7 +892,7 @@ describe('RoktManager', () => { roktManager.selectPlacements(options); expect(kit.selectPlacements).toHaveBeenCalledWith({ attributes: {}, - debugAttributes: {} + initialAttributes: {} }); }); @@ -933,7 +933,7 @@ describe('RoktManager', () => { isActive: false, interests: 'sports,music,books' }, - debugAttributes: { + initialAttributes: { age: 25, score: 100.5, isSubscribed: true, @@ -1008,7 +1008,7 @@ describe('RoktManager', () => { expect(roktManager['messageQueue'].size).toBe(0); expect(kit.selectPlacements).toHaveBeenCalledWith({ attributes: {}, - debugAttributes: {} + initialAttributes: {} }); expect(result).toEqual(expectedResult); }); @@ -1057,7 +1057,7 @@ describe('RoktManager', () => { isActive: false, interests: 'sports,music,books' }, - debugAttributes: { + initialAttributes: { age: 25, score: 100.5, isSubscribed: true, @@ -1104,7 +1104,7 @@ describe('RoktManager', () => { sandbox: true }, identifier: 'test-identifier', - debugAttributes: { + initialAttributes: { customAttr: 'value', sandbox: true } @@ -1145,7 +1145,7 @@ describe('RoktManager', () => { customAttr: 'value', sandbox: false }, - debugAttributes: { + initialAttributes: { customAttr: 'value', sandbox: false } @@ -1186,7 +1186,7 @@ describe('RoktManager', () => { sandbox: true }, identifier: 'test-identifier', - debugAttributes: { + initialAttributes: { customAttr: 'value', sandbox: true } @@ -1236,7 +1236,7 @@ describe('RoktManager', () => { lastname: 'Doe', score: 42, }, - debugAttributes: { + initialAttributes: { 'f.name': 'John', 'last_name': 'Doe', 'score': 42, @@ -1280,7 +1280,7 @@ describe('RoktManager', () => { 'score': 42, 'age': 25, }, - debugAttributes: { + initialAttributes: { 'f.name': 'John', 'last_name': 'Doe', 'score': 42, @@ -1289,7 +1289,7 @@ describe('RoktManager', () => { }); }); - it('should pass debugAttributes to kit for event logging', () => { + it('should pass initialAttributes to kit for event logging', () => { const kit: Partial = { launcher: { selectPlacements: jest.fn(), @@ -1315,14 +1315,14 @@ describe('RoktManager', () => { expect(kit.selectPlacements).toHaveBeenCalledWith( expect.objectContaining({ - debugAttributes: { + initialAttributes: { 'customAttr': 'value', } }) ); }); - it('should include original attributes in debugAttributes even after mapping', () => { + it('should include original attributes in initialAttributes even after mapping', () => { const kit: Partial = { launcher: { selectPlacements: jest.fn(), @@ -1354,10 +1354,10 @@ describe('RoktManager', () => { roktManager.selectPlacements(options); - // debugAttributes should contain the ORIGINAL unmapped attributes + // initialAttributes should contain the ORIGINAL unmapped attributes expect(kit.selectPlacements).toHaveBeenCalledWith( expect.objectContaining({ - debugAttributes: { + initialAttributes: { 'f.name': 'John', 'userId': 'user123', }, @@ -1462,7 +1462,7 @@ describe('RoktManager', () => { 'email': 'test@example.com', 'sandbox': true }, - debugAttributes: { + initialAttributes: { 'email': 'test@example.com', 'sandbox': true, } From bdbb0710575145bd2b653a4e54a7871555a2bac6 Mon Sep 17 00:00:00 2001 From: Jaissica Date: Thu, 29 Jan 2026 18:14:10 -0500 Subject: [PATCH 05/13] chore: add attribute logging in selectPlacements --- src/roktManager.ts | 5 +- test/jest/roktManager.spec.ts | 119 ++++++++++++++-------------------- 2 files changed, 50 insertions(+), 74 deletions(-) diff --git a/src/roktManager.ts b/src/roktManager.ts index cfeaf0bbc..3738c2fff 100644 --- a/src/roktManager.ts +++ b/src/roktManager.ts @@ -193,7 +193,9 @@ export default class RoktManager { const { attributes } = options; const sandboxValue = attributes?.sandbox || null; const mappedAttributes = this.mapPlacementAttributes(attributes, this.placementAttributesMapping); - + this.logger?.verbose(`MParticle.Rokt selectPlacements called with attributes: ${JSON.stringify(attributes)}`); + + // Get current user identities this.currentUser = this.identityService.getCurrentUser(); const currentUserIdentities = this.currentUser?.getUserIdentities()?.userIdentities || {}; @@ -283,7 +285,6 @@ export default class RoktManager { const enrichedOptions = { ...options, attributes: enrichedAttributes, - initialAttributes: attributes, }; return this.kit.selectPlacements(enrichedOptions); diff --git a/test/jest/roktManager.spec.ts b/test/jest/roktManager.spec.ts index e91d4807c..b55dd31bc 100644 --- a/test/jest/roktManager.spec.ts +++ b/test/jest/roktManager.spec.ts @@ -762,10 +762,6 @@ describe('RoktManager', () => { mapped_key: 'test_value', // This key should be mapped other_attr: 'other_value' // This key should remain unchanged }, - initialAttributes: { - original_key: 'test_value', - other_attr: 'other_value' - } }; expect(kit.selectPlacements).toHaveBeenCalledWith(expectedMappedOptions); @@ -892,7 +888,6 @@ describe('RoktManager', () => { roktManager.selectPlacements(options); expect(kit.selectPlacements).toHaveBeenCalledWith({ attributes: {}, - initialAttributes: {} }); }); @@ -933,13 +928,6 @@ describe('RoktManager', () => { isActive: false, interests: 'sports,music,books' }, - initialAttributes: { - age: 25, - score: 100.5, - isSubscribed: true, - isActive: false, - interests: 'sports,music,books' - } }); }); @@ -1008,7 +996,6 @@ describe('RoktManager', () => { expect(roktManager['messageQueue'].size).toBe(0); expect(kit.selectPlacements).toHaveBeenCalledWith({ attributes: {}, - initialAttributes: {} }); expect(result).toEqual(expectedResult); }); @@ -1057,13 +1044,6 @@ describe('RoktManager', () => { isActive: false, interests: 'sports,music,books' }, - initialAttributes: { - age: 25, - score: 100.5, - isSubscribed: true, - isActive: false, - interests: 'sports,music,books' - } }; roktManager.selectPlacements(options); @@ -1104,10 +1084,6 @@ describe('RoktManager', () => { sandbox: true }, identifier: 'test-identifier', - initialAttributes: { - customAttr: 'value', - sandbox: true - } }); }); @@ -1145,10 +1121,6 @@ describe('RoktManager', () => { customAttr: 'value', sandbox: false }, - initialAttributes: { - customAttr: 'value', - sandbox: false - } }); }); @@ -1186,10 +1158,6 @@ describe('RoktManager', () => { sandbox: true }, identifier: 'test-identifier', - initialAttributes: { - customAttr: 'value', - sandbox: true - } }); }); @@ -1236,11 +1204,6 @@ describe('RoktManager', () => { lastname: 'Doe', score: 42, }, - initialAttributes: { - 'f.name': 'John', - 'last_name': 'Doe', - 'score': 42, - } }; roktManager.selectPlacements(options); @@ -1280,16 +1243,10 @@ describe('RoktManager', () => { 'score': 42, 'age': 25, }, - initialAttributes: { - 'f.name': 'John', - 'last_name': 'Doe', - 'score': 42, - 'age': 25, - } }); }); - it('should pass initialAttributes to kit for event logging', () => { + it('should log developer passed attributes via verbose logger', async () => { const kit: Partial = { launcher: { selectPlacements: jest.fn(), @@ -1297,7 +1254,7 @@ describe('RoktManager', () => { use: jest.fn(), }, hashAttributes: jest.fn(), - selectPlacements: jest.fn(), + selectPlacements: jest.fn().mockResolvedValue({}), setExtensionData: jest.fn(), use: jest.fn(), }; @@ -1305,24 +1262,37 @@ describe('RoktManager', () => { roktManager.kit = kit as IRoktKit; roktManager['placementAttributesMapping'] = []; + const mockIdentity = { + getCurrentUser: jest.fn().mockReturnValue({ + getUserIdentities: () => ({ + userIdentities: {} + }), + setUserAttributes: jest.fn() + }), + identify: jest.fn() + } as unknown as SDKIdentityApi; + + roktManager['identityService'] = mockIdentity; + const options: IRoktSelectPlacementsOptions = { attributes: { 'customAttr': 'value', } }; - roktManager.selectPlacements(options); + await roktManager.selectPlacements(options); - expect(kit.selectPlacements).toHaveBeenCalledWith( - expect.objectContaining({ - initialAttributes: { - 'customAttr': 'value', - } - }) + expect(mockMPInstance.Logger.verbose).toHaveBeenCalledWith( + 'MParticle.Rokt selectPlacements called with attributes: {"customAttr":"value"}' ); + expect(kit.selectPlacements).toHaveBeenCalledWith({ + attributes: { + 'customAttr': 'value', + } + }); }); - it('should include original attributes in initialAttributes even after mapping', () => { + it('should log original attributes even after mapping', async () => { const kit: Partial = { launcher: { selectPlacements: jest.fn(), @@ -1330,7 +1300,7 @@ describe('RoktManager', () => { use: jest.fn(), }, hashAttributes: jest.fn(), - selectPlacements: jest.fn(), + selectPlacements: jest.fn().mockResolvedValue({}), setExtensionData: jest.fn(), use: jest.fn(), }; @@ -1345,6 +1315,18 @@ describe('RoktManager', () => { } ]; + const mockIdentity = { + getCurrentUser: jest.fn().mockReturnValue({ + getUserIdentities: () => ({ + userIdentities: {} + }), + setUserAttributes: jest.fn() + }), + identify: jest.fn() + } as unknown as SDKIdentityApi; + + roktManager['identityService'] = mockIdentity; + const options: IRoktSelectPlacementsOptions = { attributes: { 'f.name': 'John', @@ -1352,22 +1334,19 @@ describe('RoktManager', () => { } }; - roktManager.selectPlacements(options); + await roktManager.selectPlacements(options); - // initialAttributes should contain the ORIGINAL unmapped attributes - expect(kit.selectPlacements).toHaveBeenCalledWith( - expect.objectContaining({ - initialAttributes: { - 'f.name': 'John', - 'userId': 'user123', - }, - // attributes should be mapped - attributes: { - 'firstname': 'John', - 'userId': 'user123', - } - }) + + expect(mockMPInstance.Logger.verbose).toHaveBeenCalledWith( + 'MParticle.Rokt selectPlacements called with attributes: {"f.name":"John","userId":"user123"}' ); + + expect(kit.selectPlacements).toHaveBeenCalledWith({ + attributes: { + 'firstname': 'John', + 'userId': 'user123', + } + }); }); it('should set the mapped attributes on the current user via setUserAttributes', async () => { @@ -1462,10 +1441,6 @@ describe('RoktManager', () => { 'email': 'test@example.com', 'sandbox': true }, - initialAttributes: { - 'email': 'test@example.com', - 'sandbox': true, - } }); expect(roktManager['currentUser'].setUserAttributes).not.toHaveBeenCalledWith({ From 45701d1f7a6e54d687cd7e270363e67a3b7936ac Mon Sep 17 00:00:00 2001 From: Jaissica Date: Thu, 29 Jan 2026 18:32:28 -0500 Subject: [PATCH 06/13] clean up roktManager test --- test/jest/roktManager.spec.ts | 274 ++++++++++++++-------------------- 1 file changed, 114 insertions(+), 160 deletions(-) diff --git a/test/jest/roktManager.spec.ts b/test/jest/roktManager.spec.ts index b55dd31bc..651e5410a 100644 --- a/test/jest/roktManager.spec.ts +++ b/test/jest/roktManager.spec.ts @@ -761,7 +761,7 @@ describe('RoktManager', () => { attributes: { mapped_key: 'test_value', // This key should be mapped other_attr: 'other_value' // This key should remain unchanged - }, + } }; expect(kit.selectPlacements).toHaveBeenCalledWith(expectedMappedOptions); @@ -863,6 +863,66 @@ describe('RoktManager', () => { }); + it('should capture jointSdkSelectPlacements timing when selectPlacements is called', () => { + const mockCaptureTiming = jest.fn(); + roktManager.init( + {} as IKitConfigs, + {} as IMParticleUser, + mockMPInstance.Identity, + mockMPInstance._Store, + mockMPInstance.Logger, + undefined, + mockCaptureTiming + ); + + const kit: IRoktKit = { + launcher: { + selectPlacements: jest.fn(), + hashAttributes: jest.fn(), + use: jest.fn(), + }, + filters: undefined, + filteredUser: undefined, + userAttributes: undefined, + selectPlacements: jest.fn(), + hashAttributes: jest.fn(), + setExtensionData: jest.fn(), + use: jest.fn(), + }; + + roktManager.attachKit(kit); + + const options = { + attributes: {} + } as IRoktSelectPlacementsOptions; + + roktManager.selectPlacements(options); + expect(mockCaptureTiming).toHaveBeenCalledWith(PerformanceMarkType.JointSdkSelectPlacements); + expect(mockCaptureTiming).toHaveBeenCalledTimes(1); + }); + + it('should capture jointSdkSelectPlacements timing even when kit is not ready (deferred call)', () => { + const mockCaptureTiming = jest.fn(); + roktManager.init( + {} as IKitConfigs, + {} as IMParticleUser, + mockMPInstance.Identity, + mockMPInstance._Store, + mockMPInstance.Logger, + undefined, + mockCaptureTiming + ); + + const options = { + attributes: {} + } as IRoktSelectPlacementsOptions; + + roktManager.selectPlacements(options); + expect(mockCaptureTiming).toHaveBeenCalledWith(PerformanceMarkType.JointSdkSelectPlacements); + expect(mockCaptureTiming).toHaveBeenCalledTimes(1); + }); + + it('should call kit.selectPlacements with empty attributes', () => { const kit: IRoktKit = { launcher: { @@ -886,9 +946,7 @@ describe('RoktManager', () => { } as IRoktSelectPlacementsOptions; roktManager.selectPlacements(options); - expect(kit.selectPlacements).toHaveBeenCalledWith({ - attributes: {}, - }); + expect(kit.selectPlacements).toHaveBeenCalledWith(options); }); it('should call kit.selectPlacements with passed in attributes', async () => { @@ -920,15 +978,7 @@ describe('RoktManager', () => { }; await roktManager.selectPlacements(options); - expect(kit.selectPlacements).toHaveBeenCalledWith({ - attributes: { - age: 25, - score: 100.5, - isSubscribed: true, - isActive: false, - interests: 'sports,music,books' - }, - }); + expect(kit.selectPlacements).toHaveBeenCalledWith(options); }); it('should queue the selectPlacements method if no launcher or kit is attached', () => { @@ -994,9 +1044,7 @@ describe('RoktManager', () => { expect(roktManager['kit']).not.toBeNull(); expect(roktManager['messageQueue'].size).toBe(0); - expect(kit.selectPlacements).toHaveBeenCalledWith({ - attributes: {}, - }); + expect(kit.selectPlacements).toHaveBeenCalledWith(options); expect(result).toEqual(expectedResult); }); @@ -1036,19 +1084,9 @@ describe('RoktManager', () => { } }; - const expectedOptions = { - attributes: { - age: 25, - score: 100.5, - isSubscribed: true, - isActive: false, - interests: 'sports,music,books' - }, - }; - roktManager.selectPlacements(options); - expect(kit.selectPlacements).toHaveBeenCalledWith(expectedOptions); - expect(kit.launcher.selectPlacements).toHaveBeenCalledWith(expectedOptions); + expect(kit.selectPlacements).toHaveBeenCalledWith(options); + expect(kit.launcher.selectPlacements).toHaveBeenCalledWith(options); }); it('should pass sandbox flag as an attribute through to kit.selectPlacements', () => { @@ -1078,13 +1116,7 @@ describe('RoktManager', () => { }; roktManager.selectPlacements(options); - expect(kit.selectPlacements).toHaveBeenCalledWith({ - attributes: { - customAttr: 'value', - sandbox: true - }, - identifier: 'test-identifier', - }); + expect(kit.selectPlacements).toHaveBeenCalledWith(options); }); it('should NOT override global sandbox in placement attributes when initialized as true', () => { @@ -1116,12 +1148,7 @@ describe('RoktManager', () => { roktManager.selectPlacements(options); expect(roktManager['sandbox']).toBeTruthy(); - expect(kit.selectPlacements).toHaveBeenCalledWith({ - attributes: { - customAttr: 'value', - sandbox: false - }, - }); + expect(kit.selectPlacements).toHaveBeenCalledWith(options); }); it('should set sandbox in placement attributes when not initialized globally', () => { @@ -1152,13 +1179,7 @@ describe('RoktManager', () => { }; roktManager.selectPlacements(options); - expect(kit.selectPlacements).toHaveBeenCalledWith({ - attributes: { - customAttr: 'value', - sandbox: true - }, - identifier: 'test-identifier', - }); + expect(kit.selectPlacements).toHaveBeenCalledWith(options); }); it('should pass mapped attributes to kit.launcher.selectPlacements', () => { @@ -1203,7 +1224,7 @@ describe('RoktManager', () => { firstname: 'John', lastname: 'Doe', score: 42, - }, + } }; roktManager.selectPlacements(options); @@ -1236,117 +1257,7 @@ describe('RoktManager', () => { }; roktManager.selectPlacements(options); - expect(kit.selectPlacements).toHaveBeenCalledWith({ - attributes: { - 'f.name': 'John', - 'last_name': 'Doe', - 'score': 42, - 'age': 25, - }, - }); - }); - - it('should log developer passed attributes via verbose logger', async () => { - const kit: Partial = { - launcher: { - selectPlacements: jest.fn(), - hashAttributes: jest.fn(), - use: jest.fn(), - }, - hashAttributes: jest.fn(), - selectPlacements: jest.fn().mockResolvedValue({}), - setExtensionData: jest.fn(), - use: jest.fn(), - }; - - roktManager.kit = kit as IRoktKit; - roktManager['placementAttributesMapping'] = []; - - const mockIdentity = { - getCurrentUser: jest.fn().mockReturnValue({ - getUserIdentities: () => ({ - userIdentities: {} - }), - setUserAttributes: jest.fn() - }), - identify: jest.fn() - } as unknown as SDKIdentityApi; - - roktManager['identityService'] = mockIdentity; - - const options: IRoktSelectPlacementsOptions = { - attributes: { - 'customAttr': 'value', - } - }; - - await roktManager.selectPlacements(options); - - expect(mockMPInstance.Logger.verbose).toHaveBeenCalledWith( - 'MParticle.Rokt selectPlacements called with attributes: {"customAttr":"value"}' - ); - expect(kit.selectPlacements).toHaveBeenCalledWith({ - attributes: { - 'customAttr': 'value', - } - }); - }); - - it('should log original attributes even after mapping', async () => { - const kit: Partial = { - launcher: { - selectPlacements: jest.fn(), - hashAttributes: jest.fn(), - use: jest.fn(), - }, - hashAttributes: jest.fn(), - selectPlacements: jest.fn().mockResolvedValue({}), - setExtensionData: jest.fn(), - use: jest.fn(), - }; - - roktManager.kit = kit as IRoktKit; - roktManager['placementAttributesMapping'] = [ - { - jsmap: null, - map: 'f.name', - maptype: 'UserAttributeClass.Name', - value: 'firstname' - } - ]; - - const mockIdentity = { - getCurrentUser: jest.fn().mockReturnValue({ - getUserIdentities: () => ({ - userIdentities: {} - }), - setUserAttributes: jest.fn() - }), - identify: jest.fn() - } as unknown as SDKIdentityApi; - - roktManager['identityService'] = mockIdentity; - - const options: IRoktSelectPlacementsOptions = { - attributes: { - 'f.name': 'John', - 'userId': 'user123', - } - }; - - await roktManager.selectPlacements(options); - - - expect(mockMPInstance.Logger.verbose).toHaveBeenCalledWith( - 'MParticle.Rokt selectPlacements called with attributes: {"f.name":"John","userId":"user123"}' - ); - - expect(kit.selectPlacements).toHaveBeenCalledWith({ - attributes: { - 'firstname': 'John', - 'userId': 'user123', - } - }); + expect(kit.selectPlacements).toHaveBeenCalledWith(options); }); it('should set the mapped attributes on the current user via setUserAttributes', async () => { @@ -2488,6 +2399,49 @@ describe('RoktManager', () => { // Verify kit was called expect(kit.selectPlacements).toHaveBeenCalled(); }); + + it('should log developer passed attributes via verbose logger', async () => { + const kit: Partial = { + launcher: { + selectPlacements: jest.fn(), + hashAttributes: jest.fn(), + use: jest.fn(), + }, + hashAttributes: jest.fn(), + selectPlacements: jest.fn().mockResolvedValue({}), + setExtensionData: jest.fn(), + use: jest.fn(), + }; + + roktManager.kit = kit as IRoktKit; + + const mockIdentity = { + getCurrentUser: jest.fn().mockReturnValue({ + getUserIdentities: () => ({ + userIdentities: { + email: 'test@example.com' + } + }), + setUserAttributes: jest.fn() + }), + identify: jest.fn() + } as unknown as SDKIdentityApi; + + roktManager['identityService'] = mockIdentity; + + const options: IRoktSelectPlacementsOptions = { + attributes: { + email: 'test@example.com', + customAttr: 'value', + } + }; + + await roktManager.selectPlacements(options); + + expect(mockMPInstance.Logger.verbose).toHaveBeenCalledWith( + 'MParticle.Rokt selectPlacements called with attributes: {"email":"test@example.com","customAttr":"value"}' + ); + }); }); describe('#setExtensionData', () => { From 5bcbe1816bc74ef76d0ea00f9c83bee174281910 Mon Sep 17 00:00:00 2001 From: Jaissica Date: Thu, 29 Jan 2026 18:43:28 -0500 Subject: [PATCH 07/13] fix failing roktManager test --- test/jest/roktManager.spec.ts | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/test/jest/roktManager.spec.ts b/test/jest/roktManager.spec.ts index 651e5410a..071250ba8 100644 --- a/test/jest/roktManager.spec.ts +++ b/test/jest/roktManager.spec.ts @@ -1880,6 +1880,49 @@ describe('RoktManager', () => { ); }); + it('should log developer passed attributes via verbose logger', async () => { + const kit: Partial = { + launcher: { + selectPlacements: jest.fn(), + hashAttributes: jest.fn(), + use: jest.fn(), + }, + hashAttributes: jest.fn(), + selectPlacements: jest.fn().mockResolvedValue({}), + setExtensionData: jest.fn(), + use: jest.fn(), + }; + + roktManager.kit = kit as IRoktKit; + + const mockIdentity = { + getCurrentUser: jest.fn().mockReturnValue({ + getUserIdentities: () => ({ + userIdentities: { + email: 'test@example.com' + } + }), + setUserAttributes: jest.fn() + }), + identify: jest.fn() + } as unknown as SDKIdentityApi; + + roktManager['identityService'] = mockIdentity; + + const options: IRoktSelectPlacementsOptions = { + attributes: { + email: 'test@example.com', + customAttr: 'value', + } + }; + + await roktManager.selectPlacements(options); + + expect(mockMPInstance.Logger.verbose).toHaveBeenCalledWith( + 'MParticle.Rokt selectPlacements called with attributes: {"email":"test@example.com","customAttr":"value"}' + ); + }); + it('should propagate emailsha256 from current user identities to kit.selectPlacements when not in attributes', async () => { const testRoktManager = new RoktManager(); const kit: Partial = { From 670b9d5813edd9382fd30f6f51f13fc181721f0a Mon Sep 17 00:00:00 2001 From: Jaissica Date: Fri, 30 Jan 2026 10:19:03 -0500 Subject: [PATCH 08/13] update verbose logging for selectPlacements input --- src/roktManager.ts | 2 +- test/jest/roktManager.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/roktManager.ts b/src/roktManager.ts index 3738c2fff..9e9f2ece9 100644 --- a/src/roktManager.ts +++ b/src/roktManager.ts @@ -193,7 +193,7 @@ export default class RoktManager { const { attributes } = options; const sandboxValue = attributes?.sandbox || null; const mappedAttributes = this.mapPlacementAttributes(attributes, this.placementAttributesMapping); - this.logger?.verbose(`MParticle.Rokt selectPlacements called with attributes: ${JSON.stringify(attributes)}`); + this.logger?.verbose(`mParticle.Rokt selectPlacements called with attributes:\n${JSON.stringify(attributes, null, 2)}`); // Get current user identities this.currentUser = this.identityService.getCurrentUser(); diff --git a/test/jest/roktManager.spec.ts b/test/jest/roktManager.spec.ts index 071250ba8..73fe7eab2 100644 --- a/test/jest/roktManager.spec.ts +++ b/test/jest/roktManager.spec.ts @@ -1919,7 +1919,7 @@ describe('RoktManager', () => { await roktManager.selectPlacements(options); expect(mockMPInstance.Logger.verbose).toHaveBeenCalledWith( - 'MParticle.Rokt selectPlacements called with attributes: {"email":"test@example.com","customAttr":"value"}' + `mParticle.Rokt selectPlacements called with attributes:\n${JSON.stringify({ email: 'test@example.com', customAttr: 'value' }, null, 2)}` ); }); From 391d2f354099fc999d56215c16fc7a07fced0bce Mon Sep 17 00:00:00 2001 From: Jaissica Date: Fri, 30 Jan 2026 10:50:40 -0500 Subject: [PATCH 09/13] remove comment about user identities --- src/roktManager.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/roktManager.ts b/src/roktManager.ts index 9e9f2ece9..2450e58ea 100644 --- a/src/roktManager.ts +++ b/src/roktManager.ts @@ -195,7 +195,6 @@ export default class RoktManager { const mappedAttributes = this.mapPlacementAttributes(attributes, this.placementAttributesMapping); this.logger?.verbose(`mParticle.Rokt selectPlacements called with attributes:\n${JSON.stringify(attributes, null, 2)}`); - // Get current user identities this.currentUser = this.identityService.getCurrentUser(); const currentUserIdentities = this.currentUser?.getUserIdentities()?.userIdentities || {}; From 5c3880c40da692ae2ee55f675808c3aea9a097d3 Mon Sep 17 00:00:00 2001 From: Jaissica Date: Fri, 30 Jan 2026 17:03:33 -0500 Subject: [PATCH 10/13] fix roktManager test post merge --- test/jest/roktManager.spec.ts | 110 +--------------------------------- 1 file changed, 3 insertions(+), 107 deletions(-) diff --git a/test/jest/roktManager.spec.ts b/test/jest/roktManager.spec.ts index 73fe7eab2..c892f1665 100644 --- a/test/jest/roktManager.spec.ts +++ b/test/jest/roktManager.spec.ts @@ -802,65 +802,6 @@ describe('RoktManager', () => { roktManager['currentUser'] = currentUser; jest.clearAllMocks(); }); - - it('should capture jointSdkSelectPlacements timing when selectPlacements is called', () => { - const mockCaptureTiming = jest.fn(); - roktManager.init( - {} as IKitConfigs, - {} as IMParticleUser, - mockMPInstance.Identity, - mockMPInstance._Store, - mockMPInstance.Logger, - undefined, - mockCaptureTiming - ); - - const kit: IRoktKit = { - launcher: { - selectPlacements: jest.fn(), - hashAttributes: jest.fn(), - use: jest.fn(), - }, - filters: undefined, - filteredUser: undefined, - userAttributes: undefined, - selectPlacements: jest.fn(), - hashAttributes: jest.fn(), - setExtensionData: jest.fn(), - use: jest.fn(), - }; - - roktManager.attachKit(kit); - - const options = { - attributes: {} - } as IRoktSelectPlacementsOptions; - - roktManager.selectPlacements(options); - expect(mockCaptureTiming).toHaveBeenCalledWith(PerformanceMarkType.JointSdkSelectPlacements); - expect(mockCaptureTiming).toHaveBeenCalledTimes(1); - }); - - it('should capture jointSdkSelectPlacements timing even when kit is not ready (deferred call)', () => { - const mockCaptureTiming = jest.fn(); - roktManager.init( - {} as IKitConfigs, - {} as IMParticleUser, - mockMPInstance.Identity, - mockMPInstance._Store, - mockMPInstance.Logger, - undefined, - mockCaptureTiming - ); - - const options = { - attributes: {} - } as IRoktSelectPlacementsOptions; - - roktManager.selectPlacements(options); - expect(mockCaptureTiming).toHaveBeenCalledWith(PerformanceMarkType.JointSdkSelectPlacements); - expect(mockCaptureTiming).toHaveBeenCalledTimes(1); - }); it('should capture jointSdkSelectPlacements timing when selectPlacements is called', () => { @@ -923,7 +864,7 @@ describe('RoktManager', () => { }); - it('should call kit.selectPlacements with empty attributes', () => { + it('should call kit.selectPlacements with empty attributes', async () => { const kit: IRoktKit = { launcher: { selectPlacements: jest.fn(), @@ -945,7 +886,7 @@ describe('RoktManager', () => { attributes: {} } as IRoktSelectPlacementsOptions; - roktManager.selectPlacements(options); + await roktManager.selectPlacements(options); expect(kit.selectPlacements).toHaveBeenCalledWith(options); }); @@ -1353,8 +1294,6 @@ describe('RoktManager', () => { 'sandbox': true }, }); - expect(roktManager['currentUser'].setUserAttributes).not.toHaveBeenCalledWith({ - expect(setUserAttributesSpy).not.toHaveBeenCalledWith({ sandbox: true }); @@ -1880,49 +1819,6 @@ describe('RoktManager', () => { ); }); - it('should log developer passed attributes via verbose logger', async () => { - const kit: Partial = { - launcher: { - selectPlacements: jest.fn(), - hashAttributes: jest.fn(), - use: jest.fn(), - }, - hashAttributes: jest.fn(), - selectPlacements: jest.fn().mockResolvedValue({}), - setExtensionData: jest.fn(), - use: jest.fn(), - }; - - roktManager.kit = kit as IRoktKit; - - const mockIdentity = { - getCurrentUser: jest.fn().mockReturnValue({ - getUserIdentities: () => ({ - userIdentities: { - email: 'test@example.com' - } - }), - setUserAttributes: jest.fn() - }), - identify: jest.fn() - } as unknown as SDKIdentityApi; - - roktManager['identityService'] = mockIdentity; - - const options: IRoktSelectPlacementsOptions = { - attributes: { - email: 'test@example.com', - customAttr: 'value', - } - }; - - await roktManager.selectPlacements(options); - - expect(mockMPInstance.Logger.verbose).toHaveBeenCalledWith( - `mParticle.Rokt selectPlacements called with attributes:\n${JSON.stringify({ email: 'test@example.com', customAttr: 'value' }, null, 2)}` - ); - }); - it('should propagate emailsha256 from current user identities to kit.selectPlacements when not in attributes', async () => { const testRoktManager = new RoktManager(); const kit: Partial = { @@ -2482,7 +2378,7 @@ describe('RoktManager', () => { await roktManager.selectPlacements(options); expect(mockMPInstance.Logger.verbose).toHaveBeenCalledWith( - 'MParticle.Rokt selectPlacements called with attributes: {"email":"test@example.com","customAttr":"value"}' + `mParticle.Rokt selectPlacements called with attributes:\n${JSON.stringify({ email: 'test@example.com', customAttr: 'value' }, null, 2)}` ); }); }); From 73269defd17eeb67e59b59a836339d2d8884269c Mon Sep 17 00:00:00 2001 From: Jaissica Date: Fri, 30 Jan 2026 17:07:27 -0500 Subject: [PATCH 11/13] update roktManager tests --- test/jest/roktManager.spec.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/test/jest/roktManager.spec.ts b/test/jest/roktManager.spec.ts index c892f1665..c808abd08 100644 --- a/test/jest/roktManager.spec.ts +++ b/test/jest/roktManager.spec.ts @@ -863,8 +863,7 @@ describe('RoktManager', () => { expect(mockCaptureTiming).toHaveBeenCalledTimes(1); }); - - it('should call kit.selectPlacements with empty attributes', async () => { + it('should call kit.selectPlacements with empty attributes', () => { const kit: IRoktKit = { launcher: { selectPlacements: jest.fn(), @@ -886,7 +885,7 @@ describe('RoktManager', () => { attributes: {} } as IRoktSelectPlacementsOptions; - await roktManager.selectPlacements(options); + roktManager.selectPlacements(options); expect(kit.selectPlacements).toHaveBeenCalledWith(options); }); @@ -1287,13 +1286,8 @@ describe('RoktManager', () => { } }; - roktManager.selectPlacements(options); - expect(kit.selectPlacements).toHaveBeenCalledWith({ - attributes: { - 'email': 'test@example.com', - 'sandbox': true - }, - }); + await roktManager.selectPlacements(options); + expect(kit.selectPlacements).toHaveBeenCalledWith(options); expect(setUserAttributesSpy).not.toHaveBeenCalledWith({ sandbox: true }); From 9f3e1f5bcc578258a3ae9d549ad4042c4c9506e4 Mon Sep 17 00:00:00 2001 From: Jaissica Date: Fri, 30 Jan 2026 17:10:06 -0500 Subject: [PATCH 12/13] remove extra line --- test/jest/roktManager.spec.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/jest/roktManager.spec.ts b/test/jest/roktManager.spec.ts index c808abd08..212b14fed 100644 --- a/test/jest/roktManager.spec.ts +++ b/test/jest/roktManager.spec.ts @@ -801,8 +801,7 @@ describe('RoktManager', () => { beforeEach(() => { roktManager['currentUser'] = currentUser; jest.clearAllMocks(); - }); - + }); it('should capture jointSdkSelectPlacements timing when selectPlacements is called', () => { const mockCaptureTiming = jest.fn(); @@ -862,7 +861,7 @@ describe('RoktManager', () => { expect(mockCaptureTiming).toHaveBeenCalledWith(PerformanceMarkType.JointSdkSelectPlacements); expect(mockCaptureTiming).toHaveBeenCalledTimes(1); }); - + it('should call kit.selectPlacements with empty attributes', () => { const kit: IRoktKit = { launcher: { From f5447cdb7fe8887b7a97ec33dc8f42dd3ac649b2 Mon Sep 17 00:00:00 2001 From: Jaissica Date: Fri, 30 Jan 2026 17:12:06 -0500 Subject: [PATCH 13/13] fix roktManager test --- test/jest/roktManager.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/jest/roktManager.spec.ts b/test/jest/roktManager.spec.ts index 212b14fed..23ab1cdf0 100644 --- a/test/jest/roktManager.spec.ts +++ b/test/jest/roktManager.spec.ts @@ -801,7 +801,7 @@ describe('RoktManager', () => { beforeEach(() => { roktManager['currentUser'] = currentUser; jest.clearAllMocks(); - }); + }); it('should capture jointSdkSelectPlacements timing when selectPlacements is called', () => { const mockCaptureTiming = jest.fn(); @@ -861,7 +861,7 @@ describe('RoktManager', () => { expect(mockCaptureTiming).toHaveBeenCalledWith(PerformanceMarkType.JointSdkSelectPlacements); expect(mockCaptureTiming).toHaveBeenCalledTimes(1); }); - + it('should call kit.selectPlacements with empty attributes', () => { const kit: IRoktKit = { launcher: {