tests(register-component): update tests to use test-id for submit button
This commit is contained in:
+6
-2
@@ -41,7 +41,9 @@ describe('RegisterComponentForm', () => {
|
||||
),
|
||||
).toBeInTheDocument();
|
||||
|
||||
const submit = (await rendered.getByRole('button')) as HTMLButtonElement;
|
||||
const submit = (await rendered.getByTestId(
|
||||
'registerComponentFormSubmit',
|
||||
)) as HTMLButtonElement;
|
||||
expect(submit.disabled).toBeTruthy();
|
||||
});
|
||||
|
||||
@@ -54,7 +56,9 @@ describe('RegisterComponentForm', () => {
|
||||
target: { value: 'https://example.com/blob/master/component.yaml' },
|
||||
});
|
||||
});
|
||||
const submit = (await rendered.getByRole('button')) as HTMLButtonElement;
|
||||
const submit = (await rendered.getByTestId(
|
||||
'registerComponentFormSubmit',
|
||||
)) as HTMLButtonElement;
|
||||
|
||||
expect(submit.disabled).toBeFalsy();
|
||||
});
|
||||
|
||||
+1
@@ -113,6 +113,7 @@ const RegisterComponentForm: FC<Props> = ({ onSubmit, submitting }) => {
|
||||
</FormControl>
|
||||
<Button
|
||||
id="registerComponentFormSubmit"
|
||||
data-testid="registerComponentFormSubmit"
|
||||
variant="contained"
|
||||
color="primary"
|
||||
type="submit"
|
||||
|
||||
Reference in New Issue
Block a user