mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(a11y): input not having associated label on MS trophy page (#52179)
This commit is contained in:
@@ -420,7 +420,6 @@ class ShowExam extends Component<ShowExamProps, ShowExamState> {
|
||||
({ answer, id }) => (
|
||||
<label className='exam-answer-label' key={id}>
|
||||
<input
|
||||
aria-label={t('aria.answer')}
|
||||
checked={
|
||||
userExamQuestions[currentQuestionIndex].answer
|
||||
.id === id
|
||||
|
||||
@@ -151,10 +151,11 @@ function LinkMsUser({
|
||||
<Spacer size='medium' />
|
||||
<form onSubmit={handleLinkUsername}>
|
||||
<FormGroup validationState={isValid ? 'success' : 'error'}>
|
||||
<ControlLabel>
|
||||
<ControlLabel htmlFor='transcript-link'>
|
||||
<strong>{t('learn.ms.transcript-label')}</strong>
|
||||
</ControlLabel>
|
||||
<FormControl
|
||||
id='transcript-link'
|
||||
type='url'
|
||||
onChange={handleInputChange}
|
||||
placeholder='https://learn.microsoft.com/en-us/users/username/transcript/transcriptId'
|
||||
|
||||
@@ -64,5 +64,14 @@ test.describe('Link MS user component (unlinked signedIn user)', () => {
|
||||
const linkText6 = page.getByTestId('link-li-6-text');
|
||||
await expect(linkText6).toBeVisible();
|
||||
await expect(linkText6).toHaveText(translations.learn.ms['link-li-6']);
|
||||
|
||||
const transcriptLinkInput = page.getByLabel(
|
||||
translations.learn.ms['transcript-label']
|
||||
);
|
||||
await expect(transcriptLinkInput).toBeVisible();
|
||||
await expect(transcriptLinkInput).toHaveAttribute(
|
||||
'placeholder',
|
||||
'https://learn.microsoft.com/en-us/users/username/transcript/transcriptId'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user