Skip to content

Commit

Permalink
MM-T616 Copy icon for Outgoing Webhook token (mattermost#6880)
Browse files Browse the repository at this point in the history
Co-authored-by: Mattermost <[email protected]>
  • Loading branch information
MikeworX and Mattermost committed Oct 26, 2020
1 parent e0a78f7 commit 94f4ed1
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/copy_text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export default class CopyText extends React.PureComponent<Props> {
>
<a
href='#'
data-testid='copyText'
className='fa fa-copy ml-2'
onClick={this.copyText}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// 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', () => {
let testTeam;
let testChannel;

before(() => {
// # Create test team and channel
cy.apiInitSetup().then(({team, channel}) => {
testTeam = team.name;
testChannel = channel.display_name;
});
});

it('MM-T616 Copy icon for Outgoing Webhook token', () => {
// Visit the integrations > add page
cy.visit(`/${testTeam}/integrations/outgoing_webhooks/add`);

// * Assert that we are on the add page
cy.url().should('include', '/outgoing_webhooks/add');

// # Manually set up an outgoing web-hook
cy.get('#displayName').type('test');
cy.get('#channelSelect').select(testChannel);
cy.get('#triggerWords').type('trigger');
cy.get('#callbackUrls').type('https://mattermost.com');
cy.findByText('Save').click();

// Assert that webhook was set up
cy.findByText('Setup Successful').should('be.visible');

// * Assert that token copy icon is present
cy.findByTestId('copyText').should('be.visible');

// # Close the add outgoing webhooks page
cy.findByText('Done').click();

// * Assert that we are back on the integrations > outgoing webhooks page
cy.get('#addOutgoingWebhook').should('exist');

// * Assert that the copy icon is present
cy.findByTestId('copyText').should('be.visible');
});
});

0 comments on commit 94f4ed1

Please sign in to comment.