Sha256: 75d4e8ae7032890f294602d38bdee99541d9dcb1dd220a19633270f4f929b159
Contents?: true
Size: 887 Bytes
Versions: 21
Compression:
Stored size: 887 Bytes
Contents
import React from 'react'; import { shallow } from 'enzyme'; import toJson from 'enzyme-to-json'; import ProfileRpmCellFormatter from '../ProfileRpmsCellFormatter'; import { details } from '../../__tests__/moduleStreamDetails.fixtures'; jest.mock('../../../../../move_to_foreman/foreman_toast_notifications'); describe('ProfileRpmCellFormatter', () => { it('should render and expand on click', () => { // eslint-disable-next-line prefer-destructuring const rpms = details.profiles[0].rpms; const wrapper = shallow(<ProfileRpmCellFormatter rpms={rpms} />); expect(toJson(wrapper)).toMatchSnapshot(); expect(wrapper.state('expanded')).toBeFalsy(); expect(wrapper.state('showAmount')).toBe(10); wrapper.instance().onClick(); expect(wrapper.state('expanded')).toBeTruthy(); expect(wrapper.state('showAmount')).toBe(rpms.length); }); });
Version data entries
21 entries across 21 versions & 1 rubygems