Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should work', async () => {
actions = hot('-a-|', { a: { type: 'LOAD_DATA' } });
expect(true).toBeTruthy();
});
});
it('should work', async () => {
actions = hot('-a-|', { a: { type: 'LOAD_DATA' } });
expect(true).toBeTruthy();
});
});
it('should work', async () => {
actions = hot('-a-|', { a: { type: 'LOAD_DATA' } });
expect(true).toBeTruthy();
});
});
it('should work', async () => {
actions = hot('-a-|', { a: { type: 'LOAD_DATA' } });
expect(true).toBeTruthy();
});
});
it('should work', async () => {
actions = hot('-a-|', { a: { type: 'LOAD_DATA' } });
expect(true).toBeTruthy();
});
});
it('should work', async () => {
actions = hot('-a-|', { a: { type: 'LOAD_DATA' } });
expect(true).toBeTruthy();
});
});
it('should work', async () => {
actions = hot('-a-|', { a: { type: 'LOAD_DATA' } });
expect(true).toBeTruthy();
});
});
it('should return a LoginSuccess action, with user information when login succeeds', () => {
const result: User = {
email: 'test@gmail.com',
token: 'token',
username: 'test',
bio: '',
image: '',
};
const loginAction = AuthActions.login();
const loginSuccessAction = AuthActions.loginSuccess({ user: result });
actions$ = hot('-a---', { a: loginAction });
const response = cold('-a|', { a: result });
const expected = cold('--b', { b: loginSuccessAction });
service.login = jest.fn(() => response);
(expect(effects.login$) as any).toBeObservable(expected);
});
it('should work', async () => {
actions = hot('-a-|', { a: { type: 'LOAD_DATA' } });
expect(true).toBeTruthy();
});
});
it('should return a GetUserFail action when user call throws', () => {
const error = new Error('error');
const getUserAction = AuthActions.getUser();
const getUserFail = AuthActions.getUserFail({ error });
actions$ = hot('-a---', { a: getUserAction });
const response = cold('-#', {}, error);
service.user = jest.fn(() => response);
const expected = cold('--b', { b: getUserFail });
expect(effects.getUser$).toBeObservable(expected);
});
});