@@ -230,62 +230,6 @@ describe('Pixel', () => {
230230 } ) ;
231231 } ) ;
232232
233- describe ( 'identify' , ( ) => {
234- it ( 'enqueues identify message with identityType at full consent' , ( ) => {
235- mockGetOrCreateSession . mockReturnValue ( { sessionId : 'session-abc' , isNew : false } ) ;
236-
237- const pixel = new Pixel ( ) ;
238- activePixel = pixel ;
239- pixel . init ( { key : 'pk_test' , environment : 'dev' , consent : 'full' } ) ;
240- mockEnqueue . mockClear ( ) ;
241-
242- pixel . identify ( 'user-1' , 'passport' , { email : 'test@example.com' } ) ;
243-
244- expect ( mockEnqueue ) . toHaveBeenCalledWith (
245- expect . objectContaining ( {
246- type : 'identify' ,
247- userId : 'user-1' ,
248- identityType : 'passport' ,
249- surface : 'pixel' ,
250- traits : expect . objectContaining ( {
251- email : 'test@example.com' ,
252- sessionId : 'session-abc' ,
253- } ) ,
254- } ) ,
255- ) ;
256- } ) ;
257-
258- it ( 'enqueues identify message without traits' , ( ) => {
259- mockGetOrCreateSession . mockReturnValue ( { sessionId : 'session-abc' , isNew : false } ) ;
260-
261- const pixel = new Pixel ( ) ;
262- activePixel = pixel ;
263- pixel . init ( { key : 'pk_test' , environment : 'dev' , consent : 'full' } ) ;
264- mockEnqueue . mockClear ( ) ;
265-
266- pixel . identify ( 'steam-id-123' , 'steam' ) ;
267-
268- expect ( mockEnqueue ) . toHaveBeenCalledWith (
269- expect . objectContaining ( {
270- type : 'identify' ,
271- userId : 'steam-id-123' ,
272- identityType : 'steam' ,
273- } ) ,
274- ) ;
275- } ) ;
276-
277- it ( 'does not enqueue identify at anonymous consent' , ( ) => {
278- const pixel = new Pixel ( ) ;
279- activePixel = pixel ;
280- pixel . init ( { key : 'pk_test' , environment : 'dev' , consent : 'anonymous' } ) ;
281-
282- pixel . identify ( 'user-1' , 'passport' ) ;
283- // Only the auto page view + session_start, no identify
284- const calls = mockEnqueue . mock . calls . map ( ( c : unknown [ ] ) => ( c [ 0 ] as Record < string , unknown > ) ) ;
285- expect ( calls . find ( ( c ) => c . type === 'identify' ) ) . toBeUndefined ( ) ;
286- } ) ;
287- } ) ;
288-
289233 describe ( 'session_end' , ( ) => {
290234 it ( 'fires session_end on pagehide when session is active' , ( ) => {
291235 const pixel = new Pixel ( ) ;
0 commit comments