Skip to content

Commit

Permalink
chore: remove class active from group items + fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanHotsiy committed Aug 22, 2018
1 parent c8b7eed commit 1ba8a4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions e2e/integration/menu.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ describe('Menu', () => {
it('should sync active menu items while scroll', () => {
cy.contains('h1', 'Introduction')
.scrollIntoView()
.get('[role=menuitem].active:not(.-depth0)')
.get('[role=menuitem].active')
.should('have.text', 'Introduction');

cy.contains('h2', 'Add a new pet to the store')
.scrollIntoView()
.get('[role=menuitem].active:not(.-depth0)')
.should('have.length', 2)
.wait(100)
.get('[role=menuitem].active')
.children()
.last()
.should('have.text', 'Add a new pet to the store')
.should('be.visible');
Expand Down
2 changes: 1 addition & 1 deletion src/components/SideMenu/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class MenuItem extends React.Component<MenuItemProps> {
{item.type === 'operation' ? (
<OperationMenuItemContent {...this.props} item={item as OperationModel} />
) : (
<MenuItemLabel depth={item.depth} active={item.active || item.expanded} type={item.type}>
<MenuItemLabel depth={item.depth} active={item.active} type={item.type}>
<MenuItemTitle title={item.name}>
{item.name}
{this.props.children}
Expand Down

0 comments on commit 1ba8a4c

Please sign in to comment.