Skip to content

Commit af0600c

Browse files
test: Replace data-qa by accessible locators (#36757)
1 parent c805070 commit af0600c

File tree

46 files changed

+64
-174
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+64
-174
lines changed

apps/meteor/client/components/UserCard/UserCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const UserCard = ({
4949
const isLayoutEmbedded = useEmbeddedLayout();
5050

5151
return (
52-
<UserCardDialog data-qa='UserCard' {...props}>
52+
<UserCardDialog title={t('User_card')} {...props}>
5353
<div>
5454
{username && <UserAvatar username={username} etag={etag} size='x124' />}
5555
<Box flexGrow={0} display='flex' mbs={12} alignItems='center' justifyContent='center'>

apps/meteor/client/components/avatar/UserAvatarEditor/UserAvatarEditor.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function UserAvatarEditor({ currentUsername, username, setAvatarObj, name, disab
8080
size='x124'
8181
url={url}
8282
key={url}
83-
data-qa-id='UserAvatarEditor'
83+
alt={t('__username__profile_picture', { username: currentUsername || 'user' })}
8484
username={currentUsername || ''}
8585
etag={etag}
8686
style={{
@@ -102,15 +102,13 @@ function UserAvatarEditor({ currentUsername, username, setAvatarObj, name, disab
102102
title={t('Add_URL')}
103103
mi={4}
104104
onClick={handleAddUrl}
105-
data-qa-id='UserAvatarEditorSetAvatarLink'
106105
/>
107106
<UserAvatarSuggestions disabled={disabled} onSelectOne={handleSelectSuggestion} />
108107
</Box>
109108
<Label htmlFor={imageUrlField} mis={4}>
110109
{t('Use_url_for_avatar')}
111110
</Label>
112111
<TextInput
113-
data-qa-id='UserAvatarEditorLink'
114112
id={imageUrlField}
115113
flexGrow={0}
116114
placeholder={t('Use_url_for_avatar')}

apps/meteor/client/navbar/NavBarPagesGroup/actions/CreateChannelModal.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ const CreateChannelModal = ({ teamId = '', mainRoom, onClose, reload }: CreateCh
207207

208208
return (
209209
<Modal
210-
data-qa='create-channel-modal'
211210
aria-labelledby={`${createChannelFormId}-title`}
212211
wrapperFunction={(props: ComponentProps<typeof Box>) => (
213212
<Box is='form' id={createChannelFormId} onSubmit={handleSubmit(handleCreateChannel)} {...props} />
@@ -226,7 +225,6 @@ const CreateChannelModal = ({ teamId = '', mainRoom, onClose, reload }: CreateCh
226225
<FieldRow>
227226
<TextInput
228227
id={nameId}
229-
data-qa-type='channel-name-input'
230228
{...register('name', {
231229
required: t('Required_field', { field: t('Name') }),
232230
validate: (value) => validateChannelName(value),
@@ -248,7 +246,7 @@ const CreateChannelModal = ({ teamId = '', mainRoom, onClose, reload }: CreateCh
248246
<Field>
249247
<FieldLabel htmlFor={topicId}>{t('Topic')}</FieldLabel>
250248
<FieldRow>
251-
<TextInput id={topicId} aria-describedby={`${topicId}-hint`} {...register('topic')} data-qa-type='channel-topic-input' />
249+
<TextInput id={topicId} aria-describedby={`${topicId}-hint`} {...register('topic')} />
252250
</FieldRow>
253251
<FieldHint id={`${topicId}-hint`}>{t('Displayed_next_to_name')}</FieldHint>
254252
</Field>
@@ -407,7 +405,7 @@ const CreateChannelModal = ({ teamId = '', mainRoom, onClose, reload }: CreateCh
407405
<ModalFooter>
408406
<ModalFooterControllers>
409407
<Button onClick={onClose}>{t('Cancel')}</Button>
410-
<Button type='submit' primary data-qa-type='create-channel-confirm-button'>
408+
<Button type='submit' primary>
411409
{t('Create')}
412410
</Button>
413411
</ModalFooterControllers>

apps/meteor/client/navbar/NavBarPagesGroup/actions/CreateDirectMessage.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ const CreateDirectMessage = ({ onClose }: CreateDirectMessageProps) => {
6060
return (
6161
<Modal
6262
aria-labelledby={`${createDMFormId}-title`}
63-
data-qa='create-direct-modal'
6463
wrapperFunction={(props) => <Box is='form' onSubmit={handleSubmit(handleCreate)} {...props} />}
6564
>
6665
<ModalHeader>

apps/meteor/client/sidebar/RoomList/SidebarItemTemplateWithData.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ const SidebarItemTemplateWithData = ({
125125
<SidebarItemTemplate
126126
is='a'
127127
id={id}
128-
data-qa='sidebar-item'
129128
data-unread={highlighted}
130129
unread={highlighted}
131130
selected={selected}

apps/meteor/client/sidebar/RoomList/SidebarItemWithData.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ const SidebarItemWithData = ({ room, id, style, t, videoConfActions }: RoomListR
9292
return (
9393
<SidebarItem
9494
id={id}
95-
data-qa='sidebar-item'
9695
data-unread={highlighted}
9796
unread={highlighted}
9897
href={href}

apps/meteor/client/views/account/profile/AccountProfilePage.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,7 @@ const AccountProfilePage = (): ReactElement => {
139139
<Button disabled={!isDirty} onClick={() => reset(getProfileInitialValues(user))}>
140140
{t('Cancel')}
141141
</Button>
142-
<Button
143-
form={profileFormId}
144-
data-qa='AccountProfilePageSaveButton'
145-
primary
146-
disabled={!isDirty || loggingOut}
147-
loading={isSubmitting}
148-
type='submit'
149-
>
142+
<Button form={profileFormId} primary disabled={!isDirty || loggingOut} loading={isSubmitting} type='submit'>
150143
{t('Save_changes')}
151144
</Button>
152145
</ButtonGroup>

apps/meteor/client/views/account/security/ChangePassphrase.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,7 @@ export const ChangePassphrase = (): JSX.Element => {
196196
</Field>
197197
)}
198198
</FieldGroup>
199-
<Button
200-
primary
201-
disabled={!(keysExist && valid && isValid)}
202-
onClick={handleSubmit(handleSave)}
203-
mbs={12}
204-
data-qa-type='e2e-encryption-save-password-button'
205-
>
199+
<Button primary disabled={!(keysExist && valid && isValid)} onClick={handleSubmit(handleSave)} mbs={12}>
206200
{t('Save_changes')}
207201
</Button>
208202
</Box>

apps/meteor/client/views/account/security/ResetPassphrase.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ export const ResetPassphrase = (): JSX.Element => {
1414
<Box is='p' fontScale='p1' mbe={12}>
1515
{t('Reset_E2EE_password_description')}
1616
</Box>
17-
<Button onClick={() => resetE2EPassword.mutate()} data-qa-type='e2e-encryption-reset-key-button'>
18-
{t('Reset_E2EE_password')}
19-
</Button>
17+
<Button onClick={() => resetE2EPassword.mutate()}>{t('Reset_E2EE_password')}</Button>
2018
</>
2119
);
2220
};

apps/meteor/client/views/admin/engagementDashboard/EngagementDashboardCardErrorBoundary.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const EngagementDashboardCardErrorBoundary = ({ children }: EngagementDashboardC
3232
<StatesIcon name='circle-exclamation' />
3333
<StatesTitle>{t('Something_went_wrong')}</StatesTitle>
3434
<StatesSubtitle>{isError(error) && error?.message}</StatesSubtitle>
35-
<StatesActions data-qa='EngagementDashboardCardErrorBoundary'>
35+
<StatesActions>
3636
<StatesAction onClick={(): void => resetErrorBoundary()}>{t('Retry')}</StatesAction>
3737
</StatesActions>
3838
</States>

0 commit comments

Comments
 (0)