All files / src/Onboarding/CarouselDots/CarouselDot CarouselDot.js

80% Statements 4/5
66.66% Branches 4/6
50% Functions 1/2
80% Lines 4/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34                      13x           13x                   3x 3x          
import React from 'react';
 
/* Props */
import { propTypes } from './props/propTypes.js';
import { defaultProps } from './props/defaultProps.js';
 
/* Style */
import style from './css/CarouselDot.module.css';
 
 
function CarouselDot(props) {
    const {onClick, isActive, index, isAnimationPaused,testId,customId} = props;
 
    function handleClick() {       
       typeof onClick === "function" && onClick(index);
    }
 
    return (
        <div
            className={`${style.bullet} ${isAnimationPaused ? style.animationPaused : ''} ${isActive ? style.bulletActive: style.bulletNormal}`}
            onClick={handleClick}
            data-id={customId}
            data-test-id={testId}
        />
    );
}
 
CarouselDot.propTypes = propTypes;
CarouselDot.defaultProps = defaultProps;
 
 
 
export default CarouselDot