Skip to content
Snippets Groups Projects
EstimatedConsumptionModal.spec.tsx 598 B
Newer Older
  • Learn to ignore specific revisions
  • import { mount } from 'enzyme'
    
    import toJson from 'enzyme-to-json'
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
    import React from 'react'
    
    import EstimatedConsumptionModal from './EstimatedConsumptionModal'
    
    
    const mockGetAllLastPrices = jest.fn()
    jest.mock('services/fluidsPrices.service', () => {
    
      return jest.fn(() => ({
        getAllLastPrices: mockGetAllLastPrices,
      }))
    
    describe('EstimatedConsumptionModal component', () => {
    
      it('should render correctly', async () => {
    
    Bastien DUMONT's avatar
    Bastien DUMONT committed
          <EstimatedConsumptionModal open={true} handleCloseClick={jest.fn()} />
    
        expect(toJson(wrapper)).toMatchSnapshot()