- it("initializes columns in the store", () => {
- const config = {
- id: "Id",
- columns: [{
- name: "Column",
- selected: true,
- configurable: false,
- render: jest.fn()
- }],
- requestItems: jest.fn(),
- setApi: jest.fn()
- };
- const service = new ServiceMock(config);
- const api = {
- getState: jest.fn(),
- dispatch: jest.fn()
- };
- const next = jest.fn();
- dataExplorerMiddleware(service)(api)(next);
- expect(next)
- .toHaveBeenCalledWith(dataExplorerActions.SET_COLUMNS({ id: service.getId(), columns: service.getColumns() }));
- });
-