@@ -815,8 +815,7 @@ describe('javascript-sdk (Browser)', function() {
815815 sinon . assert . called ( fakeEventManager . sendEvent ) ;
816816 } ) ;
817817
818- // TODO: Unskip and fix this test. I'm skipping it for now to move FSSDK-10711 forward
819- xit ( 'should augment odp events with user agent data if userAgentParser is provided' , async ( ) => {
818+ it ( 'should augment odp events with user agent data if userAgentParser is provided' , async ( ) => {
820819 const userAgentParser = {
821820 parseUserAgentInfo ( ) {
822821 return {
@@ -853,6 +852,7 @@ describe('javascript-sdk (Browser)', function() {
853852
854853 client . sendOdpEvent ( 'test' , '' , new Map ( [ [ 'eamil' , 'test@test.test' ] ] ) , new Map ( [ [ 'key' , 'value' ] ] ) ) ;
855854 clock . tick ( 10000 ) ;
855+ await Promise . resolve ( ) ;
856856
857857 const eventRequestUrl = new URL ( fakeRequestHandler . makeRequest . lastCall . args [ 0 ] ) ;
858858 const searchParams = eventRequestUrl . searchParams ;
@@ -1058,8 +1058,7 @@ describe('javascript-sdk (Browser)', function() {
10581058 assert ( client . odpManager . eventManager . batchSize , 1 ) ;
10591059 } ) ;
10601060
1061- // TODO: Unskip and fix this test. I'm skipping it for now to move FSSDK-10711 forward
1062- xit ( 'should send an odp event to the browser endpoint' , async ( ) => {
1061+ it ( 'should send a client_initialized odp event to the browser endpoint' , async ( ) => {
10631062 const odpConfig = new OdpConfig ( ) ;
10641063
10651064 const apiManager = new BrowserOdpEventApiManager ( mockRequestHandler , logger ) ;
@@ -1078,6 +1077,7 @@ describe('javascript-sdk (Browser)', function() {
10781077 errorHandler : fakeErrorHandler ,
10791078 eventDispatcher : fakeEventDispatcher ,
10801079 eventBatchSize : null ,
1080+ vuidOptions : { enableVuid : true } ,
10811081 logger,
10821082 odpOptions : {
10831083 odpConfig,
@@ -1089,10 +1089,10 @@ describe('javascript-sdk (Browser)', function() {
10891089 assert . equal ( readyData . success , true ) ;
10901090 assert . isUndefined ( readyData . reason ) ;
10911091
1092- client . sendOdpEvent ( ODP_EVENT_ACTION . INITIALIZED ) ;
10931092
10941093 // wait for request to be sent
1095- clock . tick ( 100 ) ;
1094+ clock . tick ( 10000 ) ;
1095+ await Promise . resolve ( ) ;
10961096
10971097 let publicKey = datafile . integrations [ 0 ] . publicKey ;
10981098 let pixelUrl = datafile . integrations [ 0 ] . pixelUrl ;
@@ -1115,42 +1115,6 @@ describe('javascript-sdk (Browser)', function() {
11151115
11161116 sinon . assert . notCalled ( logger . error ) ;
11171117 } ) ;
1118-
1119- // TODO: Unskip and fix this test. I'm skipping it for now to move FSSDK-10711 forward
1120- xit ( 'should send odp client_initialized on client instantiation' , async ( ) => {
1121- const odpConfig = new OdpConfig ( 'key' , 'host' , 'pixel' , [ ] ) ;
1122- const apiManager = new BrowserOdpEventApiManager ( mockRequestHandler , logger ) ;
1123- sinon . spy ( apiManager , 'sendEvents' ) ;
1124- const eventManager = new BrowserOdpEventManager ( {
1125- odpConfig,
1126- apiManager,
1127- logger,
1128- } ) ;
1129- const datafile = testData . getOdpIntegratedConfigWithSegments ( ) ;
1130- const client = optimizelyFactory . createInstance ( {
1131- datafile,
1132- errorHandler : fakeErrorHandler ,
1133- eventDispatcher : fakeEventDispatcher ,
1134- eventBatchSize : null ,
1135- logger,
1136- odpOptions : {
1137- odpConfig,
1138- eventManager,
1139- } ,
1140- } ) ;
1141-
1142- const readyData = await client . onReady ( ) ;
1143- assert . equal ( readyData . success , true ) ;
1144- assert . isUndefined ( readyData . reason ) ;
1145-
1146- clock . tick ( 100 ) ;
1147-
1148- const [ _ , events ] = apiManager . sendEvents . getCall ( 0 ) . args ;
1149-
1150- const [ firstEvent ] = events ;
1151- assert . equal ( firstEvent . action , 'client_initialized' ) ;
1152- assert . equal ( firstEvent . type , 'fullstack' ) ;
1153- } ) ;
11541118 } ) ;
11551119 } ) ;
11561120} ) ;
0 commit comments