Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
MM-T644 Integrations display on team where they were created (#6752)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeworX authored and calebroseland committed Oct 27, 2020
1 parent 2bc4bb2 commit 83f8745
Showing 1 changed file with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// 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 teamA;
let teamB;
let newIncomingHook;

before(() => {
// # Login, create incoming webhook for Team A
cy.apiInitSetup().then(({team, channel}) => {
teamA = team.name;
newIncomingHook = {
channel_id: channel.id,
display_name: 'Team A Webhook',
};

//# Create a new webhook for Team A
cy.apiCreateWebhook(newIncomingHook);
});

// # Login, create incoming webhook for Team B
cy.apiInitSetup().then(({team, channel}) => {
teamB = team.name;
newIncomingHook = {
channel_id: channel.id,
display_name: 'Team B Webhook',
};

// # Create a new webhook for Team B
cy.apiCreateWebhook(newIncomingHook);
});
});

it('MM-T644 Integrations display on team where they were created', () => {
// # Visit Test Team B Incoming Webhooks page
cy.visit(`/${teamB}/integrations/incoming_webhooks`);

// * Assert the page contains only Team B Outgoing Webhook
cy.findByText('Team', {exact: false}).contains('Team B Webhook').and('does.not.contain', 'Team A Webhook');

// # Visit Team A Incoming Webhooks page
cy.visit(`/${teamA}/integrations/incoming_webhooks`);

// * Assert the page contains only Team A Outgoing Webhook
cy.findByText('Team', {exact: false}).contains('Team A Webhook').and('does.not.contain', 'Team B Webhook');
});
});

0 comments on commit 83f8745

Please sign in to comment.