diff --git a/e2e-tests/cypress/tests/integration/channels/enterprise/group_mentions/group_mentions_permissions_spec.js b/e2e-tests/cypress/tests/integration/channels/enterprise/group_mentions/group_mentions_permissions_spec.ts similarity index 98% rename from e2e-tests/cypress/tests/integration/channels/enterprise/group_mentions/group_mentions_permissions_spec.js rename to e2e-tests/cypress/tests/integration/channels/enterprise/group_mentions/group_mentions_permissions_spec.ts index f52d25e85e..4fb2d2c606 100644 --- a/e2e-tests/cypress/tests/integration/channels/enterprise/group_mentions/group_mentions_permissions_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/enterprise/group_mentions/group_mentions_permissions_spec.ts @@ -9,6 +9,7 @@ // Group: @channels @enterprise @system_console @group_mentions +import {Team} from '@mattermost/types/teams'; import ldapUsers from '../../../../fixtures/ldap_users.json'; import * as TIMEOUTS from '../../../../fixtures/timeouts'; @@ -18,12 +19,14 @@ import { } from '../system_console/channel_moderation/helpers'; import {enableGroupMention} from './helpers'; +import {UserProfile} from '@mattermost/types/users'; +import {Group} from '@mattermost/types/groups'; describe('Group Mentions', () => { - let groupID; + let groupID: string; let boardUser; - let regularUser; - let testTeam; + let regularUser: UserProfile; + let testTeam: Team; before(() => { // * Check if server has license for LDAP Groups @@ -59,7 +62,7 @@ describe('Group Mentions', () => { // # Get board group id cy.apiGetGroups().then((res) => { - res.body.forEach((group) => { + res.body.forEach((group: Group) => { if (group.display_name === 'board') { // # Set groupID to navigate to group page directly groupID = group.id; diff --git a/e2e-tests/cypress/tests/integration/channels/enterprise/group_mentions/group_mentions_posts_spec.js b/e2e-tests/cypress/tests/integration/channels/enterprise/group_mentions/group_mentions_posts_spec.ts similarity index 96% rename from e2e-tests/cypress/tests/integration/channels/enterprise/group_mentions/group_mentions_posts_spec.js rename to e2e-tests/cypress/tests/integration/channels/enterprise/group_mentions/group_mentions_posts_spec.ts index 9e1ca26eec..1753c65014 100644 --- a/e2e-tests/cypress/tests/integration/channels/enterprise/group_mentions/group_mentions_posts_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/enterprise/group_mentions/group_mentions_posts_spec.ts @@ -9,17 +9,20 @@ // Group: @channels @enterprise @system_console @group_mentions +import {UserProfile} from '@mattermost/types/users'; import ldapUsers from '../../../../fixtures/ldap_users.json'; import * as TIMEOUTS from '../../../../fixtures/timeouts'; import {enableGroupMention} from './helpers'; +import {Team} from '@mattermost/types/teams'; +import {Group} from '@mattermost/types/groups'; describe('Group Mentions', () => { - let groupID1; - let groupID2; + let groupID1: string; + let groupID2: string; let boardUser; - let regularUser; - let testTeam; + let regularUser: UserProfile; + let testTeam: Team; before(() => { // * Check if server has license for LDAP Groups @@ -66,7 +69,7 @@ describe('Group Mentions', () => { // # Get board group id cy.apiGetGroups().then((res) => { - res.body.forEach((group) => { + res.body.forEach((group: Group) => { if (group.display_name === 'board') { // # Set groupID1 to navigate to group page directly groupID1 = group.id; @@ -257,19 +260,19 @@ describe('Group Mentions', () => { // # Link the group and the channel. cy.apiLinkGroupChannel(groupID1, channel.id); - cy.apiLogin({username: 'board.one', password: 'Password1'}).then(({user: boardOne}) => { + cy.apiLogin({username: 'board.one', password: 'Password1'} as any).then((boardOne) => { cy.apiAddUserToChannel(channel.id, boardOne.id); // # Make the channel private and group-synced. cy.apiPatchChannel(channel.id, {group_constrained: true, type: 'P'}); // # Login to create the dev user - cy.apiLogin({username: 'dev.one', password: 'Password1'}).then(({user: devOne}) => { + cy.apiLogin({username: 'dev.one', password: 'Password1'} as any).then((devOne) => { cy.apiAdminLogin(); cy.apiAddUserToTeam(testTeam.id, devOne.id); - cy.apiLogin({username: 'board.one', password: 'Password1'}); + cy.apiLogin({username: 'board.one', password: 'Password1'} as any); // # Visit the channel cy.visit(`/${testTeam.name}/channels/${channel.name}`); diff --git a/e2e-tests/cypress/tests/integration/channels/enterprise/group_mentions/group_mentions_system_messages_spec.js b/e2e-tests/cypress/tests/integration/channels/enterprise/group_mentions/group_mentions_system_messages_spec.ts similarity index 97% rename from e2e-tests/cypress/tests/integration/channels/enterprise/group_mentions/group_mentions_system_messages_spec.js rename to e2e-tests/cypress/tests/integration/channels/enterprise/group_mentions/group_mentions_system_messages_spec.ts index 7ffefdbb3e..08d44c96de 100644 --- a/e2e-tests/cypress/tests/integration/channels/enterprise/group_mentions/group_mentions_system_messages_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/enterprise/group_mentions/group_mentions_system_messages_spec.ts @@ -21,12 +21,15 @@ import { import {checkboxesTitleToIdMap} from '../system_console/channel_moderation/constants'; import {enableGroupMention} from './helpers'; +import {Team} from '@mattermost/types/teams'; +import {UserProfile} from '@mattermost/types/users'; +import {Group} from '@mattermost/types/groups'; describe('Group Mentions', () => { - let groupID; + let groupID: string; let boardUser; - let regularUser; - let testTeam; + let regularUser: UserProfile; + let testTeam: Team; before(() => { // * Check if server has license for LDAP Groups @@ -62,7 +65,7 @@ describe('Group Mentions', () => { // # Get board group id cy.apiGetGroups().then((res) => { - res.body.forEach((group) => { + res.body.forEach((group: Group) => { if (group.display_name === 'board') { // # Set groupID to navigate to group page directly groupID = group.id; diff --git a/e2e-tests/cypress/tests/integration/channels/enterprise/group_mentions/helpers.js b/e2e-tests/cypress/tests/integration/channels/enterprise/group_mentions/helpers.ts similarity index 91% rename from e2e-tests/cypress/tests/integration/channels/enterprise/group_mentions/helpers.js rename to e2e-tests/cypress/tests/integration/channels/enterprise/group_mentions/helpers.ts index 73c17c61b1..36163191ac 100644 --- a/e2e-tests/cypress/tests/integration/channels/enterprise/group_mentions/helpers.js +++ b/e2e-tests/cypress/tests/integration/channels/enterprise/group_mentions/helpers.ts @@ -3,7 +3,7 @@ import * as TIMEOUTS from '../../../../fixtures/timeouts'; -export function enableGroupMention(groupName, groupID, userEmail) { +export function enableGroupMention(groupName: string, groupID: string, userEmail?: string): void { // # Visit Group Configurations page cy.visit(`/admin_console/user_management/groups/${groupID}`);