Q. What are service stubs / mocks, and why use them in form testing?
A: Service stubs are simple ES6 classes implementing the same methods (and return types) as a real service, but returning mock data or controlled behavior. They are used to avoid making real HTTP calls or external dependencies during unit tests — ensuring tests are fast, deterministic, and focused on form and component logic.
Q. What kind of validations are covered?
A: The post covers email validations, maximum characters for text fields, numeric field bounds, date bounds, and patterns (regex), as well as tests for enabling/disabling buttons depending on form validity.
Q. Why is form-testing important?
A: Because forms are often where user input, validation logic, asynchronous behavior (e.g., debouncing or reactive forms), and user interaction come together — mistakes here can lead to bugs, security issues (e.g. XSS, SQL injection), or bad UX. Effective testing ensures validations, button states, and reactive behavior work as intended.
Q. Can Redux be combined with other state management libraries?
A: Yes, it can work alongside Context API, Zustand, or React Query depending on project needs.
Q. What are the key concepts of Redux (actions, reducers, store)?
A: Actions describe events, reducers handle state updates, and the store holds the application state.
Q. Is Redux still relevant in modern React development?
A: Yes. Despite newer libraries, Redux remains popular for large applications needing strict state management.
Q. How does Redux differ from React’s built-in Context API?
A: Redux is more powerful for large apps with complex state, while Context is better for small or medium use cases.
Q. Why use Redux for state management in React?
A: Redux provides a single source of truth, making complex state predictable and easier to debug.
Q. Is NgRx suitable for small-scale Angular projects?
A: It can be, but for simple projects, Angular services or signals might be enough.
Q. What are common challenges in implementing NgRx?
A: The learning curve, boilerplate code, and over-engineering for small projects.