fleet/frontend/components/packs/PacksList/Row/Row.tests.jsx
Mike Stone 4ba3ad51f0 All packs page (#709)
* Display packs page at /packs/manage

* Adds NumberPill component

* Filter packs list

* Render the pack info side panel when no packs are selected

* Adds packs list

* Moves state management to page component

* Display selected pack count

* Render bulk action buttons

* API client - update pack

* API client - destroy pack

* Adds update/destroy functions to packs redux config

* Bulk actions (enable, disable, delete)

* Selecting a pack updates state

* PackDetailsSidePanel updates pack status

* Link to edit pack on side panel

* sets selected pack in URL

* Sets color for unsettled buttons

* Loads scheduled queries for selected pack in All Packs Page

* PackDetailsSidePanel component

* PackDetailsSidePanel styles

* styles PacksList component

* Stop rendering flash when pack status is updated

* Makes full row clickable

* highlight selected pack
2017-01-03 15:56:50 -05:00

24 lines
711 B
JavaScript

import React from 'react';
import expect, { createSpy, restoreSpies } from 'expect';
import { mount } from 'enzyme';
import Row from 'components/packs/PacksList/Row';
import { packStub } from 'test/stubs';
describe('PacksList - Row - component', () => {
afterEach(restoreSpies);
it('renders', () => {
expect(mount(<Row pack={packStub} />).length).toEqual(1);
});
it('calls the onCheck prop with the value and pack id when checked', () => {
const spy = createSpy();
const component = mount(<Row checked onCheck={spy} pack={packStub} />);
component.find({ name: `select-pack-${packStub.id}` }).simulate('change');
expect(spy).toHaveBeenCalledWith(false, packStub.id);
});
});