mirror of
https://github.com/ansible/awx.git
synced 2026-02-04 11:08:13 -03:30
convert OrganizationList to use PaginatedDataList (#192)
* convert Org list to use PaginatedDataList * add ToolbarAddButton, ToolbarDeleteButton * pass full org into OrganizationListItem
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '../../enzymeHelpers';
|
||||
import { ToolbarAddButton } from '../../../src/components/PaginatedDataList';
|
||||
|
||||
describe('<ToolbarAddButton />', () => {
|
||||
test('should render button', () => {
|
||||
const onClick = jest.fn();
|
||||
const wrapper = mountWithContexts(
|
||||
<ToolbarAddButton onClick={onClick} />
|
||||
);
|
||||
const button = wrapper.find('button');
|
||||
expect(button).toHaveLength(1);
|
||||
button.simulate('click');
|
||||
expect(onClick).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
test('should render link', () => {
|
||||
const wrapper = mountWithContexts(
|
||||
<ToolbarAddButton linkTo="/foo" />
|
||||
);
|
||||
const link = wrapper.find('Link');
|
||||
expect(link).toHaveLength(1);
|
||||
expect(link.prop('to')).toBe('/foo');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user