EXPERIMENT-10
10a) Write unit tests for UI components Unit tests in UI components are automated tests that verify the smallest parts of the user interface—like individual widgets or components—work correctly in isolation. What are unit tests in UI components? Unit tests focus on testing one small piece of UI code at a time (e.g., a button, text label, or custom widget). They check that the UI component: Displays the right content (like correct text or images). Responds properly to user interactions (like taps or clicks). Changes appearance or behavior as expected when given different inputs or states. Unit tests do not involve testing the entire app or complex user flows; they focus on one component’s logic and rendering. Why are unit tests for UI components important? They help catch bugs early in development. Ensure UI behaves as intended with different data or user actions. Make it safer to refactor or improve code because you can quickly detect if something breaks. Improve code quality...