forked from mattermost/mattermost-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MM 27448 remove jquery from root (mattermost#6730)
Co-authored-by: Joseph Baylon <[email protected]>
- Loading branch information
Showing
4 changed files
with
110 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
e2e/cypress/integration/keyboard_shortcuts/backspace_spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. | ||
// See LICENSE.txt for license information. | ||
|
||
// *************************************************************** | ||
// - [#] indicates a test step (e.g. # Go to a page) | ||
// - [*] indicates an assertion (e.g. * Check the title) | ||
// - Use element ID when selecting an element. Create one if none. | ||
// *************************************************************** | ||
|
||
// Group: @keyboard_shortcuts | ||
|
||
describe('Keyboard Shortcuts', () => { | ||
let testUser; | ||
let testTeam; | ||
let publicChannel; | ||
|
||
before(() => { | ||
cy.apiInitSetup({loginAfter: true}).then(({team, channel, user}) => { | ||
// # Visit a test channel | ||
testTeam = team; | ||
publicChannel = channel; | ||
testUser = user; | ||
|
||
cy.visit(`/${team.name}/channels/${channel.name}`); | ||
}); | ||
}); | ||
|
||
it('MM-T3421 - Pressing the backspace key without an input focused should not send the browser back in history', () => { | ||
// # Navigate to a couple of pages | ||
cy.visit(`/${testTeam.name}/channels/town-square`); | ||
cy.visit(`/${testTeam.name}/channels/off-topic`); | ||
cy.visit(`/${testTeam.name}/channels/${publicChannel.name}`); | ||
cy.visit(`/${testTeam.name}/channels/off-topic`); | ||
|
||
// # Visit a DM URL | ||
cy.visit(`/${testTeam.name}/messages/@${testUser.username}`); | ||
cy.url().should('include', `/${testTeam.name}/messages/@${testUser.username}`); | ||
|
||
// # Type/edit some text and remove focus from the input field | ||
cy.get('#post_textbox').clear().type('This is a normal sentence.').type('{backspace}{backspace}').blur(); | ||
|
||
// * Verify that the backspace key presses modified the input correctly | ||
cy.get('#post_textbox').should('have.value', 'This is a normal sentenc'); | ||
|
||
// # Select the body to remove focus from the input field | ||
cy.get('body').type('{backspace}'); | ||
cy.get('body').type('{backspace}'); | ||
|
||
// * Verify that the additional backspace key presses on blur doesn't affect the input | ||
cy.get('#post_textbox').should('have.value', 'This is a normal sentenc'); | ||
|
||
// * Verify that the URL doesn't change from the last URL | ||
cy.url().should('include', `/${testTeam.name}/messages/@${testUser.username}`); | ||
}); | ||
}); |