Skip to content

Commit b3d5eb5

Browse files
committed
rename debugAttributes to initialAttributes
1 parent a34606a commit b3d5eb5

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

src/roktManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ export default class RoktManager {
245245
const enrichedOptions = {
246246
...options,
247247
attributes: enrichedAttributes,
248-
debugAttributes: attributes,
248+
initialAttributes: attributes,
249249
};
250250

251251
return this.kit.selectPlacements(enrichedOptions);

test/jest/roktManager.spec.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ describe('RoktManager', () => {
594594
mapped_key: 'test_value', // This key should be mapped
595595
other_attr: 'other_value' // This key should remain unchanged
596596
},
597-
debugAttributes: {
597+
initialAttributes: {
598598
original_key: 'test_value',
599599
other_attr: 'other_value'
600600
}
@@ -664,7 +664,7 @@ describe('RoktManager', () => {
664664
roktManager.selectPlacements(options);
665665
expect(kit.selectPlacements).toHaveBeenCalledWith({
666666
attributes: {},
667-
debugAttributes: {}
667+
initialAttributes: {}
668668
});
669669
});
670670

@@ -705,7 +705,7 @@ describe('RoktManager', () => {
705705
isActive: false,
706706
interests: 'sports,music,books'
707707
},
708-
debugAttributes: {
708+
initialAttributes: {
709709
age: 25,
710710
score: 100.5,
711711
isSubscribed: true,
@@ -776,7 +776,7 @@ describe('RoktManager', () => {
776776
expect(roktManager['messageQueue'].size).toBe(0);
777777
expect(kit.selectPlacements).toHaveBeenCalledWith({
778778
attributes: {},
779-
debugAttributes: {}
779+
initialAttributes: {}
780780
});
781781
expect(result).toEqual(expectedResult);
782782
});
@@ -825,7 +825,7 @@ describe('RoktManager', () => {
825825
isActive: false,
826826
interests: 'sports,music,books'
827827
},
828-
debugAttributes: {
828+
initialAttributes: {
829829
age: 25,
830830
score: 100.5,
831831
isSubscribed: true,
@@ -872,7 +872,7 @@ describe('RoktManager', () => {
872872
sandbox: true
873873
},
874874
identifier: 'test-identifier',
875-
debugAttributes: {
875+
initialAttributes: {
876876
customAttr: 'value',
877877
sandbox: true
878878
}
@@ -913,7 +913,7 @@ describe('RoktManager', () => {
913913
customAttr: 'value',
914914
sandbox: false
915915
},
916-
debugAttributes: {
916+
initialAttributes: {
917917
customAttr: 'value',
918918
sandbox: false
919919
}
@@ -954,7 +954,7 @@ describe('RoktManager', () => {
954954
sandbox: true
955955
},
956956
identifier: 'test-identifier',
957-
debugAttributes: {
957+
initialAttributes: {
958958
customAttr: 'value',
959959
sandbox: true
960960
}
@@ -1004,7 +1004,7 @@ describe('RoktManager', () => {
10041004
lastname: 'Doe',
10051005
score: 42,
10061006
},
1007-
debugAttributes: {
1007+
initialAttributes: {
10081008
'f.name': 'John',
10091009
'last_name': 'Doe',
10101010
'score': 42,
@@ -1048,7 +1048,7 @@ describe('RoktManager', () => {
10481048
'score': 42,
10491049
'age': 25,
10501050
},
1051-
debugAttributes: {
1051+
initialAttributes: {
10521052
'f.name': 'John',
10531053
'last_name': 'Doe',
10541054
'score': 42,
@@ -1057,7 +1057,7 @@ describe('RoktManager', () => {
10571057
});
10581058
});
10591059

1060-
it('should pass debugAttributes to kit for event logging', () => {
1060+
it('should pass initialAttributes to kit for event logging', () => {
10611061
const kit: Partial<IRoktKit> = {
10621062
launcher: {
10631063
selectPlacements: jest.fn(),
@@ -1083,14 +1083,14 @@ describe('RoktManager', () => {
10831083

10841084
expect(kit.selectPlacements).toHaveBeenCalledWith(
10851085
expect.objectContaining({
1086-
debugAttributes: {
1086+
initialAttributes: {
10871087
'customAttr': 'value',
10881088
}
10891089
})
10901090
);
10911091
});
10921092

1093-
it('should include original attributes in debugAttributes even after mapping', () => {
1093+
it('should include original attributes in initialAttributes even after mapping', () => {
10941094
const kit: Partial<IRoktKit> = {
10951095
launcher: {
10961096
selectPlacements: jest.fn(),
@@ -1122,10 +1122,10 @@ describe('RoktManager', () => {
11221122

11231123
roktManager.selectPlacements(options);
11241124

1125-
// debugAttributes should contain the ORIGINAL unmapped attributes
1125+
// initialAttributes should contain the ORIGINAL unmapped attributes
11261126
expect(kit.selectPlacements).toHaveBeenCalledWith(
11271127
expect.objectContaining({
1128-
debugAttributes: {
1128+
initialAttributes: {
11291129
'f.name': 'John',
11301130
'userId': 'user123',
11311131
},
@@ -1230,7 +1230,7 @@ describe('RoktManager', () => {
12301230
'email': 'test@example.com',
12311231
'sandbox': true
12321232
},
1233-
debugAttributes: {
1233+
initialAttributes: {
12341234
'email': 'test@example.com',
12351235
'sandbox': true,
12361236
}

0 commit comments

Comments
 (0)