|
|
@ -16,7 +16,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
import configureStore from "redux-mock-store" |
|
|
|
import configureStore from "redux-mock-store" |
|
|
|
import thunk from "redux-thunk" |
|
|
|
import thunk from "redux-thunk" |
|
|
|
import * as actionsBuckets from "../buckets" |
|
|
|
import * as actionsBuckets from "../actions" |
|
|
|
|
|
|
|
|
|
|
|
jest.mock("../../web", () => ({ |
|
|
|
jest.mock("../../web", () => ({ |
|
|
|
ListBuckets: jest.fn(() => { |
|
|
|
ListBuckets: jest.fn(() => { |
|
|
@ -52,9 +52,7 @@ describe("Buckets actions", () => { |
|
|
|
|
|
|
|
|
|
|
|
it("creates buckets/SET_FILTER directly", () => { |
|
|
|
it("creates buckets/SET_FILTER directly", () => { |
|
|
|
const store = mockStore() |
|
|
|
const store = mockStore() |
|
|
|
const expectedActions = [ |
|
|
|
const expectedActions = [{ type: "buckets/SET_FILTER", filter: "test" }] |
|
|
|
{ type: "buckets/SET_FILTER", filter: "test" } |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
store.dispatch(actionsBuckets.setFilter("test")) |
|
|
|
store.dispatch(actionsBuckets.setFilter("test")) |
|
|
|
const actions = store.getActions() |
|
|
|
const actions = store.getActions() |
|
|
|
expect(actions).toEqual(expectedActions) |
|
|
|
expect(actions).toEqual(expectedActions) |