@@ -1381,94 +1381,5 @@ describe('batch uploader', () => {
13811381 'Batch 4: AST'
13821382 ) . to . equal ( 'application_state_transition' ) ;
13831383 } ) ;
1384-
1385- describe ( 'noFunctional' , ( ) => {
1386- const eventStorageKey = 'mprtcl-v4_abcdef-events' ;
1387- const batchStorageKey = 'mprtcl-v4_abcdef-batches' ;
1388-
1389- it ( 'should store batches in session storage when noFunctional is false by default' , async ( ) => {
1390- window . mParticle . config . flags = {
1391- offlineStorage : '100' ,
1392- ...enableBatchingConfigFlags ,
1393- } ;
1394- window . mParticle . init ( apiKey , window . mParticle . config ) ;
1395- await waitForCondition ( hasIdentifyReturned ) ;
1396- const mpInstance = window . mParticle . getInstance ( ) ;
1397- const uploader = mpInstance . _APIClient . uploader ;
1398- uploader . queueEvent ( event0 ) ;
1399- expect ( window . sessionStorage . getItem ( eventStorageKey ) ) . to . not . equal ( null ) ;
1400- } ) ;
1401-
1402- it ( 'should NOT store events in session storage when noFunctional is true' , async ( ) => {
1403- window . mParticle . config . flags = {
1404- offlineStorage : '100' ,
1405- ...enableBatchingConfigFlags ,
1406- } ;
1407- window . mParticle . config . launcherOptions = { noFunctional : true } ;
1408- window . mParticle . init ( apiKey , window . mParticle . config ) ;
1409- await waitForCondition ( hasIdentifyReturned ) ;
1410- const mpInstance = window . mParticle . getInstance ( ) ;
1411- const uploader = mpInstance . _APIClient . uploader ;
1412- uploader . queueEvent ( event0 ) ;
1413- expect ( window . sessionStorage . getItem ( eventStorageKey ) ) . to . equal ( null ) ;
1414- } ) ;
1415-
1416- it ( 'should store events in session storage when noFunctional is false' , async ( ) => {
1417- window . mParticle . config . flags = {
1418- offlineStorage : '100' ,
1419- ...enableBatchingConfigFlags ,
1420- } ;
1421- window . mParticle . config . launcherOptions = { noFunctional : false } ;
1422- window . mParticle . init ( apiKey , window . mParticle . config ) ;
1423- await waitForCondition ( hasIdentifyReturned ) ;
1424- const mpInstance = window . mParticle . getInstance ( ) ;
1425- const uploader = mpInstance . _APIClient . uploader ;
1426- uploader . queueEvent ( event0 ) ;
1427- expect ( window . sessionStorage . getItem ( eventStorageKey ) ) . to . not . equal ( null ) ;
1428- } ) ;
1429-
1430- it ( 'should store batches in local storage when noFunctional is false by default' , async ( ) => {
1431- window . mParticle . init ( apiKey , window . mParticle . config ) ;
1432- await waitForCondition ( hasIdentifyReturned ) ;
1433- const mpInstance = window . mParticle . getInstance ( ) ;
1434- const uploader = mpInstance . _APIClient . uploader ;
1435- fetchMock . post ( urls . events , 500 , { overwriteRoutes : true } ) ;
1436- uploader . queueEvent ( event0 ) ;
1437- await window . mParticle . getInstance ( ) . _APIClient . uploader . prepareAndUpload ( ) ;
1438- expect ( window . localStorage . getItem ( batchStorageKey ) ) . to . not . equal ( null ) ;
1439- } ) ;
1440-
1441- it ( 'should NOT store batches in local storage when noFunctional is true' , async ( ) => {
1442- window . mParticle . config . flags = {
1443- offlineStorage : '100' ,
1444- ...enableBatchingConfigFlags ,
1445- } ;
1446- window . mParticle . config . launcherOptions = { noFunctional : true } ;
1447- window . mParticle . init ( apiKey , window . mParticle . config ) ;
1448- await waitForCondition ( hasIdentifyReturned ) ;
1449- const mpInstance = window . mParticle . getInstance ( ) ;
1450- const uploader = mpInstance . _APIClient . uploader ;
1451- uploader . queueEvent ( event0 ) ;
1452- await window . mParticle . getInstance ( ) . _APIClient . uploader . prepareAndUpload ( ) ;
1453- expect ( window . localStorage . getItem ( batchStorageKey ) ) . to . equal ( null ) ;
1454- } ) ;
1455-
1456- it ( 'should store batches in local storage when noFunctional is false' , async ( ) => {
1457- window . mParticle . config . flags = {
1458- offlineStorage : '100' ,
1459- ...enableBatchingConfigFlags ,
1460- } ;
1461- window . mParticle . config . launcherOptions = { noFunctional : false } ;
1462- window . mParticle . init ( apiKey , window . mParticle . config ) ;
1463- await waitForCondition ( hasIdentifyReturned ) ;
1464- const mpInstance = window . mParticle . getInstance ( ) ;
1465- const uploader = mpInstance . _APIClient . uploader ;
1466- fetchMock . post ( urls . events , 500 , { overwriteRoutes : true } ) ;
1467- uploader . queueEvent ( event0 ) ;
1468- await window . mParticle . getInstance ( ) . _APIClient . uploader . prepareAndUpload ( ) ;
1469- expect ( window . localStorage . getItem ( batchStorageKey ) ) . to . not . equal ( null ) ;
1470- } ) ;
1471-
1472- } ) ;
14731384 } ) ;
14741385} ) ;
0 commit comments