Posts

Showing posts with the label redux testing

Testing redux store connected React Components using Jest and Enzyme | TDD | REACT | REACT NATIVE

Image
Hello everyone , in this tutorial we are going to learn at how we can test Redux-Connected components using React / React Native Here is an example of Redux connected component  SlotContainer.js : import React, { Component } from 'react' import { SlotContainerStyles } from '../styles/AppStyle' import Slot from './Slot' import ControlButton from './ControlButton' import {connect} from 'react-redux' import {setUserInteraction,setSlotRunningStatus} from '../../action' import ResultWindow from './ResultWindow' class SlotContainer extends Component { constructor(props) { super (props) this .state = { startSlot : false , } this .timer = null } componentDidMount(){ this .props.setSlotRunningStatus( false ) this .props.setUserInteraction( false ) } updateUserInteraction = (flag) => { } resetSlotMachine = () =>{ } s...