mirror of
https://github.com/minio/minio.git
synced 2025-11-24 03:27:44 -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
@@ -23,13 +23,13 @@ import web from "../../web"
|
||||
jest.mock("../../web", () => ({
|
||||
SetBucketPolicy: jest.fn(() => {
|
||||
return Promise.resolve()
|
||||
}),
|
||||
})
|
||||
}))
|
||||
|
||||
describe("Policy", () => {
|
||||
it("should render without crashing", () => {
|
||||
shallow(
|
||||
<Policy currentBucket={"bucket"} prefix={"foo"} policy={READ_ONLY} />,
|
||||
<Policy currentBucket={"bucket"} prefix={"foo"} policy={READ_ONLY} />
|
||||
)
|
||||
})
|
||||
|
||||
@@ -41,16 +41,16 @@ describe("Policy", () => {
|
||||
prefix={"foo"}
|
||||
policy={READ_ONLY}
|
||||
fetchPolicies={fetchPolicies}
|
||||
/>,
|
||||
/>
|
||||
)
|
||||
wrapper.find("button").simulate("click", {
|
||||
preventDefault: jest.fn(),
|
||||
preventDefault: jest.fn()
|
||||
})
|
||||
|
||||
expect(web.SetBucketPolicy).toHaveBeenCalledWith({
|
||||
bucketName: "bucket",
|
||||
prefix: "foo",
|
||||
policy: "none",
|
||||
policy: "none"
|
||||
})
|
||||
|
||||
setImmediate(() => {
|
||||
@@ -60,13 +60,13 @@ describe("Policy", () => {
|
||||
|
||||
it("should change the empty string to '*' while displaying prefixes", () => {
|
||||
const wrapper = shallow(
|
||||
<Policy currentBucket={"bucket"} prefix={""} policy={READ_ONLY} />,
|
||||
<Policy currentBucket={"bucket"} prefix={""} policy={READ_ONLY} />
|
||||
)
|
||||
expect(
|
||||
wrapper
|
||||
.find(".pmbl-item")
|
||||
.find("input")
|
||||
.at(0)
|
||||
.text(),
|
||||
.prop("value")
|
||||
).toEqual("*")
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user