Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

candidateOptionsReducer.test.js 927B

1234567891011121314151617181920212223242526272829303132333435
  1. import reducer from "../../../store/reducers/candidates/candidateOptionsReducer";
  2. import expect from "expect";
  3. import {
  4. fetchCandidateOptionsSuccess,
  5. fetchCandidateOptionsError,
  6. } from "../../../store/actions/candidates/candidatesActions";
  7. import { mockState } from "../../../mockState";
  8. describe("candidatesOptions reducer", () => {
  9. it("should return the initial state", () => {
  10. expect(reducer(undefined, {})).toEqual({
  11. options: [],
  12. errorMessage: "",
  13. });
  14. });
  15. it("should set the state error", () => {
  16. expect(reducer(undefined, fetchCandidateOptionsError("Error"))).toEqual({
  17. options: [],
  18. errorMessage: "Error",
  19. });
  20. });
  21. it("should set options", () => {
  22. expect(
  23. reducer(
  24. undefined,
  25. fetchCandidateOptionsSuccess(mockState.options.options)
  26. )
  27. ).toEqual({
  28. options: mockState.options.options,
  29. errorMessage: "",
  30. });
  31. });
  32. });