Skip to content

Commit

Permalink
#955 test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm committed Jul 30, 2018
1 parent 9e9c4f5 commit c2b1ed6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
37 changes: 23 additions & 14 deletions modules/store-devtools/spec/extension.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { LiftedActions, ComputedState, LiftedAction } from './../src/reducer';
import { PerformAction, PERFORM_ACTION } from './../src/actions';
import { ActionSanitizer, StateSanitizer } from './../src/config';
import {
ReduxDevtoolsExtensionConnection,
ReduxDevtoolsExtensionConfig,
} from './../src/extension';
import { Action } from '@ngrx/store';

import { LiftedState } from '../';
import { DevtoolsExtension, ReduxDevtoolsExtension } from '../src/extension';
import { createConfig, noMonitor } from '../src/config';
import { createConfig } from '../src/config';
import { unliftState } from '../src/utils';

function createOptions(
Expand Down Expand Up @@ -97,7 +95,8 @@ describe('DevtoolsExtension', () => {
it('should connect with default options', () => {
devtoolsExtension = new DevtoolsExtension(
reduxDevtoolsExtension,
createConfig({})
createConfig({}),
null
);
// Subscription needed or else extension connection will not be established.
devtoolsExtension.actions$.subscribe(() => null);
Expand All @@ -116,7 +115,8 @@ describe('DevtoolsExtension', () => {
// these two should not be added
actionSanitizer: myActionSanitizer,
stateSanitizer: myStateSanitizer,
})
}),
null
);
// Subscription needed or else extension connection will not be established.
devtoolsExtension.actions$.subscribe(() => null);
Expand All @@ -139,7 +139,8 @@ describe('DevtoolsExtension', () => {
createConfig({
name: 'ngrx-store-devtool-todolist',
serialize: customSerializer,
})
}),
null
);
// Subscription needed or else extension connection will not be established.
devtoolsExtension.actions$.subscribe(() => null);
Expand All @@ -152,7 +153,8 @@ describe('DevtoolsExtension', () => {
it('should send notification with default options', () => {
devtoolsExtension = new DevtoolsExtension(
reduxDevtoolsExtension,
createConfig({})
createConfig({}),
null
);
const defaultOptions = createOptions();
const action = {} as LiftedAction;
Expand All @@ -176,7 +178,8 @@ describe('DevtoolsExtension', () => {
// these two should not be added
actionSanitizer: myActionSanitizer,
stateSanitizer: myStateSanitizer,
})
}),
null
);
const options = createOptions(
'ngrx-store-devtool-todolist',
Expand Down Expand Up @@ -215,7 +218,8 @@ describe('DevtoolsExtension', () => {
beforeEach(() => {
devtoolsExtension = new DevtoolsExtension(
reduxDevtoolsExtension,
createConfig({})
createConfig({}),
null
);
// Subscription needed or else extension connection will not be established.
devtoolsExtension.actions$.subscribe(() => null);
Expand Down Expand Up @@ -252,7 +256,8 @@ describe('DevtoolsExtension', () => {
reduxDevtoolsExtension,
createConfig({
actionSanitizer: testActionSanitizer,
})
}),
null
);
// Subscription needed or else extension connection will not be established.
devtoolsExtension.actions$.subscribe(() => null);
Expand Down Expand Up @@ -297,7 +302,8 @@ describe('DevtoolsExtension', () => {
reduxDevtoolsExtension,
createConfig({
stateSanitizer: testStateSanitizer,
})
}),
null
);
// Subscription needed or else extension connection will not be established.
devtoolsExtension.actions$.subscribe(() => null);
Expand Down Expand Up @@ -341,7 +347,8 @@ describe('DevtoolsExtension', () => {
createConfig({
actionSanitizer: testActionSanitizer,
stateSanitizer: testStateSanitizer,
})
}),
null
);
// Subscription needed or else extension connection will not be established.
devtoolsExtension.actions$.subscribe(() => null);
Expand Down Expand Up @@ -372,7 +379,8 @@ describe('DevtoolsExtension', () => {
beforeEach(() => {
devtoolsExtension = new DevtoolsExtension(
reduxDevtoolsExtension,
createConfig({})
createConfig({}),
null
);
// Subscription needed or else extension connection will not be established.
devtoolsExtension.actions$.subscribe(() => null);
Expand Down Expand Up @@ -406,7 +414,8 @@ describe('DevtoolsExtension', () => {
beforeEach(() => {
devtoolsExtension = new DevtoolsExtension(
reduxDevtoolsExtension,
createConfig({})
createConfig({}),
null
);
// Subscription needed or else extension connection will not be established.
devtoolsExtension.actions$.subscribe(() => null);
Expand Down
2 changes: 1 addition & 1 deletion modules/store-devtools/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class DevtoolsExtension {
constructor(
@Inject(REDUX_DEVTOOLS_EXTENSION) devtoolsExtension: ReduxDevtoolsExtension,
@Inject(STORE_DEVTOOLS_CONFIG) private config: StoreDevtoolsConfig,
@Optional() private router: Router
@Optional() private router: Router | null
) {
this.devtoolsExtension = devtoolsExtension;
this.createActionStreams();
Expand Down

0 comments on commit c2b1ed6

Please sign in to comment.