mirror of
https://github.com/minio/minio.git
synced 2025-11-21 02:09:08 -05:00
revert browser newux changes (#5714)
This commit is contained in:
@@ -40,25 +40,11 @@ describe("objects reducer", () => {
|
||||
it("should handle SET_LIST", () => {
|
||||
const newState = reducer(undefined, {
|
||||
type: actions.SET_LIST,
|
||||
objects: [
|
||||
{
|
||||
name: "obj1"
|
||||
},
|
||||
{
|
||||
name: "obj2"
|
||||
}
|
||||
],
|
||||
objects: [{ name: "obj1" }, { name: "obj2" }],
|
||||
marker: "obj2",
|
||||
isTruncated: false
|
||||
})
|
||||
expect(newState.list).toEqual([
|
||||
{
|
||||
name: "obj1"
|
||||
},
|
||||
{
|
||||
name: "obj2"
|
||||
}
|
||||
])
|
||||
expect(newState.list).toEqual([{ name: "obj1" }, { name: "obj2" }])
|
||||
expect(newState.marker).toBe("obj2")
|
||||
expect(newState.isTruncated).toBeFalsy()
|
||||
})
|
||||
@@ -66,44 +52,22 @@ describe("objects reducer", () => {
|
||||
it("should handle APPEND_LIST", () => {
|
||||
const newState = reducer(
|
||||
{
|
||||
list: [
|
||||
{
|
||||
name: "obj1"
|
||||
},
|
||||
{
|
||||
name: "obj2"
|
||||
}
|
||||
],
|
||||
list: [{ name: "obj1" }, { name: "obj2" }],
|
||||
marker: "obj2",
|
||||
isTruncated: true
|
||||
},
|
||||
{
|
||||
type: actions.APPEND_LIST,
|
||||
objects: [
|
||||
{
|
||||
name: "obj3"
|
||||
},
|
||||
{
|
||||
name: "obj4"
|
||||
}
|
||||
],
|
||||
objects: [{ name: "obj3" }, { name: "obj4" }],
|
||||
marker: "obj4",
|
||||
isTruncated: false
|
||||
}
|
||||
)
|
||||
expect(newState.list).toEqual([
|
||||
{
|
||||
name: "obj1"
|
||||
},
|
||||
{
|
||||
name: "obj2"
|
||||
},
|
||||
{
|
||||
name: "obj3"
|
||||
},
|
||||
{
|
||||
name: "obj4"
|
||||
}
|
||||
{ name: "obj1" },
|
||||
{ name: "obj2" },
|
||||
{ name: "obj3" },
|
||||
{ name: "obj4" }
|
||||
])
|
||||
expect(newState.marker).toBe("obj4")
|
||||
expect(newState.isTruncated).toBeFalsy()
|
||||
@@ -111,53 +75,24 @@ describe("objects reducer", () => {
|
||||
|
||||
it("should handle REMOVE", () => {
|
||||
const newState = reducer(
|
||||
{
|
||||
list: [
|
||||
{
|
||||
name: "obj1"
|
||||
},
|
||||
{
|
||||
name: "obj2"
|
||||
}
|
||||
]
|
||||
},
|
||||
{ list: [{ name: "obj1" }, { name: "obj2" }] },
|
||||
{
|
||||
type: actions.REMOVE,
|
||||
object: "obj1"
|
||||
}
|
||||
)
|
||||
expect(newState.list).toEqual([
|
||||
{
|
||||
name: "obj2"
|
||||
}
|
||||
])
|
||||
expect(newState.list).toEqual([{ name: "obj2" }])
|
||||
})
|
||||
|
||||
it("should handle REMOVE with non-existent object", () => {
|
||||
const newState = reducer(
|
||||
{
|
||||
list: [
|
||||
{
|
||||
name: "obj1"
|
||||
},
|
||||
{
|
||||
name: "obj2"
|
||||
}
|
||||
]
|
||||
},
|
||||
{ list: [{ name: "obj1" }, { name: "obj2" }] },
|
||||
{
|
||||
type: actions.REMOVE,
|
||||
object: "obj3"
|
||||
}
|
||||
)
|
||||
expect(newState.list).toEqual([
|
||||
{
|
||||
name: "obj1"
|
||||
},
|
||||
{
|
||||
name: "obj2"
|
||||
}
|
||||
])
|
||||
expect(newState.list).toEqual([{ name: "obj1" }, { name: "obj2" }])
|
||||
})
|
||||
|
||||
it("should handle SET_SORT_BY", () => {
|
||||
@@ -178,11 +113,7 @@ describe("objects reducer", () => {
|
||||
|
||||
it("should handle SET_CURRENT_PREFIX", () => {
|
||||
const newState = reducer(
|
||||
{
|
||||
currentPrefix: "test1/",
|
||||
marker: "abc",
|
||||
isTruncated: true
|
||||
},
|
||||
{ currentPrefix: "test1/", marker: "abc", isTruncated: true },
|
||||
{
|
||||
type: actions.SET_CURRENT_PREFIX,
|
||||
prefix: "test2/"
|
||||
@@ -225,9 +156,7 @@ describe("objects reducer", () => {
|
||||
|
||||
it("should handle SELECTED_LIST_REMOVE", () => {
|
||||
const newState = reducer(
|
||||
{
|
||||
checkedList: ["obj1", "obj2"]
|
||||
},
|
||||
{ checkedList: ["obj1", "obj2"] },
|
||||
{
|
||||
type: actions.CHECKED_LIST_REMOVE,
|
||||
object: "obj1"
|
||||
@@ -238,9 +167,7 @@ describe("objects reducer", () => {
|
||||
|
||||
it("should handle CHECKED_LIST_RESET", () => {
|
||||
const newState = reducer(
|
||||
{
|
||||
checkedList: ["obj1", "obj2"]
|
||||
},
|
||||
{ checkedList: ["obj1", "obj2"] },
|
||||
{
|
||||
type: actions.CHECKED_LIST_RESET
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user