Refactor make bucket and upload components (#5521)

This commit is contained in:
Kanagaraj M
2018-02-15 08:04:59 +05:30
committed by Harshavardhana
parent 9bfa07ecf5
commit 44f8f7059c
29 changed files with 1329 additions and 213 deletions
@@ -23,7 +23,8 @@ describe("buckets reducer", () => {
expect(initialState).toEqual({
list: [],
filter: "",
currentBucket: ""
currentBucket: "",
showMakeBucketModal: false
})
})
@@ -35,6 +36,17 @@ describe("buckets reducer", () => {
expect(newState.list).toEqual(["bk1", "bk2"])
})
it("should handle ADD", () => {
const newState = reducer(
{ list: ["test1", "test2"] },
{
type: actions.ADD,
bucket: "test3"
}
)
expect(newState.list).toEqual(["test3", "test1", "test2"])
})
it("should handle SET_FILTER", () => {
const newState = reducer(undefined, {
type: actions.SET_FILTER,
@@ -50,4 +62,12 @@ describe("buckets reducer", () => {
})
expect(newState.currentBucket).toEqual("test")
})
it("should handle SHOW_MAKE_BUCKET_MODAL", () => {
const newState = reducer(undefined, {
type: actions.SHOW_MAKE_BUCKET_MODAL,
show: true
})
expect(newState.showMakeBucketModal).toBeTruthy()
})
})