Skip to content

Commit

Permalink
[MM-17449] Focus will move to main input box after a new channel has … (
Browse files Browse the repository at this point in the history
mattermost#3495)

* [MM-17449] Focus will move to main input box after a new channel has been opened

Add E2E test for M17449 - Focus will move to main input box after a new channel has been opened

* Update e2e/cypress/integration/messaging/focus_move_spec.js

Co-Authored-By: Saturnino Abril <[email protected]>

* Update e2e/cypress/integration/messaging/focus_move_spec.js

Update e2e/cypress/integration/messaging/focus_move_spec.js
  • Loading branch information
sij507 authored and srkgupta committed Aug 23, 2019
1 parent 5472ec3 commit 73803a9
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions e2e/cypress/integration/messaging/focus_move_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// - Use element ID when selecting an element. Create one if none.
// ***************************************************************

import * as TIMEOUTS from '../../fixtures/timeouts';

function verifyFocusInAddChannelMemberModal() {
// # Click to access the Channel menu
cy.get('#channelHeaderTitle').click();
Expand Down Expand Up @@ -72,6 +74,32 @@ describe('Messaging', () => {
cy.get('#post_textbox').should('be.focused');
});

it('M17449 - Focus will move to main input box after a new channel has been opened', () => {
//# Click on Town-Square channel
cy.get('#sidebarItem_town-square').click({force: true});

//# Open the reply thread on the most recent post on Town-Square channel
cy.clickPostCommentIcon();

//# Place the focus inside the RHS input box
cy.get('#reply_textbox').focus().should('be.focused');

//# Use CTRL+K or CMD+K to open the channel switcher depending on OS
cy.typeCmdOrCtrl().type('K', {release: true});

//* Verify channel switcher is visible
cy.get('#quickSwitchHint').should('be.visible');

//# Type channel name 'Off-Topic' and select it
cy.get('#quickSwitchInput').type('Off-Topic').wait(TIMEOUTS.TINY).type('{enter}');

//* Verify that it redirected into selected channel 'Off-Topic'
cy.get('#channelHeaderTitle').should('be.visible').should('contain', 'Off-Topic');

//* Verify focus is moved to main input box when the channel is opened
cy.get('#post_textbox').should('be.focused');
});

it('M17452 Focus does not move when it has already been set elsewhere', () => {
let channel;

Expand Down

0 comments on commit 73803a9

Please sign in to comment.