mirror of
https://github.com/pgsty/minio.git
synced 2026-07-20 04:30:26 +03: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,16 +26,16 @@ describe("Bucket", () => {
|
||||
it("should call selectBucket when clicked", () => {
|
||||
const selectBucket = jest.fn()
|
||||
const wrapper = shallow(
|
||||
<Bucket bucket={"test"} selectBucket={selectBucket} />,
|
||||
<Bucket bucket={"test"} selectBucket={selectBucket} />
|
||||
)
|
||||
wrapper.find("li").simulate("click", {
|
||||
preventDefault: jest.fn(),
|
||||
wrapper.find("div").simulate("click", {
|
||||
preventDefault: jest.fn()
|
||||
})
|
||||
expect(selectBucket).toHaveBeenCalledWith("test")
|
||||
})
|
||||
|
||||
it("should highlight the selected bucket", () => {
|
||||
const wrapper = shallow(<Bucket bucket={"test"} isActive={true} />)
|
||||
expect(wrapper.find("li").hasClass("active")).toBeTruthy()
|
||||
expect(wrapper.find("div").hasClass("buckets__item--active")).toBeTruthy()
|
||||
})
|
||||
})
|
||||
|
||||
@@ -26,8 +26,8 @@ describe("BucketContainer", () => {
|
||||
beforeEach(() => {
|
||||
store = mockStore({
|
||||
buckets: {
|
||||
currentBucket: "Test",
|
||||
},
|
||||
currentBucket: "Test"
|
||||
}
|
||||
})
|
||||
store.dispatch = jest.fn()
|
||||
})
|
||||
@@ -41,8 +41,8 @@ describe("BucketContainer", () => {
|
||||
expect(wrapper.props()).toEqual(
|
||||
expect.objectContaining({
|
||||
isActive: expect.any(Boolean),
|
||||
selectBucket: expect.any(Function),
|
||||
}),
|
||||
selectBucket: expect.any(Function)
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
@@ -35,13 +35,13 @@ describe("BucketDropdown", () => {
|
||||
it("should call showBucketPolicy when Edit Policy link is clicked", () => {
|
||||
const showBucketPolicy = jest.fn()
|
||||
const wrapper = shallow(
|
||||
<BucketDropdown showBucketPolicy={showBucketPolicy} />,
|
||||
<BucketDropdown showBucketPolicy={showBucketPolicy} />
|
||||
)
|
||||
wrapper
|
||||
.find("li a")
|
||||
.find("MenuItem")
|
||||
.at(0)
|
||||
.simulate("click", {
|
||||
stopPropagation: jest.fn(),
|
||||
stopPropagation: jest.fn()
|
||||
})
|
||||
expect(showBucketPolicy).toHaveBeenCalled()
|
||||
})
|
||||
@@ -49,13 +49,13 @@ describe("BucketDropdown", () => {
|
||||
it("should call deleteBucket when Delete link is clicked", () => {
|
||||
const deleteBucket = jest.fn()
|
||||
const wrapper = shallow(
|
||||
<BucketDropdown bucket={"test"} deleteBucket={deleteBucket} />,
|
||||
<BucketDropdown bucket={"test"} deleteBucket={deleteBucket} />
|
||||
)
|
||||
wrapper
|
||||
.find("li a")
|
||||
.find("MenuItem")
|
||||
.at(1)
|
||||
.simulate("click", {
|
||||
stopPropagation: jest.fn(),
|
||||
stopPropagation: jest.fn()
|
||||
})
|
||||
expect(deleteBucket).toHaveBeenCalledWith("test")
|
||||
})
|
||||
|
||||
@@ -23,19 +23,19 @@ jest.mock("../../web", () => ({
|
||||
LoggedIn: jest
|
||||
.fn(() => false)
|
||||
.mockReturnValueOnce(true)
|
||||
.mockReturnValueOnce(true),
|
||||
.mockReturnValueOnce(true)
|
||||
}))
|
||||
|
||||
describe("BucketList", () => {
|
||||
it("should render without crashing", () => {
|
||||
const fetchBuckets = jest.fn()
|
||||
shallow(<BucketList visibleBuckets={[]} fetchBuckets={fetchBuckets} />)
|
||||
shallow(<BucketList filteredBuckets={[]} fetchBuckets={fetchBuckets} />)
|
||||
})
|
||||
|
||||
it("should call fetchBuckets before component is mounted", () => {
|
||||
const fetchBuckets = jest.fn()
|
||||
const wrapper = shallow(
|
||||
<BucketList visibleBuckets={[]} fetchBuckets={fetchBuckets} />,
|
||||
<BucketList filteredBuckets={[]} fetchBuckets={fetchBuckets} />
|
||||
)
|
||||
expect(fetchBuckets).toHaveBeenCalled()
|
||||
})
|
||||
@@ -46,10 +46,10 @@ describe("BucketList", () => {
|
||||
history.push("/bk1/pre1")
|
||||
const wrapper = shallow(
|
||||
<BucketList
|
||||
visibleBuckets={[]}
|
||||
filteredBuckets={[]}
|
||||
setBucketList={setBucketList}
|
||||
selectBucket={selectBucket}
|
||||
/>,
|
||||
/>
|
||||
)
|
||||
expect(setBucketList).toHaveBeenCalledWith(["bk1"])
|
||||
expect(selectBucket).toHaveBeenCalledWith("bk1", "pre1")
|
||||
|
||||
@@ -27,15 +27,15 @@ describe("BucketPolicyModal", () => {
|
||||
it("should call hideBucketPolicy when close button is clicked", () => {
|
||||
const hideBucketPolicy = jest.fn()
|
||||
const wrapper = shallow(
|
||||
<BucketPolicyModal hideBucketPolicy={hideBucketPolicy} policies={[]} />,
|
||||
<BucketPolicyModal hideBucketPolicy={hideBucketPolicy} policies={[]} />
|
||||
)
|
||||
wrapper.find("button").simulate("click")
|
||||
wrapper.find("i.close").simulate("click")
|
||||
expect(hideBucketPolicy).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it("should include the PolicyInput and Policy components when there are any policies", () => {
|
||||
const wrapper = shallow(
|
||||
<BucketPolicyModal policies={[{ prefix: "test", policy: READ_ONLY }]} />,
|
||||
<BucketPolicyModal policies={[{ prefix: "test", policy: READ_ONLY }]} />
|
||||
)
|
||||
expect(wrapper.find("Connect(PolicyInput)").length).toBe(1)
|
||||
expect(wrapper.find("Connect(Policy)").length).toBe(1)
|
||||
|
||||
@@ -28,8 +28,8 @@ describe("BucketSearch", () => {
|
||||
const wrapper = shallow(<BucketSearch onChange={onChange} />)
|
||||
wrapper.find("input").simulate("change", {
|
||||
target: {
|
||||
value: "test",
|
||||
},
|
||||
value: "test"
|
||||
}
|
||||
})
|
||||
expect(onChange).toHaveBeenCalledWith("test")
|
||||
})
|
||||
|
||||
@@ -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("")
|
||||
|
||||
@@ -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("*")
|
||||
})
|
||||
})
|
||||
|
||||
@@ -23,21 +23,21 @@ import web from "../../web"
|
||||
jest.mock("../../web", () => ({
|
||||
SetBucketPolicy: jest.fn(() => {
|
||||
return Promise.resolve()
|
||||
}),
|
||||
})
|
||||
}))
|
||||
|
||||
describe("PolicyInput", () => {
|
||||
it("should render without crashing", () => {
|
||||
const fetchPolicies = jest.fn()
|
||||
shallow(
|
||||
<PolicyInput currentBucket={"bucket"} fetchPolicies={fetchPolicies} />,
|
||||
<PolicyInput currentBucket={"bucket"} fetchPolicies={fetchPolicies} />
|
||||
)
|
||||
})
|
||||
|
||||
it("should call fetchPolicies after the component has mounted", () => {
|
||||
const fetchPolicies = jest.fn()
|
||||
const wrapper = shallow(
|
||||
<PolicyInput currentBucket={"bucket"} fetchPolicies={fetchPolicies} />,
|
||||
<PolicyInput currentBucket={"bucket"} fetchPolicies={fetchPolicies} />
|
||||
)
|
||||
setImmediate(() => {
|
||||
expect(fetchPolicies).toHaveBeenCalled()
|
||||
@@ -51,22 +51,22 @@ describe("PolicyInput", () => {
|
||||
currentBucket={"bucket"}
|
||||
policies={[]}
|
||||
fetchPolicies={fetchPolicies}
|
||||
/>,
|
||||
/>
|
||||
)
|
||||
wrapper.instance().prefix = {
|
||||
value: "baz",
|
||||
value: "baz"
|
||||
}
|
||||
wrapper.instance().policy = {
|
||||
value: READ_ONLY,
|
||||
value: READ_ONLY
|
||||
}
|
||||
wrapper.find("button").simulate("click", {
|
||||
preventDefault: jest.fn(),
|
||||
preventDefault: jest.fn()
|
||||
})
|
||||
|
||||
expect(web.SetBucketPolicy).toHaveBeenCalledWith({
|
||||
bucketName: "bucket",
|
||||
prefix: "baz",
|
||||
policy: READ_ONLY,
|
||||
policy: READ_ONLY
|
||||
})
|
||||
|
||||
setImmediate(() => {
|
||||
@@ -81,21 +81,21 @@ describe("PolicyInput", () => {
|
||||
currentBucket={"bucket"}
|
||||
policies={[]}
|
||||
fetchPolicies={fetchPolicies}
|
||||
/>,
|
||||
/>
|
||||
)
|
||||
wrapper.instance().prefix = {
|
||||
value: "*",
|
||||
value: "*"
|
||||
}
|
||||
wrapper.instance().policy = {
|
||||
value: READ_ONLY,
|
||||
value: READ_ONLY
|
||||
}
|
||||
|
||||
wrapper.find("button").simulate("click", {
|
||||
preventDefault: jest.fn(),
|
||||
preventDefault: jest.fn()
|
||||
})
|
||||
|
||||
expect(wrapper.instance().prefix).toEqual({
|
||||
value: "",
|
||||
value: ""
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -24,12 +24,12 @@ jest.mock("../../web", () => ({
|
||||
return Promise.resolve({
|
||||
buckets: [
|
||||
{
|
||||
name: "test1",
|
||||
name: "test1"
|
||||
},
|
||||
{
|
||||
name: "test2",
|
||||
},
|
||||
],
|
||||
name: "test2"
|
||||
}
|
||||
]
|
||||
})
|
||||
}),
|
||||
MakeBucket: jest.fn(() => {
|
||||
@@ -37,11 +37,11 @@ jest.mock("../../web", () => ({
|
||||
}),
|
||||
DeleteBucket: jest.fn(() => {
|
||||
return Promise.resolve()
|
||||
}),
|
||||
})
|
||||
}))
|
||||
|
||||
jest.mock("../../objects/actions", () => ({
|
||||
selectPrefix: () => dispatch => {},
|
||||
selectPrefix: () => dispatch => {}
|
||||
}))
|
||||
|
||||
const middlewares = [thunk]
|
||||
@@ -53,12 +53,12 @@ describe("Buckets actions", () => {
|
||||
const expectedActions = [
|
||||
{
|
||||
type: "buckets/SET_LIST",
|
||||
buckets: ["test1", "test2"],
|
||||
buckets: ["test1", "test2"]
|
||||
},
|
||||
{
|
||||
type: "buckets/SET_CURRENT_BUCKET",
|
||||
bucket: "test1",
|
||||
},
|
||||
bucket: "test1"
|
||||
}
|
||||
]
|
||||
return store.dispatch(actionsBuckets.fetchBuckets()).then(() => {
|
||||
const actions = store.getActions()
|
||||
@@ -72,12 +72,12 @@ describe("Buckets actions", () => {
|
||||
const expectedActions = [
|
||||
{
|
||||
type: "buckets/SET_LIST",
|
||||
buckets: ["test1", "test2"],
|
||||
buckets: ["test1", "test2"]
|
||||
},
|
||||
{
|
||||
type: "buckets/SET_CURRENT_BUCKET",
|
||||
bucket: "test2",
|
||||
},
|
||||
bucket: "test2"
|
||||
}
|
||||
]
|
||||
window.location
|
||||
return store.dispatch(actionsBuckets.fetchBuckets()).then(() => {
|
||||
@@ -92,12 +92,12 @@ describe("Buckets actions", () => {
|
||||
const expectedActions = [
|
||||
{
|
||||
type: "buckets/SET_LIST",
|
||||
buckets: ["test1", "test2"],
|
||||
buckets: ["test1", "test2"]
|
||||
},
|
||||
{
|
||||
type: "buckets/SET_CURRENT_BUCKET",
|
||||
bucket: "test1",
|
||||
},
|
||||
bucket: "test1"
|
||||
}
|
||||
]
|
||||
window.location
|
||||
return store.dispatch(actionsBuckets.fetchBuckets()).then(() => {
|
||||
@@ -111,8 +111,8 @@ describe("Buckets actions", () => {
|
||||
const expectedActions = [
|
||||
{
|
||||
type: "buckets/SET_CURRENT_BUCKET",
|
||||
bucket: "test1",
|
||||
},
|
||||
bucket: "test1"
|
||||
}
|
||||
]
|
||||
store.dispatch(actionsBuckets.selectBucket("test1"))
|
||||
const actions = store.getActions()
|
||||
@@ -124,8 +124,8 @@ describe("Buckets actions", () => {
|
||||
const expectedActions = [
|
||||
{
|
||||
type: "buckets/SHOW_MAKE_BUCKET_MODAL",
|
||||
show: true,
|
||||
},
|
||||
show: true
|
||||
}
|
||||
]
|
||||
store.dispatch(actionsBuckets.showMakeBucketModal())
|
||||
const actions = store.getActions()
|
||||
@@ -137,8 +137,8 @@ describe("Buckets actions", () => {
|
||||
const expectedActions = [
|
||||
{
|
||||
type: "buckets/SHOW_MAKE_BUCKET_MODAL",
|
||||
show: false,
|
||||
},
|
||||
show: false
|
||||
}
|
||||
]
|
||||
store.dispatch(actionsBuckets.hideMakeBucketModal())
|
||||
const actions = store.getActions()
|
||||
@@ -150,8 +150,8 @@ describe("Buckets actions", () => {
|
||||
const expectedActions = [
|
||||
{
|
||||
type: "buckets/SHOW_BUCKET_POLICY",
|
||||
show: true,
|
||||
},
|
||||
show: true
|
||||
}
|
||||
]
|
||||
store.dispatch(actionsBuckets.showBucketPolicy())
|
||||
const actions = store.getActions()
|
||||
@@ -163,8 +163,8 @@ describe("Buckets actions", () => {
|
||||
const expectedActions = [
|
||||
{
|
||||
type: "buckets/SHOW_BUCKET_POLICY",
|
||||
show: false,
|
||||
},
|
||||
show: false
|
||||
}
|
||||
]
|
||||
store.dispatch(actionsBuckets.hideBucketPolicy())
|
||||
const actions = store.getActions()
|
||||
@@ -176,8 +176,8 @@ describe("Buckets actions", () => {
|
||||
const expectedActions = [
|
||||
{
|
||||
type: "buckets/SET_POLICIES",
|
||||
policies: ["test1", "test2"],
|
||||
},
|
||||
policies: ["test1", "test2"]
|
||||
}
|
||||
]
|
||||
store.dispatch(actionsBuckets.setPolicies(["test1", "test2"]))
|
||||
const actions = store.getActions()
|
||||
@@ -189,8 +189,8 @@ describe("Buckets actions", () => {
|
||||
const expectedActions = [
|
||||
{
|
||||
type: "buckets/ADD",
|
||||
bucket: "test",
|
||||
},
|
||||
bucket: "test"
|
||||
}
|
||||
]
|
||||
store.dispatch(actionsBuckets.addBucket("test"))
|
||||
const actions = store.getActions()
|
||||
@@ -202,8 +202,8 @@ describe("Buckets actions", () => {
|
||||
const expectedActions = [
|
||||
{
|
||||
type: "buckets/REMOVE",
|
||||
bucket: "test",
|
||||
},
|
||||
bucket: "test"
|
||||
}
|
||||
]
|
||||
store.dispatch(actionsBuckets.removeBucket("test"))
|
||||
const actions = store.getActions()
|
||||
@@ -215,12 +215,12 @@ describe("Buckets actions", () => {
|
||||
const expectedActions = [
|
||||
{
|
||||
type: "buckets/ADD",
|
||||
bucket: "test1",
|
||||
bucket: "test1"
|
||||
},
|
||||
{
|
||||
type: "buckets/SET_CURRENT_BUCKET",
|
||||
bucket: "test1",
|
||||
},
|
||||
bucket: "test1"
|
||||
}
|
||||
]
|
||||
return store.dispatch(actionsBuckets.makeBucket("test1")).then(() => {
|
||||
const actions = store.getActions()
|
||||
@@ -239,26 +239,26 @@ describe("Buckets actions", () => {
|
||||
alert: {
|
||||
id: 0,
|
||||
message: "Bucket 'test3' has been deleted.",
|
||||
type: "info",
|
||||
},
|
||||
type: "info"
|
||||
}
|
||||
},
|
||||
{
|
||||
type: "buckets/REMOVE",
|
||||
bucket: "test3",
|
||||
bucket: "test3"
|
||||
},
|
||||
{
|
||||
type: "buckets/SET_LIST",
|
||||
buckets: ["test1", "test2"],
|
||||
buckets: ["test1", "test2"]
|
||||
},
|
||||
{
|
||||
type: "buckets/SET_CURRENT_BUCKET",
|
||||
bucket: "test1",
|
||||
},
|
||||
bucket: "test1"
|
||||
}
|
||||
]
|
||||
return store.dispatch(actionsBuckets.deleteBucket("test3")).then(() => {
|
||||
const actions = store.getActions()
|
||||
expect(actions).toEqual(expectedActions)
|
||||
})
|
||||
},
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
@@ -26,14 +26,14 @@ describe("buckets reducer", () => {
|
||||
filter: "",
|
||||
currentBucket: "",
|
||||
showBucketPolicy: false,
|
||||
showMakeBucketModal: false,
|
||||
showMakeBucketModal: false
|
||||
})
|
||||
})
|
||||
|
||||
it("should handle SET_LIST", () => {
|
||||
const newState = reducer(undefined, {
|
||||
type: actions.SET_LIST,
|
||||
buckets: ["bk1", "bk2"],
|
||||
buckets: ["bk1", "bk2"]
|
||||
})
|
||||
expect(newState.list).toEqual(["bk1", "bk2"])
|
||||
})
|
||||
@@ -41,12 +41,12 @@ describe("buckets reducer", () => {
|
||||
it("should handle ADD", () => {
|
||||
const newState = reducer(
|
||||
{
|
||||
list: ["test1", "test2"],
|
||||
list: ["test1", "test2"]
|
||||
},
|
||||
{
|
||||
type: actions.ADD,
|
||||
bucket: "test3",
|
||||
},
|
||||
bucket: "test3"
|
||||
}
|
||||
)
|
||||
expect(newState.list).toEqual(["test3", "test1", "test2"])
|
||||
})
|
||||
@@ -54,12 +54,12 @@ describe("buckets reducer", () => {
|
||||
it("should handle REMOVE", () => {
|
||||
const newState = reducer(
|
||||
{
|
||||
list: ["test1", "test2"],
|
||||
list: ["test1", "test2"]
|
||||
},
|
||||
{
|
||||
type: actions.REMOVE,
|
||||
bucket: "test2",
|
||||
},
|
||||
bucket: "test2"
|
||||
}
|
||||
)
|
||||
expect(newState.list).toEqual(["test1"])
|
||||
})
|
||||
@@ -67,7 +67,7 @@ describe("buckets reducer", () => {
|
||||
it("should handle SET_FILTER", () => {
|
||||
const newState = reducer(undefined, {
|
||||
type: actions.SET_FILTER,
|
||||
filter: "test",
|
||||
filter: "test"
|
||||
})
|
||||
expect(newState.filter).toEqual("test")
|
||||
})
|
||||
@@ -75,7 +75,7 @@ describe("buckets reducer", () => {
|
||||
it("should handle SET_CURRENT_BUCKET", () => {
|
||||
const newState = reducer(undefined, {
|
||||
type: actions.SET_CURRENT_BUCKET,
|
||||
bucket: "test",
|
||||
bucket: "test"
|
||||
})
|
||||
expect(newState.currentBucket).toEqual("test")
|
||||
})
|
||||
@@ -83,7 +83,7 @@ describe("buckets reducer", () => {
|
||||
it("should handle SET_POLICIES", () => {
|
||||
const newState = reducer(undefined, {
|
||||
type: actions.SET_POLICIES,
|
||||
policies: ["test1", "test2"],
|
||||
policies: ["test1", "test2"]
|
||||
})
|
||||
expect(newState.policies).toEqual(["test1", "test2"])
|
||||
})
|
||||
@@ -91,7 +91,7 @@ describe("buckets reducer", () => {
|
||||
it("should handle SHOW_BUCKET_POLICY", () => {
|
||||
const newState = reducer(undefined, {
|
||||
type: actions.SHOW_BUCKET_POLICY,
|
||||
show: true,
|
||||
show: true
|
||||
})
|
||||
expect(newState.showBucketPolicy).toBeTruthy()
|
||||
})
|
||||
@@ -99,7 +99,7 @@ describe("buckets reducer", () => {
|
||||
it("should handle SHOW_MAKE_BUCKET_MODAL", () => {
|
||||
const newState = reducer(undefined, {
|
||||
type: actions.SHOW_MAKE_BUCKET_MODAL,
|
||||
show: true,
|
||||
show: true
|
||||
})
|
||||
expect(newState.showMakeBucketModal).toBeTruthy()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user