mirror of
https://github.com/minio/minio.git
synced 2025-11-25 20:16:10 -05:00
Add missing unit tests to JavaScript and React components (#5505)
Add the missing unit tests login, bucket listing, and bucket searching functionalities.
This commit is contained in:
committed by
Harshavardhana
parent
feb726dd98
commit
ead6337eab
@@ -54,4 +54,16 @@ describe("Alert actions", () => {
|
||||
const actions = store.getActions()
|
||||
expect(actions).toEqual(expectedActions)
|
||||
})
|
||||
|
||||
it("creates alert/CLEAR action directly", () => {
|
||||
const store = mockStore()
|
||||
const expectedActions = [
|
||||
{
|
||||
type: "alert/CLEAR"
|
||||
}
|
||||
]
|
||||
store.dispatch(actionsAlert.clear())
|
||||
const actions = store.getActions()
|
||||
expect(actions).toEqual(expectedActions)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -40,6 +40,26 @@ describe("Buckets actions", () => {
|
||||
})
|
||||
})
|
||||
|
||||
it("creates buckets/SET_LIST directly", () => {
|
||||
const store = mockStore()
|
||||
const expectedActions = [
|
||||
{ type: "buckets/SET_LIST", buckets: ["test1", "test2"] }
|
||||
]
|
||||
store.dispatch(actionsBuckets.setList(["test1", "test2"]))
|
||||
const actions = store.getActions()
|
||||
expect(actions).toEqual(expectedActions)
|
||||
})
|
||||
|
||||
it("creates buckets/SET_FILTER directly", () => {
|
||||
const store = mockStore()
|
||||
const expectedActions = [
|
||||
{ type: "buckets/SET_FILTER", filter: "test" }
|
||||
]
|
||||
store.dispatch(actionsBuckets.setFilter("test"))
|
||||
const actions = store.getActions()
|
||||
expect(actions).toEqual(expectedActions)
|
||||
})
|
||||
|
||||
it("should update browser url and creates buckets/SET_CURRENT_BUCKET action when selectBucket is called", () => {
|
||||
const store = mockStore()
|
||||
const expectedActions = [
|
||||
|
||||
Reference in New Issue
Block a user