-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
style: simplify test assertions #6983
style: simplify test assertions #6983
Conversation
Generate changelog in
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple small comments, but the reset generally LGTM
}); | ||
|
||
it("does not render menu if menuRenderer not provided", () => { | ||
const component = mountTableQuadrant(); | ||
expect(component.find(`.${Classes.TABLE_TOP_CONTAINER}`).children().length).to.equal(0); | ||
expect(component.find(`.${Classes.TABLE_TOP_CONTAINER}`).children()).to.have.lengthOf(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: .to.be.empty
seems a bit more appropriate for this type of check:
expect(component.find(`.${Classes.TABLE_TOP_CONTAINER}`).children()).to.have.lengthOf(0); | |
expect(component.find(`.${Classes.TABLE_TOP_CONTAINER}`).children()).to.be.empty; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, done!
packages/table/test/regionsTests.ts
Outdated
@@ -238,7 +238,7 @@ describe("Regions", () => { | |||
]; | |||
|
|||
const joinedGroups = Regions.joinStyledRegionGroups([Regions.row(2)], myGroups, undefined); | |||
expect(joinedGroups).to.have.lengthOf(2); | |||
expect(joinedGroups).to.have.to.have.lengthOf(2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: duplicate chain for assertions in this file:
expect(joinedGroups).to.have.to.have.lengthOf(2); | |
expect(joinedGroups).to.have.lengthOf(2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, thanks for the cleanup!
No description provided.