-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
test: add integration test in avatarMenu component #352
Conversation
browser.keys(ESCAPE_KEY); | ||
expect(avatarMenu.hasFocusButton()).toBe(true); | ||
}); | ||
it('should open the menu when the button is focused and press Space', () => { |
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.
remove this
browser.keys(SPACE_KEY); | ||
expect(avatarMenu.isOpen()).toBe(true); | ||
}); | ||
it('should open the menu when the button is focused and press Enter', () => { |
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.
remove this
const firstMenuItem = avatarMenu.getItem(0); | ||
const lastMenuItem = avatarMenu.getItem(1); | ||
avatarMenu.click(); | ||
firstMenuItem.hover(); |
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.
here you don't need to put the focus to the first item again since initially the focus is there
const avatarMenu = new PageAvatarMenu(AVATAR_MENU); | ||
avatarMenu.click(); | ||
browser.keys(TAB_KEY); | ||
expect(avatarMenu.isOpen()).toBe(false); |
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.
add:
expect(avatarMenu.hasFocusButton()).toBe(false);
and then update the name:
should close the menu and not have focus in the trigger menu button when the menu is opened and press the tab key
fix: #332 #334