Browse Source

test: remove config.plugin.spec

pull/6343/head
mehmet-erim 6 years ago
parent
commit
0af7f08436
  1. 35
      npm/ng-packs/packages/core/src/lib/tests/config.plugin.spec.ts

35
npm/ng-packs/packages/core/src/lib/tests/config.plugin.spec.ts

@ -1,35 +0,0 @@
import { InitState } from '@ngxs/store';
import { ABP } from '../models';
import { ConfigPlugin } from '../plugins';
const options: ABP.Root = {
environment: {
production: false,
},
registerLocaleFn: () => Promise.resolve(),
};
const event = new InitState();
const state = {
ConfigState: {
foo: 'bar',
...options,
},
};
describe('ConfigPlugin', () => {
it('should ConfigState must be create with correct datas', () => {
const next = jest.fn();
const plugin = new ConfigPlugin(options);
plugin.handle({ ConfigState: { foo: 'bar' } }, event, next);
expect(next).toHaveBeenCalledWith(state, event);
expect(next).toHaveBeenCalledTimes(1);
next.mockClear();
delete state.ConfigState.environment;
plugin.handle(state, event, next);
expect(next).toHaveBeenCalledWith(state, event);
expect(next).toHaveBeenCalledTimes(1);
});
});
Loading…
Cancel
Save