Farmbot-Web-App/webpack/auth/__tests__/reducer_test.ts
Gabriel Burnworth beddbf9c0b Cleanup and tests (#953)
* tslint cleanup

* app crash page improvements

* fix long lines

* remove unused auth code

* add more tests

* add tslint to scripts and fix deprecations
2018-08-08 09:44:12 -05:00

20 lines
538 B
TypeScript

import { authReducer } from "../reducer";
import { setToken } from "../actions";
import { AuthState } from "../interfaces";
describe("Auth reducer", () => {
function fakeToken(): AuthState {
const output: Partial<AuthState> = {
// tslint:disable-next-line:no-any
token: ({} as any)
};
return output as AuthState;
}
it("replaces the token", () => {
const result = authReducer(undefined, setToken(fakeToken()));
expect(result).toBeTruthy();
expect(result && result.token).toBeTruthy();
});
});