mirror of
https://github.com/minio/minio.git
synced 2025-11-21 10:16:03 -05:00
revert browser newux changes (#5714)
This commit is contained in:
@@ -28,31 +28,27 @@ jest.mock("../../web", () => ({
|
||||
|
||||
describe("Policy", () => {
|
||||
it("should render without crashing", () => {
|
||||
shallow(
|
||||
<Policy currentBucket={"bucket"} prefix={"foo"} policy={READ_ONLY} />
|
||||
)
|
||||
shallow(<Policy currentBucket={"bucket"} prefix={"foo"} policy={READ_ONLY} />)
|
||||
})
|
||||
|
||||
it("should call web.setBucketPolicy and fetchPolicies on submit", () => {
|
||||
const fetchPolicies = jest.fn()
|
||||
const wrapper = shallow(
|
||||
<Policy
|
||||
<Policy
|
||||
currentBucket={"bucket"}
|
||||
prefix={"foo"}
|
||||
policy={READ_ONLY}
|
||||
fetchPolicies={fetchPolicies}
|
||||
/>
|
||||
)
|
||||
wrapper.find("button").simulate("click", {
|
||||
preventDefault: jest.fn()
|
||||
})
|
||||
wrapper.find("button").simulate("click", { preventDefault: jest.fn() })
|
||||
|
||||
expect(web.SetBucketPolicy).toHaveBeenCalledWith({
|
||||
bucketName: "bucket",
|
||||
prefix: "foo",
|
||||
policy: "none"
|
||||
})
|
||||
|
||||
|
||||
setImmediate(() => {
|
||||
expect(fetchPolicies).toHaveBeenCalledWith("bucket")
|
||||
})
|
||||
@@ -62,11 +58,6 @@ describe("Policy", () => {
|
||||
const wrapper = shallow(
|
||||
<Policy currentBucket={"bucket"} prefix={""} policy={READ_ONLY} />
|
||||
)
|
||||
expect(
|
||||
wrapper
|
||||
.find("input")
|
||||
.at(0)
|
||||
.prop("value")
|
||||
).toEqual("*")
|
||||
expect(wrapper.find(".pmbl-item").at(0).text()).toEqual("*")
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user