| 123456789101112131415161718192021222324252627 |
- import reducer from "../../../../store/reducers/ad/adReducer";
- import expect from "expect";
- import { setAd, setAdError } from "../../../../store/actions/ad/adActions";
- import { mockState } from "../../../../mockState";
-
- describe("ad reducer", () => {
- it("should return the initial state", () => {
- expect(reducer(undefined, {})).toEqual({
- ad: null,
- errorMessage: "",
- });
- });
-
- it("should set the state error", () => {
- expect(reducer(undefined, setAdError("Error"))).toEqual({
- ad: null,
- errorMessage: "Error",
- });
- });
-
- it("should set the state success", () => {
- expect(reducer(undefined, setAd(mockState.ads.ads[0]))).toEqual({
- ad: mockState.ads.ads[0],
- errorMessage: "",
- });
- });
- });
|