Fix bug in Share Object Modal (#6257)

Fixes #6249
This commit is contained in:
Sanat Mouli
2018-08-09 09:45:43 -07:00
committed by kannappanr
parent 71979376b5
commit efac90461a
3 changed files with 41 additions and 26 deletions

View File

@@ -88,8 +88,21 @@ describe("ObjectActions", () => {
object={{ name: "obj1" }}
currentPrefix={"pre1/"}
showShareObjectModal={true}
shareObjectName={"obj1"}
/>
)
expect(wrapper.find("Connect(ShareObjectModal)").length).toBe(1)
})
it("shouldn't render ShareObjectModal when the names of the objects don't match", () => {
const wrapper = shallow(
<ObjectActions
object={{ name: "obj1" }}
currentPrefix={"pre1/"}
showShareObjectModal={true}
shareObjectName={"obj2"}
/>
)
expect(wrapper.find("Connect(ShareObjectModal)").length).toBe(0)
})
})