Skip to content

Commit

Permalink
fixes typies? beat davis! go
Browse files Browse the repository at this point in the history
  • Loading branch information
parkiino committed Feb 12, 2020
1 parent c2a6d5c commit 25e3d35
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('endpoint_list store concerns', () => {
const generateEndpoint = (): EndpointMetadata => {
return {
event: {
created: new Date(),
created: new Date(0),
},
endpoint: {
policy: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ describe('endpoint list saga', () => {
let store: Store<ManagementState>;
let getState: typeof store['getState'];
let dispatch: Dispatch<AppAction>;
let stopSagas: () => void;
// https://github.com/elastic/endpoint-app-team/issues/131
const generateEndpoint = (): EndpointMetadata => {
return {
event: {
created: new Date(),
created: new Date(0),
},
endpoint: {
policy: {
Expand Down Expand Up @@ -65,9 +64,6 @@ describe('endpoint list saga', () => {
getState = store.getState;
dispatch = store.dispatch;
});
afterEach(() => {
stopSagas();
});
test('it handles `userNavigatedToPage`', async () => {
const apiResponse = getEndpointListApiResponse();
fakeHttpServices.post.mockResolvedValue(apiResponse);
Expand All @@ -79,6 +75,6 @@ describe('endpoint list saga', () => {
paging_properties: [{ page_index: 0 }, { page_size: 10 }],
}),
});
expect(listData(store.getState())).toEqual(apiResponse.endpoints);
expect(listData(getState())).toEqual(apiResponse.endpoints);
});
});

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ export const appStoreFactory = (coreStart: CoreStart): Store => {
composeWithReduxDevTools(
applyMiddleware(
alertMiddlewareFactory(coreStart),
substateMiddlewareFactory(s => s.endpointList, managementMiddlewareFactory(coreStart))
substateMiddlewareFactory(
globalState => globalState.endpointList,
managementMiddlewareFactory(coreStart)
)
)
)
);
Expand Down
18 changes: 0 additions & 18 deletions x-pack/plugins/endpoint/public/applications/endpoint/store/saga.ts

This file was deleted.

4 changes: 2 additions & 2 deletions x-pack/plugins/endpoint/public/applications/endpoint/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import { EndpointMetadata } from '../../../common/types';
import { AppAction } from './store/action';
import { AlertResultList } from '../../../common/types';

export type MiddlewareFactory = (
export type MiddlewareFactory<S = GlobalState> = (
coreStart: CoreStart
) => (
api: MiddlewareAPI<Dispatch<AppAction>, GlobalState>
api: MiddlewareAPI<Dispatch<AppAction>, S>
) => (next: Dispatch<AppAction>) => (action: AppAction) => unknown;

export interface ManagementState {
Expand Down

0 comments on commit 25e3d35

Please sign in to comment.