@@ -910,51 +910,6 @@ testCookieAndLocalStorage(() => {
910910 } ) ;
911911 } ) ;
912912
913- describe ( 'abort()' , ( ) => {
914- test ( 'should not clear cookie' , ( ) => {
915- const identity = makeIdentityV2 ( ) ;
916- setUid2 ( identity , useCookie ) ;
917- uid2 . abort ( ) ;
918- expect ( getUid2 ( useCookie ) . advertising_token ) . toBe ( identity . advertising_token ) ;
919- } ) ;
920- test ( 'should abort refresh timer' , ( ) => {
921- uid2 . init ( {
922- callback : callback ,
923- identity : makeIdentityV2 ( ) ,
924- useCookie : useCookie ,
925- } ) ;
926- expect ( setTimeout ) . toHaveBeenCalledTimes ( 1 ) ;
927- expect ( clearTimeout ) . not . toHaveBeenCalled ( ) ;
928- uid2 . abort ( ) ;
929- expect ( setTimeout ) . toHaveBeenCalledTimes ( 1 ) ;
930- expect ( clearTimeout ) . toHaveBeenCalledTimes ( 1 ) ;
931- } ) ;
932- test ( 'should not abort refresh timer if not timer is set' , ( ) => {
933- uid2 . init ( {
934- callback : callback ,
935- identity : makeIdentityV2 ( { refresh_from : Date . now ( ) - 100000 } ) ,
936- useCookie : useCookie ,
937- } ) ;
938- expect ( setTimeout ) . not . toHaveBeenCalled ( ) ;
939- expect ( clearTimeout ) . not . toHaveBeenCalled ( ) ;
940- uid2 . abort ( ) ;
941- expect ( setTimeout ) . not . toHaveBeenCalled ( ) ;
942- expect ( clearTimeout ) . not . toHaveBeenCalled ( ) ;
943- } ) ;
944- test ( 'should abort refresh token request' , ( ) => {
945- uid2 . init ( {
946- callback : callback ,
947- identity : makeIdentityV2 ( { refresh_from : Date . now ( ) - 100000 } ) ,
948- useCookie : useCookie ,
949- } ) ;
950- expect ( xhrMock . send ) . toHaveBeenCalledTimes ( 1 ) ;
951- expect ( xhrMock . abort ) . not . toHaveBeenCalled ( ) ;
952- uid2 . abort ( ) ;
953- expect ( xhrMock . send ) . toHaveBeenCalledTimes ( 1 ) ;
954- expect ( xhrMock . abort ) . toHaveBeenCalledTimes ( 1 ) ;
955- } ) ;
956- } ) ;
957-
958913 describe ( 'disconnect()' , ( ) => {
959914 test ( 'should clear cookie' , ( ) => {
960915 setUid2 ( makeIdentityV2 ( ) , useCookie ) ;
0 commit comments