Skip to content

Commit d5425f1

Browse files
committed
add data-testid selector to VerboseHelperText
1 parent 13d29c4 commit d5425f1

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

e2e/generatorForm.playwright.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,11 @@ test.describe("Generator page functionality", () => {
284284

285285
// Expect clientId error state to have remained.
286286
expect(
287-
await page.locator(`.MuiFormHelperText-root.Mui-error`).count()
287+
await page.locator(`[data-testid=VerboseHelperText].Mui-error`).count()
288288
).toBe(1);
289-
const errorDescriptions = page.locator(`.MuiFormHelperText-root.Mui-error`);
289+
const errorDescriptions = page.locator(
290+
`[data-testid=VerboseHelperText].Mui-error`
291+
);
290292
await expect(errorDescriptions).toHaveText(
291293
/The given URI field is not present./
292294
);

src/components/VerboseHelperText.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ export default function VerboseHelperText({
2929
state: VerboseFieldState | undefined;
3030
}) {
3131
return state ? (
32-
<FormHelperText className={`Mui-${state.statusValue}`} sx={statusColors}>
32+
<FormHelperText
33+
className={`Mui-${state.statusValue}`}
34+
data-testid="VerboseHelperText"
35+
sx={statusColors}
36+
>
3337
{state.statusDescription}
3438
</FormHelperText>
3539
) : (

0 commit comments

Comments
 (0)