Skip to content
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

[FIX] Closing sidebar when room menu is clicked. #13842

Merged
merged 9 commits into from
Apr 6, 2019
1 change: 1 addition & 0 deletions app/ui-sidenav/client/sidebarItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ Template.sidebarItem.events({
return menu.close();
},
'click .sidebar-item__menu'(e) {
e.stopPropagation(); // to not close the menu
e.preventDefault();

const canLeave = () => {
Expand Down
9 changes: 9 additions & 0 deletions tests/end-to-end/ui/08-resolutions.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ describe('[Resolution]', () => {
mainContent.mainContent.getLocation().should.not.deep.equal({ x:0 });
});

it('it should not close sidebar on pressing the sidebar item menu', () => {
sideNav.firstSidebarItem.moveToObject();
sideNav.firstSidebarItemMenu.waitForVisible(10000);
sideNav.firstSidebarItemMenu.click();
browser.pause(100);
mainContent.mainContent.getLocation().should.not.deep.equal({ x:0 });
sideNav.popoverOverlay.click();
});

it('it should open general channel', () => {
sideNav.openChannel('general');
});
Expand Down
4 changes: 4 additions & 0 deletions tests/pageobjects/side-nav.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ class SideNav extends Page {

get sidebarWrap() { return browser.element('.sidebar-wrap'); }

get firstSidebarItem() { return browser.element('.sidebar-item'); }
get firstSidebarItemMenu() { return browser.element('.sidebar-item__menu'); }
get popoverOverlay() { return browser.element('.rc-popover.rc-popover--sidebar-item'); }

// Opens a channel via rooms list
openChannel(channelName) {
browser.waitForVisible(`.sidebar-item__ellipsis=${ channelName }`, 10000);
Expand Down