diff --git a/src/app/examples/04-forms-with-material.spec.ts b/src/app/examples/04-forms-with-material.spec.ts
index fb01eefe..7c7b8a91 100644
--- a/src/app/examples/04-forms-with-material.spec.ts
+++ b/src/app/examples/04-forms-with-material.spec.ts
@@ -9,9 +9,9 @@ test('is possible to fill in a form and verify error messages (with the help of
imports: [ReactiveFormsModule, MaterialModule],
});
- const nameControl = screen.getByPlaceholderText('Name');
- const scoreControl = screen.getByPlaceholderText(/score/i);
- const colorControl = screen.getByPlaceholderText('color', { exact: false });
+ const nameControl = screen.getByLabelText(/name/i);
+ const scoreControl = screen.getByRole('spinbutton', { name: /score/i });
+ const colorControl = screen.getByRole('listbox', { name: /color/i });
const errors = screen.getByRole('alert');
expect(errors).toContainElement(screen.queryByText('name is required'));
@@ -35,7 +35,7 @@ test('is possible to fill in a form and verify error messages (with the help of
expect(nameControl).toHaveValue('Tim');
expect(scoreControl).toHaveValue(7);
- const form = screen.getByTestId('my-form');
+ const form = screen.getByRole('form');
expect(form).toHaveFormValues({
name: 'Tim',
score: 7,
diff --git a/src/app/examples/04-forms-with-material.ts b/src/app/examples/04-forms-with-material.ts
index 5b6aa38e..18d4925c 100644
--- a/src/app/examples/04-forms-with-material.ts
+++ b/src/app/examples/04-forms-with-material.ts
@@ -4,7 +4,7 @@ import { FormBuilder, Validators, ReactiveFormsModule, ValidationErrors } from '
@Component({
selector: 'app-fixture',
template: `
-