Open arkD opened 4 years ago
ok after looking at your documentation again, I realized I was over complicating this so I did this instead:
it('should update theme through subscription in init', (done: DoneFn) => {
const themeStub: Subject<IAppTheme> = MockNgRedux.getSelectorStub<IAppTheme, IAppTheme>('theme');
themeStub.next(THEME_INIT_STATE);
themeStub.complete();
component.theme$.subscribe((actual: IAppTheme) => {
expect(component.theme).toBe('default');
done();
});
});
but I still don't understand why I can't just get this from my native store using like my app does every time it runs? do I need to run configureStore or include my StoreModule? I tried including my store module before but it had problems with my encryption/decryption transforms
This is a...
What toolchain are you using for transpilation/bundling?
ngc
Environment
NodeJS Version: 10.16.0 Typescript Version: 3.2.4 Angular Version: 7 @angular-redux/store version: 9 @angular/cli version: (if applicable) 7.3 OS: windows
Link to repo showing the issus
(optional, but helps a lot) private sorry
The Problem:
I don't understand and hours of investigation and research so far have not helped I have an encoded cache store with default values. I want to test my component theme is updated correctly from the store and get more complex from there.
here is a snippet:
I would like to use my store's defaults, not create a mock if possible to test this
The Test:
not sure if it is obvious but I have no idea how to get the observable to complete so I get something other than undefined.
The Question
It is clear to me that I don't understand the testing environment, as it appears the store behaves differently? how can I test this?