Skip to content

Instantly share code, notes, and snippets.

@sminutoli
Created November 10, 2016 19:57
Show Gist options
  • Save sminutoli/04bdaea634a415a7be6ca079f7c423ba to your computer and use it in GitHub Desktop.
Save sminutoli/04bdaea634a415a7be6ca079f7c423ba to your computer and use it in GitHub Desktop.
TDD Action Creator paso 3
import { describe, it } from 'mocha';
import expect from 'expect';
import { actionTypes, transactionSuccess } from './actionCreator';
describe('ItemTransactionActions.actionTypes', () => {
it('should expose TRANSACTION_SUCCESS', () => {
const actual = actionTypes.TRANSACTION_SUCCESS;
expect(actual).toExist();
});
});
describe('ItemTransactionActions.transactionSuccess', () => {
it('should return the right type', () => {
const action = transactionSuccess();
const actual = action.type;
const expected = actionTypes.TRANSACTION_SUCCESS;
expect(actual).toBe(expected);
});
it('should return the right result', () => {
const data = {};
const action = transactionSuccess(data);
const actual = action.result;
const expected = data;
expect(actual).toBe(expected);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment