
Clone the ecommerce repository and learn to test a real react app with api-driven products, cart, checkout, and order flows for professional engineers.
Clone the repository, install dependencies, and follow the master scaffold to complete hands-on test cases, then switch to final, Pattu, and patcher branches to view solutions and continue with assignments.
Mount a custom checkbox component with ReactDOM into a container, pass appropriate props, and verify the label and checkbox input exist using container queries and assertions.
Learn to test a checkbox with the react testing library by rendering the component, using get by label text for accessible labels, and validating the element in the document.
Learn to fire native events on elements with a testing library, simulating checkbox clicks and validating the on change handler is called.
Learn how to test checked and unchecked checkbox states in React by mounting the component, spreading default props, and passing custom props to verify true or false.
Learn to automate accessibility testing for react components by validating labels linked with inputs and images, using an accessibility library to detect violations and guide fixes.
Learn to find elements in React tests using getByText and getByAltText, ensuring the product name, price, and image alt text render correctly.
Learn how to test for the absence of an image using query, ensuring no rendering, and differentiate from get or find for presence using a test id.
Wrap the header in a context provider to supply the toggle value, render the header in tests, and verify clicking the future button calls the context toggle method.
Test array rendering elements by mounting a product stream that maps over dummy products array, uses a test id, and asserts get all by test returns elements matching default products.
Test the parent component that renders children by verifying it provides the context values to the future context provider and renders its children.
Test context provider values by consuming the context, rendering with wrappers, and simulating user interactions to verify that injected state toggles user interface elements correctly.
Test the toggle scroll behaviour by clicking the future button to freeze and unfreeze the body scroll, asserting the overflow switches between hidden and visible.
Test the use filters hook by mounting a context provider with a known value, rendering a component that uses the hook, and asserting the value matches the provided context.
Test the use outside click hook by mounting a panel component that uses it. Simulate inside and outside clicks and verify the callback toggles panel visibility.
Explore testing hook cleanup by simulating mounting and unmounting a panel, toggling visibility, and spying on document.removeEventListener to verify cleanup occurs after unmount.
Conduct an integration test that mounts the app with the store and providers, mocks the API fetch for products, and verifies two product tiles render from the mocked data.
Learn to generate robust test data for React applications using the test-data-bot library. Build products with fake id, name, image, lorem text, and prices to keep tests flexible and reliable.
Demonstrates integrating tests for an off-canvas search panel, validating open and close flows and element presence using get by text and query by text.
Test product search functionality in a React app by mounting the component, typing in the search box with a debounce, and validating debounced API calls and item updates.
Learn to test drive and react in a practical workflow, review final and previous source code, and use lesson-specific change links to follow updates.
Learn to test router dependent header components with a memory router by providing location and Redux contexts, and update mocks to handle three API calls for stable tests.
Test a component with the use location hook by mounting it in a memory router with initial entries and initial index to simulate the home page and verify future button.
Test a react app feature that navigates from a product list to a single product page by mocking API responses, validating the loaded product details and page navigation.
Test add product to cart by mounting the product detail page, mocking get and post API endpoints, and validating the top cart count, removal, and product details rendering.
Test the checkout flow in a React app by mocking API endpoints, simulating Stripe token creation from card input, and posting to the backend, then verify redirect to the homepage.
Hi ! I' m Kati Frantz , and I've built tons and tons of React applications. Everyone can ship software, but shipping quality software requires a lot of quality assurance and best practices. A professional ships confident, well tested, and stable code.
This is the standard, but testing react applications can be painful and complex. What are the best practices ? What should I test ? How can I test a react router based, redux store connected stripe checkout form ???
Be glad you found this course, because this course will show you the best practices for testing components and full scale applications.
We'll be testing an e-commerce application ?? with Stripe Checkout. Here are some of the features we'll be testing:
Reusable checkboxes
External API powered products listing
Product tiles accessibility
Off canvas filter menu (with portals)
Prevent scroll on canvas open
Event listener cleanups
Debounced products search
Context dependent components
React router page navigation
Redux connected components and pages
Custom hooks
Checkout modal
Stripe checkout
By the end of this course, you'll be able to:
Implement a testing solution for any react application
Test components connected to state management stores
Test components that call external APIs
Test components that use other component packages
Test router connected components
Test components that use a huge range of design patterns such as render props and composition.
Test components with accessibility in mind.
And so much more ! Go ahead and enroll to the course and join me to learn techniques and strategies you can use in applications and job starting today!