refactor(tests): use getByRole instead of getByText for interactive elements

- Refactor ~47 test cases across 7 test files to use getByRole
- Improve accessibility testing coverage following Testing Library best practices
- Make tests more robust against text changes (i18n, copy updates)
- Test elements as users (especially screen readers) interact with them
This commit is contained in:
lenhanphung
2025-10-16 15:00:58 +07:00
committed by Benoit TELLIER
parent 4c18bf3a52
commit b9905cbb7a
7 changed files with 52 additions and 46 deletions
+1 -1
View File
@@ -103,7 +103,7 @@ async function setupEventPopover(
fireEvent.change(titleInput, { target: { value: "Meeting" } });
// Click More options to expand the dialog
const showMoreButton = screen.getByText("More options");
const showMoreButton = screen.getByRole("button", { name: /More options/i });
fireEvent.click(showMoreButton);
// Check Repeat checkbox to show repeat options