This repository has been archived by the owner on Mar 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MM-T644 Integrations display on team where they were created (#6752)
- Loading branch information
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
...egration/integrations/incoming_webhook/integrations_display_on_team_where_created_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,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'); | ||
}); | ||
}); |