Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Romain Gaillard
Added: Oct 6, 2021 12:06 PM
Views: 268
Tags: component tu
  1. import { render } from '@testing-library/react';
  2. import React from 'react';
  3.  
  4. import FreeShipping from '../index';
  5.  
  6. describe('FreeShipping', () => {
  7.   test('with FreeShipping', () => {
  8.     const { baseElement } = render(<FreeShipping freeShippingMessage="Livraison gratuite" />);
  9.     expect(baseElement).toMatchSnapshot();
  10.   });
  11.  
  12.   test('without FreeShipping', () => {
  13.     const { baseElement } = render(<FreeShipping />);
  14.     expect(baseElement).toMatchSnapshot();
  15.   });
  16.  
  17.   test('with minimalBuy for FreeShipping', () => {
  18.     const { baseElement } = render(<FreeShipping freeShippingMessage="Livraison gratuite à partir de 25€" />);
  19.     expect(baseElement).toMatchSnapshot();
  20.   });
  21. });
  22.