mirror of
https://github.com/minio/minio.git
synced 2025-11-24 19:46:16 -05:00
revert browser newux changes (#5714)
This commit is contained in:
@@ -26,12 +26,8 @@ describe("Dropzone", () => {
|
||||
it("should call uploadFile with files", () => {
|
||||
const uploadFile = jest.fn()
|
||||
const wrapper = shallow(<Dropzone uploadFile={uploadFile} />)
|
||||
const file1 = new Blob(["file content1"], {
|
||||
type: "text/plain"
|
||||
})
|
||||
const file2 = new Blob(["file content2"], {
|
||||
type: "text/plain"
|
||||
})
|
||||
const file1 = new Blob(["file content1"], { type: "text/plain" })
|
||||
const file2 = new Blob(["file content2"], { type: "text/plain" })
|
||||
wrapper.first().prop("onDrop")([file1, file2])
|
||||
expect(uploadFile.mock.calls).toEqual([[file1], [file2]])
|
||||
})
|
||||
|
||||
@@ -85,9 +85,7 @@ describe("Uploads actions", () => {
|
||||
|
||||
it("creates alerts/SET action when currentBucket is not present", () => {
|
||||
const store = mockStore({
|
||||
buckets: {
|
||||
currentBucket: ""
|
||||
}
|
||||
buckets: { currentBucket: "" }
|
||||
})
|
||||
const expectedActions = [
|
||||
{
|
||||
@@ -99,9 +97,7 @@ describe("Uploads actions", () => {
|
||||
}
|
||||
}
|
||||
]
|
||||
const file = new Blob(["file content"], {
|
||||
type: "text/plain"
|
||||
})
|
||||
const file = new Blob(["file content"], { type: "text/plain" })
|
||||
store.dispatch(uploadsActions.uploadFile(file))
|
||||
const actions = store.getActions()
|
||||
expect(actions).toEqual(expectedActions)
|
||||
@@ -109,12 +105,8 @@ describe("Uploads actions", () => {
|
||||
|
||||
it("creates uploads/ADD action before uploading the file", () => {
|
||||
const store = mockStore({
|
||||
buckets: {
|
||||
currentBucket: "test1"
|
||||
},
|
||||
objects: {
|
||||
currentPrefix: "pre1/"
|
||||
}
|
||||
buckets: { currentBucket: "test1" },
|
||||
objects: { currentPrefix: "pre1/" }
|
||||
})
|
||||
const expectedActions = [
|
||||
{
|
||||
@@ -142,12 +134,8 @@ describe("Uploads actions", () => {
|
||||
})
|
||||
window.XMLHttpRequest = jest.fn().mockImplementation(xhrMockClass)
|
||||
const store = mockStore({
|
||||
buckets: {
|
||||
currentBucket: "test1"
|
||||
},
|
||||
objects: {
|
||||
currentPrefix: "pre1/"
|
||||
}
|
||||
buckets: { currentBucket: "test1" },
|
||||
objects: { currentPrefix: "pre1/" }
|
||||
})
|
||||
store.dispatch(uploadsActions.uploadFile(file))
|
||||
expect(open).toHaveBeenCalledWith(
|
||||
|
||||
@@ -34,24 +34,14 @@ describe("uploads reducer", () => {
|
||||
name: "test"
|
||||
})
|
||||
expect(newState.files).toEqual({
|
||||
"a-b-c": {
|
||||
loaded: 0,
|
||||
size: 100,
|
||||
name: "test"
|
||||
}
|
||||
"a-b-c": { loaded: 0, size: 100, name: "test" }
|
||||
})
|
||||
})
|
||||
|
||||
it("should handle UPDATE_PROGRESS", () => {
|
||||
const newState = reducer(
|
||||
{
|
||||
files: {
|
||||
"a-b-c": {
|
||||
loaded: 0,
|
||||
size: 100,
|
||||
name: "test"
|
||||
}
|
||||
}
|
||||
files: { "a-b-c": { loaded: 0, size: 100, name: "test" } }
|
||||
},
|
||||
{
|
||||
type: actions.UPDATE_PROGRESS,
|
||||
@@ -60,11 +50,7 @@ describe("uploads reducer", () => {
|
||||
}
|
||||
)
|
||||
expect(newState.files).toEqual({
|
||||
"a-b-c": {
|
||||
loaded: 50,
|
||||
size: 100,
|
||||
name: "test"
|
||||
}
|
||||
"a-b-c": { loaded: 50, size: 100, name: "test" }
|
||||
})
|
||||
})
|
||||
|
||||
@@ -72,16 +58,8 @@ describe("uploads reducer", () => {
|
||||
const newState = reducer(
|
||||
{
|
||||
files: {
|
||||
"a-b-c": {
|
||||
loaded: 70,
|
||||
size: 100,
|
||||
name: "test1"
|
||||
},
|
||||
"x-y-z": {
|
||||
loaded: 50,
|
||||
size: 100,
|
||||
name: "test2"
|
||||
}
|
||||
"a-b-c": { loaded: 70, size: 100, name: "test1" },
|
||||
"x-y-z": { loaded: 50, size: 100, name: "test2" }
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -90,11 +68,7 @@ describe("uploads reducer", () => {
|
||||
}
|
||||
)
|
||||
expect(newState.files).toEqual({
|
||||
"x-y-z": {
|
||||
loaded: 50,
|
||||
size: 100,
|
||||
name: "test2"
|
||||
}
|
||||
"x-y-z": { loaded: 50, size: 100, name: "test2" }
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user