Repository navigation
test: restructure and simplify side-nav-item unit tests - #5973
Conversation
|
Kudos, SonarCloud Quality Gate passed!
|
| it('should have a toggle button', async () => { | ||
| expect(passiveItemWithChildren._button).to.be.ok; |
There was a problem hiding this comment.
These tests are removed in favor of DOM snapshot tests.
Also, we generally should not check for protected APIs like _button in unit tests.
| describe('active item with children', () => { | ||
| let activeItemWithChildren; | ||
|
|
||
| describe('inactive', () => { |
There was a problem hiding this comment.
Renamed passive to inactive which seems to be a better name.
| it('should be expanded', () => { | ||
| expect(activeItem.expanded).to.be.true; |
There was a problem hiding this comment.
This test is a duplicate: we check for expanded to be set for the active item with and without children.
To me it feels unnecessary to repeat this assertion twice, so I removed this test.
ugur-vaadin
left a comment
There was a problem hiding this comment.
Looks much better in terms of structure and readability.
|
This ticket/PR has been released with Vaadin 24.2.0.alpha1 and is also targeting the upcoming stable 24.2.0 version. |








Description
Reorganized tests for
vaadin-side-nav-itemin order to make them more readable:expanded)item, notpassiveItemWithChildrenType of change