Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Ashwin P Chandran <[email protected]>
  • Loading branch information
ashwin-pc committed Aug 7, 2023
1 parent 4b7498b commit f82e06f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/plugins/data_explorer/public/utils/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const createDataExplorerServicesMock = () => {
scopedHistory: (scopedHistoryMock.create() as unknown) as ScopedHistory,
viewRegistry: {
get: jest.fn(),
all: jest.fn(),
all: jest.fn(() => []),
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import { DataExplorerServices } from '../../types';
import { createDataExplorerServicesMock } from '../mocks';
import { loadReduxState, persistReduxState } from './redux_persistence';
import { RootState } from './store';

describe('test redux state persistence', () => {
let mockServices: jest.Mocked<DataExplorerServices>;
Expand All @@ -15,20 +14,21 @@ describe('test redux state persistence', () => {
beforeEach(() => {
mockServices = createDataExplorerServicesMock();
reduxStateParams = {
style: 'style',
visualization: 'visualization',
discover: 'visualization',
metadata: 'metadata',
ui: 'ui',
};
});

test('test load redux state when url is empty', async () => {
const defaultStates: RootState = {
metadata: {},
};

test('test load default redux state when url is empty', async () => {
const returnStates = await loadReduxState(mockServices);
expect(returnStates).toStrictEqual(defaultStates);
expect(returnStates).toMatchInlineSnapshot(`
Object {
"metadata": Object {
"indexPattern": "id",
"originatingApp": undefined,
},
}
`);
});

test('test load redux state', async () => {
Expand Down

0 comments on commit f82e06f

Please sign in to comment.