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:
Kanagaraj M
2018-03-23 00:55:56 +05:30
committed by Harshavardhana
parent cb3818be27
commit c0e45f9098
95 changed files with 839 additions and 890 deletions

View File

@@ -25,32 +25,32 @@ describe("Path", () => {
it("should render only bucket if there is no prefix", () => {
const wrapper = shallow(<Path currentBucket={"test1"} currentPrefix={""} />)
expect(wrapper.find("span").length).toBe(1)
expect(wrapper.find("a").length).toBe(1)
expect(wrapper.text()).toBe("test1")
})
it("should render bucket and prefix", () => {
const wrapper = shallow(
<Path currentBucket={"test1"} currentPrefix={"a/b/"} />,
<Path currentBucket={"test1"} currentPrefix={"a/b/"} />
)
expect(wrapper.find("span").length).toBe(3)
expect(wrapper.find("a").length).toBe(3)
expect(
wrapper
.find("span")
.find("a")
.at(0)
.text(),
.text()
).toBe("test1")
expect(
wrapper
.find("span")
.find("a")
.at(1)
.text(),
.text()
).toBe("a")
expect(
wrapper
.find("span")
.find("a")
.at(2)
.text(),
.text()
).toBe("b")
})
@@ -61,13 +61,13 @@ describe("Path", () => {
currentBucket={"test1"}
currentPrefix={"a/b/"}
selectPrefix={selectPrefix}
/>,
/>
)
wrapper
.find("a")
.at(2)
.simulate("click", {
preventDefault: jest.fn(),
preventDefault: jest.fn()
})
expect(selectPrefix).toHaveBeenCalledWith("a/b/")
})