Testing Library is a simple and complete testing utilities that encourage good testing practices.
Test the Presence of a Material UI Icon in Jest/Vitest
Testing the presence of a Material UI Icon in Jest/Vitest can be done by using the Testing Library. First, in the production code, assign a titleAccess attribute to the icon. For example, if the icon of interest is AddIcon, the code would look like: <AddIcon titleAccess="My Add Icon" /> This attribute would also surface to the user interface. ...