Skip to content

Commit ebe099f

Browse files
authored
Merge branch 'develop' into test/abac
2 parents d1db9e0 + 17ed52a commit ebe099f

File tree

10 files changed

+19
-24
lines changed

10 files changed

+19
-24
lines changed

apps/meteor/client/views/home/cards/AddUsersCard.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const AddUsersCard = (props: Omit<ComponentProps<typeof Card>, 'type'>): ReactEl
1717
title={t('Add_users')}
1818
body={t('Invite_and_add_members_to_this_workspace_to_start_communicating')}
1919
buttons={[<GenericCardButton key={1} onClick={handleOpenUsersRoute} children={t('Add_users')} primary />]}
20-
data-qa-id='homepage-add-users-card'
2120
width='x340'
2221
{...props}
2322
/>

apps/meteor/client/views/home/cards/CreateChannelsCard.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ const CreateChannelsCard = (props: Omit<ComponentProps<typeof Card>, 'type'>): R
1616
title={t('Create_channels')}
1717
body={t('Create_a_public_channel_that_new_workspace_members_can_join')}
1818
buttons={[<GenericCardButton key={1} onClick={openCreateChannelModal} children={t('Create_channel')} />]}
19-
data-qa-id='homepage-create-channels-card'
2019
width='x340'
2120
{...props}
2221
/>

apps/meteor/client/views/home/cards/CustomContentCard.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { Box, Button, Card, CardBody, CardControls, CardHeader, Icon, Tag } from '@rocket.chat/fuselage';
2-
import { useRole, useSettingSetValue, useSetting, useToastMessageDispatch, useTranslation, useRouter } from '@rocket.chat/ui-contexts';
2+
import { useRole, useSettingSetValue, useSetting, useToastMessageDispatch, useRouter } from '@rocket.chat/ui-contexts';
33
import type { ComponentProps, ReactElement } from 'react';
4+
import { useTranslation } from 'react-i18next';
45

56
import { useIsEnterprise } from '../../../hooks/useIsEnterprise';
67
import CustomHomepageContent from '../CustomHomePageContent';
78

89
const CustomContentCard = (props: Omit<ComponentProps<typeof Card>, 'type'>): ReactElement | null => {
9-
const t = useTranslation();
10+
const { t } = useTranslation();
1011
const dispatchToastMessage = useToastMessageDispatch();
1112
const router = useRouter();
1213

@@ -50,7 +51,7 @@ const CustomContentCard = (props: Omit<ComponentProps<typeof Card>, 'type'>): Re
5051

5152
if (isAdmin) {
5253
return (
53-
<Card data-qa-id='homepage-custom-card' {...props}>
54+
<Card role='region' aria-label={t('Custom_content', 'Custom content')} {...props}>
5455
<CardHeader>
5556
<Tag>
5657
<Icon mie={4} name={willNotShowCustomContent ? 'eye-off' : 'eye'} size='x12' />

apps/meteor/client/views/home/cards/DesktopAppsCard.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ const DesktopAppsCard = (props: Omit<ComponentProps<typeof Card>, 'type'>): Reac
2424
<GenericCardButton key={3} onClick={() => handleOpenLink(MAC_APP_URL)} children={t('Platform_Mac')} role='link' />,
2525
]}
2626
width='x340'
27-
data-qa-id='homepage-desktop-apps-card'
2827
{...props}
2928
/>
3029
);

apps/meteor/client/views/home/cards/DocumentationCard.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const DocumentationCard = (props: Omit<ComponentProps<typeof Card>, 'type'>): Re
1717
title={t('Documentation')}
1818
body={t('Learn_how_to_unlock_the_myriad_possibilities_of_rocket_chat')}
1919
buttons={[<GenericCardButton key={1} onClick={() => handleOpenLink(DOCS_URL)} children={t('See_documentation')} role='link' />]}
20-
data-qa-id='homepage-documentation-card'
2120
width='x340'
2221
{...props}
2322
/>

apps/meteor/client/views/home/cards/JoinRoomsCard.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const JoinRoomsCard = (props: Omit<ComponentProps<typeof Card>, 'type'>): ReactE
1717
title={t('Join_rooms')}
1818
body={t('Discover_public_channels_and_teams_in_the_workspace_directory')}
1919
buttons={[<GenericCardButton key={1} onClick={handleDirectory} children={t('Open_directory')} />]}
20-
data-qa-id='homepage-join-rooms-card'
2120
width='x340'
2221
{...props}
2322
/>

