mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
* 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
24 lines
711 B
JavaScript
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);
|
|
});
|
|
});
|
|
|