Skip to content

Commit

Permalink
fix karma tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dosant committed Nov 29, 2019
1 parent 6ee4eae commit 4985a61
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
10 changes: 3 additions & 7 deletions src/legacy/ui/public/state_management/__tests__/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ import '../../private';
import { toastNotifications } from '../../notify';
import * as FatalErrorNS from '../../notify/fatal_error';
import { StateProvider } from '../state';
import {
unhashQueryString,
} from '../state_hashing';
import {
createStateHash,
isStateHash,
} from '../state_storage';
unhashQuery
} from '../state_hashing';
import { HashedItemStore } from '../state_storage/hashed_item_store';
import { StubBrowserStorage } from 'test_utils/stub_browser_storage';
import { EventsProvider } from '../../events';
Expand Down Expand Up @@ -60,9 +58,7 @@ describe('State Management', () => {
const hashedItemStore = new HashedItemStore(store);
const state = new State(param, initial, hashedItemStore);

const getUnhashedSearch = state => {
return unhashQueryString($location.search(), [ state ]);
};
const getUnhashedSearch = () => unhashQuery($location.search());

return { store, hashedItemStore, state, getUnhashedSearch };
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const hashUrl = createQueryReplacer(hashQuery);
// naive hack, but this allows to decouple these utils from AppState, GlobalState for now
// when removing AppState, GlobalState and migrating to IState containers,
// need to make sure that apps explicitly passing this whitelist to hash
const __HACK_HARDCODED_LEGACY_HASHABLE_PARAMS = ['_g', '_a'];
const __HACK_HARDCODED_LEGACY_HASHABLE_PARAMS = ['_g', '_a', '_s'];
function createQueryMapper(queryParamMapper: (q: string) => string | null) {
return (
query: IQuery,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
* under the License.
*/

export { hashUrl, unhashUrl } from './hash_unhash_url';
export { hashUrl, unhashUrl, hashQuery, unhashQuery } from './hash_unhash_url';
export { createStateHash, isStateHash } from './state_hash';

0 comments on commit 4985a61

Please sign in to comment.