@@ -1882,81 +1882,6 @@ describe('persistence', () => {
18821882 beforeEach ( ( ) => {
18831883 mParticle . config . launcherOptions = { noFunctional : true } ;
18841884 } ) ;
1885-
1886- it ( 'should NOT store cookie when useCookieStorage = true' , async ( ) => {
1887- mParticle . config . useCookieStorage = true ;
1888-
1889- mParticle . init ( apiKey , mParticle . config ) ;
1890- await waitForCondition ( hasIdentifyReturned ) ;
1891-
1892- mParticle . getInstance ( ) . _Persistence . update ( ) ;
1893-
1894- expect ( findCookie ( ) ) . to . not . be . ok ;
1895- } ) ;
1896-
1897- it ( 'should NOT write localStorage when useCookieStorage = false' , async ( ) => {
1898- mParticle . config . useCookieStorage = false ;
1899-
1900- mParticle . init ( apiKey , mParticle . config ) ;
1901- await waitForCondition ( hasIdentifyReturned ) ;
1902-
1903- mParticle . getInstance ( ) . _Persistence . update ( ) ;
1904-
1905- expect ( getLocalStorage ( ) ) . to . not . be . ok ;
1906- } ) ;
1907-
1908- it ( 'should allow identity calls and event sending without any persistence data' , async ( ) => {
1909- mParticle . config . useCookieStorage = false ;
1910- mParticle . init ( apiKey , mParticle . config ) ;
1911-
1912- await waitForCondition ( hasIdentifyReturned ) ;
1913-
1914- // Verify identity call was made
1915- const identityCalls = fetchMock . calls ( ) . filter ( call =>
1916- call [ 0 ] . includes ( '/identify' )
1917- ) ;
1918- expect ( identityCalls . length ) . to . equal ( 1 ) ;
1919-
1920- const identityData = JSON . parse ( identityCalls [ 0 ] [ 1 ] . body as string ) ;
1921- expect ( identityData ) . to . have . property ( 'known_identities' ) ;
1922-
1923- // Should have a device_application_stamp generated by SDK
1924- expect ( identityData . known_identities ) . to . have . property ( 'device_application_stamp' ) ;
1925- expect ( identityData . known_identities . device_application_stamp ) . to . be . a ( 'string' ) ;
1926-
1927- // Reset for event test
1928- fetchMock . resetHistory ( ) ;
1929-
1930- // Test 2: Event sending should work without persistence data
1931- mParticle . logEvent ( 'No Persistence Test Event' ) ;
1932-
1933- // Verify event was sent
1934- const eventCalls = fetchMock . calls ( ) . filter ( call =>
1935- call [ 0 ] . includes ( '/events' )
1936- ) ;
1937-
1938- expect ( eventCalls . length ) . to . be . greaterThan ( 0 ) ;
1939-
1940- const eventCall = eventCalls . find ( call =>
1941- ( call [ 1 ] . body as string ) . includes ( 'No Persistence Test Event' )
1942- ) ;
1943- expect ( eventCall ) . to . be . ok ;
1944-
1945- const eventBatch = JSON . parse ( eventCall [ 1 ] . body as string ) ;
1946- expect ( eventBatch ) . to . have . property ( 'events' ) ;
1947- expect ( eventBatch . events . length ) . to . be . greaterThan ( 0 ) ;
1948-
1949- const testEvent = eventBatch . events . find ( event =>
1950- event . data && event . data . event_name === 'No Persistence Test Event'
1951- ) ;
1952- expect ( testEvent ) . to . be . ok ;
1953-
1954- expect ( findCookie ( ) ) . to . not . be . ok ;
1955- expect ( getLocalStorage ( ) ) . to . not . be . ok ;
1956-
1957- const store = mParticle . getInstance ( ) . _Store ;
1958- expect ( identityData . known_identities . device_application_stamp ) . to . equal ( store . deviceId ) ;
1959- } ) ;
19601885 } ) ;
19611886
19621887 describe ( 'set to false' , ( ) => {
0 commit comments