Skip to content

Commit

Permalink
refactor BodyWrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
priley86 committed Mar 27, 2019
1 parent 3bd0e40 commit 8994fe2
Show file tree
Hide file tree
Showing 9 changed files with 100,763 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('Editable table', () => {
container.unmount();
});

test.skip('should call correct function', () => {
test('should call correct function', () => {
const ComposedBody = editableTableBody(TableBody);
const ComposedRowWrapper = editableRowWrapper(RowWrapper);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { rows, columns, actions } from '../../test-helpers/data-sets';
import MockedTable from '../../test-helpers/MockedTableChanges';

describe('Collapsible table', () => {
test.skip('should call correct function', () => {
test('should call correct function', () => {
const items = [...rows];
items[0].isOpen = false;
items[1].parent = 0;
Expand All @@ -25,7 +25,7 @@ describe('Collapsible table', () => {
});

describe('Selectable table', () => {
test.skip('should call correct function', () => {
test('should call correct function', () => {
const onSelect = jest.fn();
const view = mount(
<Table caption="Collapsible table" onSelect={onSelect} cells={columns} rows={rows}>
Expand All @@ -42,7 +42,7 @@ describe('Selectable table', () => {
});

describe('Action table', () => {
test.skip('should call correct functions', () => {
test('should call correct functions', () => {
const actionResolver = jest.fn();
const areActionsDisabled = jest.fn();
mount(
Expand All @@ -64,7 +64,7 @@ describe('Action table', () => {
expect(areActionsDisabled.mock.calls).toHaveLength(numberOfRenders);
});

test.skip('should call action callback', () => {
test('should call action callback', () => {
const onActionClick = jest.fn();
const customActions = [
{
Expand Down Expand Up @@ -98,7 +98,7 @@ describe('Action table', () => {
});

describe('Sortable table', () => {
test.skip('should call correct function', () => {
test('should call correct function', () => {
const onSort = jest.fn();
const sortBy = {};
const header = [...columns];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class Table extends React.Component {
{...props}
renderers={{
body: {
wrapper: bodyWrapper(rows) || BodyWrapper,
wrapper: bodyWrapper || BodyWrapper,
row: rowWrapper || RowWrapper,
cell: BodyCell
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import { rows, columns, actions } from '../../test-helpers/data-sets';

describe('Simple table', () => {
test.skip('caption', () => {
test('caption', () => {
const view = mount(
<Table caption="Simple Table" cells={columns} rows={rows}>
<TableHeader />
Expand All @@ -24,7 +24,7 @@ describe('Simple table', () => {
expect(view).toMatchSnapshot();
});

test.skip('header', () => {
test('header', () => {
const view = mount(
<Table header={<h4>Header title</h4>} cells={columns} rows={rows}>
<TableHeader />
Expand All @@ -33,7 +33,7 @@ describe('Simple table', () => {
);
expect(view).toMatchSnapshot();
});
test.skip('aria-label', () => {
test('aria-label', () => {
const view = mount(
<Table aria-label="Aria labeled" cells={columns} rows={rows}>
<TableHeader />
Expand All @@ -44,7 +44,7 @@ describe('Simple table', () => {
});
});

test.skip('Sortable table', () => {
test('Sortable table', () => {
const onSortCall = () => undefined;
columns[0] = { ...columns[0], transforms: [sortable] };
const view = mount(
Expand All @@ -58,7 +58,7 @@ test.skip('Sortable table', () => {

describe('Table variants', () => {
Object.values(TableGridBreakpoint).forEach(oneBreakpoint => {
test.skip(`Breakpoint - ${oneBreakpoint}`, () => {
test(`Breakpoint - ${oneBreakpoint}`, () => {
const view = mount(
<Table aria-label="Aria labeled" gridBreakPoint={oneBreakpoint} cells={columns} rows={rows}>
<TableHeader />
Expand All @@ -69,7 +69,7 @@ describe('Table variants', () => {
});
});
Object.values(TableVariant).forEach(onevariant => {
test.skip(`Size - ${onevariant}`, () => {
test(`Size - ${onevariant}`, () => {
const view = mount(
<Table aria-label="Aria labeled" variant={onevariant} cells={columns} rows={rows}>
<TableHeader />
Expand All @@ -81,7 +81,7 @@ describe('Table variants', () => {
});
});

test.skip('Simple Actions table', () => {
test('Simple Actions table', () => {
const rowsWithDisabledAction = [
...rows,
{
Expand All @@ -99,7 +99,7 @@ test.skip('Simple Actions table', () => {
expect(view).toMatchSnapshot();
});

test.skip('Actions table', () => {
test('Actions table', () => {
const view = mount(
<Table
aria-label="Aria labeled"
Expand All @@ -115,7 +115,7 @@ test.skip('Actions table', () => {
expect(view).toMatchSnapshot();
});

test.skip('Cell header table', () => {
test('Cell header table', () => {
columns[0] = { ...columns[0], cellTransforms: [headerCol] };
const view = mount(
<Table aria-label="Aria labeled" cells={columns} rows={rows}>
Expand All @@ -126,7 +126,7 @@ test.skip('Cell header table', () => {
expect(view).toMatchSnapshot();
});

test.skip('Collapsible table', () => {
test('Collapsible table', () => {
rows[0] = { ...rows[0], isOpen: true };
rows[1] = { ...rows[1], parent: 0 };
rows[3] = { ...rows[3], isOpen: false };
Expand All @@ -142,7 +142,7 @@ test.skip('Collapsible table', () => {
expect(view).toMatchSnapshot();
});

test.skip('Collapsible nested table', () => {
test('Collapsible nested table', () => {
rows[0] = { ...rows[0], isOpen: false };
rows[1] = { ...rows[1], parent: 0, isOpen: true };
rows[2] = { ...rows[2], parent: 1 };
Expand All @@ -156,7 +156,7 @@ test.skip('Collapsible nested table', () => {
expect(view).toMatchSnapshot();
});

test.skip('Selectable table', () => {
test('Selectable table', () => {
const onSelect = () => undefined;
const view = mount(
<Table aria-label="Aria labeled" onSelect={onSelect} cells={columns} rows={rows}>
Expand All @@ -167,7 +167,7 @@ test.skip('Selectable table', () => {
expect(view).toMatchSnapshot();
});

test.skip('Header width table', () => {
test('Header width table', () => {
columns[0] = { ...columns[0], transforms: [cellWidth(10)] };
columns[2] = { ...columns[2], transforms: [cellWidth(30)] };
columns[4] = { ...columns[4], transforms: [cellWidth('max')] };
Expand All @@ -180,7 +180,7 @@ test.skip('Header width table', () => {
expect(view).toMatchSnapshot();
});

test.skip('Selectable table with selected expandable row', () => {
test('Selectable table with selected expandable row', () => {
const data = {
cells: ['column'],
rows: [
Expand Down
Loading

0 comments on commit 8994fe2

Please sign in to comment.