Back to all reviewers

Follow library recommendations

mui/material-ui
Based on 2 comments
TypeScript

When writing tests, prioritize following the official recommendations and best practices of testing libraries (like Playwright) even if they appear more verbose than alternatives. Library recommendations typically address edge cases, improve reliability, and future-proof your tests.

Testing TypeScript

Reviewer Prompt

When writing tests, prioritize following the official recommendations and best practices of testing libraries (like Playwright) even if they appear more verbose than alternatives. Library recommendations typically address edge cases, improve reliability, and future-proof your tests.

For example, prefer:

// Recommended approach
const errorSelector = page.locator('.MuiInputBase-root.Mui-error');
await errorSelector.waitFor();

Instead of:

// Discouraged approach
await page.waitForSelector('.MuiInputBase-root.Mui-error');

This applies to all testing libraries and frameworks. While deprecated or discouraged methods might sometimes appear cleaner or more straightforward, the recommended approaches usually incorporate lessons learned from the wider community and prevent subtle issues from arising in different environments or future versions.

2
Comments Analyzed
TypeScript
Primary Language
Testing
Category

Source Discussions