import { createSessionStorageStateStorage , ISessionStorageStateStorage , } from './create_session_storage_state_storage' ; import { StubBrowserStorage } from 'test_utils/stub_browser_storage' ; describe ( 'SessionStorageStateStorage' , ( ) => { let browserStorage ; let stateStorage ; beforeEach ( ( ) => { browserStorage = new StubBrowserStorage ( ) ; stateStorage = createSessionStorageStateStorage ( browserStorage ) ; } ) ; it ( 'should synchronously sync to storage' , ( ) => { const state = { state : 'state' } ; stateStorage . set ( 'key' , state ) ; expect ( stateStorage . get ( 'key' ) ) . toEqual ( state ) ; expect ( browserStorage . getItem ( 'key' ) ) . not . toBeNull ( ) ; } ) ; it ( 'should not implement change$' , ( ) => { expect ( stateStorage . change$ ) . not . toBeDefined ( ) ; } ) ; } ) ;