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

View File

@@ -36,22 +36,4 @@ describe("ObjectsList", () => {
{ name: "test2.jpg" }
])
})
it("should call loadObjects when currentBucket is changed", () => {
const loadObjects = jest.fn()
const wrapper = shallow(
<ObjectsListContainer currentBucket="test1" loadObjects={loadObjects} />
)
wrapper.setProps({ currentBucket: "test2" })
expect(loadObjects).toHaveBeenCalled()
})
it("should call loadObjects when currentPrefix is changed", () => {
const loadObjects = jest.fn()
const wrapper = shallow(
<ObjectsListContainer currentPrefix="abc/" loadObjects={loadObjects} />
)
wrapper.setProps({ currentPrefix: "abc/xyz/" })
expect(loadObjects).toHaveBeenCalled()
})
})

View File

@@ -158,7 +158,8 @@ describe("Objects actions", () => {
it("should update browser url and creates objects/SET_CURRENT_PREFIX action when selectPrefix is called", () => {
const store = mockStore({
buckets: { currentBucket: "test" }
buckets: { currentBucket: "test" },
objects: { currentPrefix: "" }
})
const expectedActions = [
{ type: "objects/SET_CURRENT_PREFIX", prefix: "abc/" }