This repository has been archived on 2023-12-22. You can view files and clone it, but cannot push or open issues or pull requests.
old-monorepo/_Dashboard/test/reducers/user.spec.js

30 lines
766 B
JavaScript

import { expect } from 'chai';
import reducer from '../../app/renderer/reducers/user';
describe('reducers', () => {
describe('user', () => {
it('should handle USER_LOGIN', () => {
const action = {
type: 'USER_LOGIN',
payload: {
username: 'John Doe',
loggedIn: true,
},
};
const test = Object.assign({}, action.payload);
expect(reducer({}, action)).to.deep.equal(test);
});
it('should handle USER_LOGOUT', () => {
const action = {
type: 'USER_LOGOUT',
payload: {
username: '',
loggedIn: false,
},
};
const test = Object.assign({}, action.payload);
expect(reducer({}, action)).to.deep.equal(test);
});
});
});