Add missing unit tests for PR #5499 (#5527)

Part of #5410
This commit is contained in:
Kaan Kabalak
2018-02-16 19:45:32 -08:00
committed by Harshavardhana
parent 44f8f7059c
commit 566ac78b8b
8 changed files with 139 additions and 1 deletions

View File

@@ -48,6 +48,26 @@ describe("ObjectsHeader", () => {
).toBeTruthy()
})
it("should render size column with desc class when objects are sorted by size", () => {
const sortObjects = jest.fn()
const wrapper = shallow(
<ObjectsHeader sortObjects={sortObjects} sortSizeOrder={true} />
)
expect(
wrapper.find("#sort-by-size i").hasClass("fa-sort-amount-desc")
).toBeTruthy()
})
it("should render last modified column with desc class when objects are sorted by last modified", () => {
const sortObjects = jest.fn()
const wrapper = shallow(
<ObjectsHeader sortObjects={sortObjects} sortLastModifiedOrder={true} />
)
expect(
wrapper.find("#sort-by-last-modified i").hasClass("fa-sort-numeric-desc")
).toBeTruthy()
})
it("should call sortObjects when a column is clicked", () => {
const sortObjects = jest.fn()
const wrapper = shallow(<ObjectsHeader sortObjects={sortObjects} />)