mirror of
https://github.com/minio/minio.git
synced 2025-11-23 11:07:50 -05:00
Fix failing unit tests in browser (#5688)
* format js files using prettier Used the following command to format the files prettier --write "browser/app/js/**/*.js" * fix failing unit tests in browser
This commit is contained in:
committed by
Harshavardhana
parent
cb3818be27
commit
c0e45f9098
@@ -26,24 +26,24 @@ describe("MakeBucketModal", () => {
|
||||
it("should call hideMakeBucketModal when close button is clicked", () => {
|
||||
const hideMakeBucketModal = jest.fn()
|
||||
const wrapper = shallow(
|
||||
<MakeBucketModal hideMakeBucketModal={hideMakeBucketModal} />,
|
||||
<MakeBucketModal hideMakeBucketModal={hideMakeBucketModal} />
|
||||
)
|
||||
wrapper.find("button").simulate("click")
|
||||
wrapper.find("i.close").simulate("click")
|
||||
expect(hideMakeBucketModal).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it("bucketName should be cleared before hiding the modal", () => {
|
||||
const hideMakeBucketModal = jest.fn()
|
||||
const wrapper = shallow(
|
||||
<MakeBucketModal hideMakeBucketModal={hideMakeBucketModal} />,
|
||||
<MakeBucketModal hideMakeBucketModal={hideMakeBucketModal} />
|
||||
)
|
||||
wrapper.find("input").simulate("change", {
|
||||
target: {
|
||||
value: "test",
|
||||
},
|
||||
value: "test"
|
||||
}
|
||||
})
|
||||
expect(wrapper.state("bucketName")).toBe("test")
|
||||
wrapper.find("button").simulate("click")
|
||||
wrapper.find("i.close").simulate("click")
|
||||
expect(wrapper.state("bucketName")).toBe("")
|
||||
})
|
||||
|
||||
@@ -54,15 +54,15 @@ describe("MakeBucketModal", () => {
|
||||
<MakeBucketModal
|
||||
makeBucket={makeBucket}
|
||||
hideMakeBucketModal={hideMakeBucketModal}
|
||||
/>,
|
||||
/>
|
||||
)
|
||||
wrapper.find("input").simulate("change", {
|
||||
target: {
|
||||
value: "test",
|
||||
},
|
||||
value: "test"
|
||||
}
|
||||
})
|
||||
wrapper.find("form").simulate("submit", {
|
||||
preventDefault: jest.fn(),
|
||||
preventDefault: jest.fn()
|
||||
})
|
||||
expect(makeBucket).toHaveBeenCalledWith("test")
|
||||
})
|
||||
@@ -74,15 +74,15 @@ describe("MakeBucketModal", () => {
|
||||
<MakeBucketModal
|
||||
makeBucket={makeBucket}
|
||||
hideMakeBucketModal={hideMakeBucketModal}
|
||||
/>,
|
||||
/>
|
||||
)
|
||||
wrapper.find("input").simulate("change", {
|
||||
target: {
|
||||
value: "test",
|
||||
},
|
||||
value: "test"
|
||||
}
|
||||
})
|
||||
wrapper.find("form").simulate("submit", {
|
||||
preventDefault: jest.fn(),
|
||||
preventDefault: jest.fn()
|
||||
})
|
||||
expect(hideMakeBucketModal).toHaveBeenCalled()
|
||||
expect(wrapper.state("bucketName")).toBe("")
|
||||
|
||||
Reference in New Issue
Block a user