From 29204d0b28496bb50c3bf4eb15218d87238e1fd8 Mon Sep 17 00:00:00 2001 From: Michael Leonard Date: Tue, 13 Oct 2020 08:23:22 -0400 Subject: [PATCH] MM-T636 Description field for incoming and outgoing webhooks can hold 500 characters (#6682) * first run * fixes * refactor, add sanity check * Delete description_field_for_incoming_and_outgoing_webhooks_can_hold_500_characters_spec.js name change * move let into describe block Co-authored-by: Mattermod --- .../description_length_check_spec.js | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 e2e/cypress/integration/integrations/incoming_webhook/description_length_check_spec.js diff --git a/e2e/cypress/integration/integrations/incoming_webhook/description_length_check_spec.js b/e2e/cypress/integration/integrations/incoming_webhook/description_length_check_spec.js new file mode 100644 index 000000000000..21590bd874e1 --- /dev/null +++ b/e2e/cypress/integration/integrations/incoming_webhook/description_length_check_spec.js @@ -0,0 +1,38 @@ +// 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: @integrations + +describe('Integrations', () => { + const maxDescription = '1234567890'.repeat(50); + const overMaxDescription = `${maxDescription}123`; + + let testTeam; + + before(() => { + // # Login as test user and visit the newly created test channel + cy.apiInitSetup().then(({team}) => { + testTeam = team; + + // # Visit the Incoming Webhooks add page + cy.visit(`/${team.name}/integrations/incoming_webhooks/add`); + }); + }); + + it('MM-T636 Description field length check', () => { + // * Check incoming description field only accepts 500 characters + cy.get('#description').clear().type(maxDescription).should('have.value', maxDescription); + cy.get('#description').clear().type(overMaxDescription).should('have.value', maxDescription); + + // * Check outgoing description field only accepts 500 characters + cy.visit(`/${testTeam.name}/integrations/outgoing_webhooks/add`); + cy.get('#description').clear().type(maxDescription).should('have.value', maxDescription); + cy.get('#description').clear().type(overMaxDescription).should('have.value', maxDescription); + }); +});