apps/meteor/client/views/home/cards/MobileAppsCard.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const MobileAppsCard = (props: Omit<ComponentProps<typeof Card>, 'type'>): React
2121
<GenericCardButton key={1} onClick={() => handleOpenLink(GOOGLE_PLAY_URL)} children={t('Google_Play')} role='link' />,
2222
<GenericCardButton key={2} onClick={() => handleOpenLink(APP_STORE_URL)} children={t('App_Store')} role='link' />,
2323
]}
24-
data-qa-id='homepage-mobile-apps-card'
2524
width='x340'
2625
{...props}
2726
/>

apps/meteor/tests/e2e/homepage.spec.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import { IS_EE } from './config/constants';
44
import { Users } from './fixtures/userStates';
55
import { expect, test } from './utils/test';
66

7-
const CardIds = {
8-
Users: 'homepage-add-users-card',
9-
Chan: 'homepage-create-channels-card',
10-
Rooms: 'homepage-join-rooms-card',
11-
Mobile: 'homepage-mobile-apps-card',
12-
Desktop: 'homepage-desktop-apps-card',
13-
Docs: 'homepage-documentation-card',
14-
Custom: 'homepage-custom-card',
7+
const CardNames = {
8+
Users: 'Add users',
9+
Chan: 'Create channels',
10+
Rooms: 'Join rooms',
11+
Mobile: 'Mobile apps',
12+
Desktop: 'Desktop apps',
13+
Docs: 'Documentation',
14+
Custom: 'Custom content',
1515
};
1616
test.use({ storageState: Users.admin.state });
1717

@@ -38,7 +38,7 @@ test.describe.serial('homepage', () => {
3838
});
3939

4040
await test.step('expect all cards to be visible', async () => {
41-
await Promise.all(Object.values(CardIds).map((id) => expect(adminPage.locator(`[data-qa-id="${id}"]`)).toBeVisible()));
41+
await Promise.all(Object.values(CardNames).map((name) => expect(adminPage.getByRole('region', { name })).toBeVisible()));
4242
});
4343
});
4444

@@ -107,7 +107,7 @@ test.describe.serial('homepage', () => {
107107
});
108108

109109
test.describe('for regular users', () => {
110-
const notVisibleCards = [CardIds.Users, CardIds.Custom];
110+
const notVisibleCards = [CardNames.Users, CardNames.Custom];
111111

112112
test.beforeAll(async ({ api, browser }) => {
113113
expect((await api.post('/settings/Layout_Home_Body', { value: '' })).status()).toBe(200);
@@ -126,14 +126,14 @@ test.describe.serial('homepage', () => {
126126
});
127127

128128
await test.step(`expect ${notVisibleCards.join(' and ')} cards to not be visible`, async () => {
129-
await Promise.all(notVisibleCards.map((id) => expect(regularUserPage.locator(`[data-qa-id="${id}"]`)).not.toBeVisible()));
129+
await Promise.all(notVisibleCards.map((name) => expect(regularUserPage.getByRole('region', { name })).not.toBeVisible()));
130130
});
131131

132132
await test.step('expect all other cards to be visible', async () => {
133133
await Promise.all(
134-
Object.values(CardIds)
135-
.filter((id) => !notVisibleCards.includes(id))
136-
.map((id) => expect(regularUserPage.locator(`[data-qa-id="${id}"]`)).toBeVisible()),
134+
Object.values(CardNames)
135+
.filter((name) => !notVisibleCards.includes(name))
136+
.map((name) => expect(regularUserPage.getByRole('region', { name })).toBeVisible()),
137137
);
138138
});
139139

apps/meteor/tests/e2e/settings-int.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ test.describe.serial('settings-int', () => {
1414

1515
await pageTitle.waitFor();
1616
await expect(pageTitle).toBeVisible();
17-
await expect(pageTitle).toHaveText('Message');
1817
});
1918

2019
test('expect not being able to set int value as empty string', async ({ page }) => {

packages/i18n/src/locales/en.i18n.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,6 +1626,7 @@
16261626
"Custom_User_Status_Info": "Custom User Status Info",
16271627
"Custom_User_Status_Updated_Successfully": "Custom User Status Updated Successfully",
16281628
"Custom_agent": "Custom agent",
1629+
"Custom_content": "Custom content",
16291630
"Custom_dates": "Custom Dates",
16301631
"Custom_oauth_helper": "When setting up your OAuth Provider, you'll have to inform a Callback URL. Use <pre>%s</pre> .",
16311632
"Custom_roles": "Custom roles",

0 commit comments

Comments
 (0)