Introduction to User-Centric UI Testing with React Testing Library

The React Testing Library, part of the @testing-library family, facilitates user-centric UI component testing. It emphasizes queries, event handling, user interaction, asynchronous actions, and debugging. With clear naming patterns for queries and methods like fireEvent and userEvent, it aligns testing with real user behavior. The waitFor method is useful for handling asynchronous actions.

Strategies for react directory structures

React Directory Structure There are several strategies when talking about structuring the codebase of a React application. Two common ones are: Group by file type (our current strategy) Group by feature Group by File Type This type of structure groups files based on their type and function. For example, all components are grouped together, all … Continue reading Strategies for react directory structures

Getting Started with Functional Components in Codesandbox

1. Getting started 1.1 Fork the starter app The first step is to fork the starter application on Codesandbox. The starter has all the packages we will need already added and configured. Make sure you are signed into Codesandbox and go to the following URL: https://codesandbox.io/s/functional-components-intro-starter-3ivou?file=/src/App.js Click on the Fork button in the upper right … Continue reading Getting Started with Functional Components in Codesandbox

Useful Javascript Info everyone should know

Template literals ES6 introduced template literals which are similar to strings only surrounded with backticks instead of quotes. They allow embedded expressions within. Use ${} to interpolate expressions or values into a string. const name = 'Jonathan'; const greeting = `Hello ${name}`; const dontDoThis = 'Hello' + ' ' + name; console.log(greeting); > Hello Jonathan … Continue reading Useful Javascript Info everyone should know