annoy.spec.js 856 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { expect } from 'chai';
  2. import {
  3. ANNOYED,
  4. ANNOY_RESPONDED
  5. } from 'constants/actions';
  6. import {
  7. annoyed,
  8. annoyResponded
  9. } from 'actions/annoy';
  10. describe('Annoy actions', () => {
  11. describe('annoyed', () => {
  12. it('should return ANNOYED', () => {
  13. expect(annoyed()).to.deep.equal({
  14. type: ANNOYED
  15. });
  16. });
  17. });
  18. describe('annoyResponded', () => {
  19. it('should return ANNOY_RESPONDED with optional error', () => {
  20. const err = new Error('something bad happened');
  21. expect(annoyResponded(err)).to.deep.equal({
  22. type: ANNOY_RESPONDED,
  23. err
  24. });
  25. expect(annoyResponded()).to.deep.equal({
  26. type: ANNOY_RESPONDED,
  27. err: null
  28. });
  29. });
  30. });
  31. });