mirror of
https://github.com/pgsty/minio.git
synced 2026-08-02 08:35:58 +03:00
Refactor make bucket and upload components (#5521)
This commit is contained in:
committed by
Harshavardhana
parent
9bfa07ecf5
commit
44f8f7059c
@@ -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()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user