Material UI is an open-source React component library that implements Google’s Material Design.
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. ...