Skip to content

Commit

Permalink
fix(layout-grid): remove unit test console warnings (#379)
Browse files Browse the repository at this point in the history
add child elements to `Grid` and `Row` test wrappers
  • Loading branch information
hvolschenk authored and Matt Goo committed Oct 30, 2018
1 parent c7f3b97 commit 408cdd2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions test/unit/layout-grid/Grid.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@ import {Grid} from '../../../packages/layout-grid/index';
suite('LayoutGridGrid');

test('classNames adds classes', () => {
const wrapper = shallow(<Grid className='test-class-name' />, {disableLifecycleMethods: true});
const wrapper = shallow(<Grid className='test-class-name'>Children</Grid>, {disableLifecycleMethods: true});
assert.isTrue(wrapper.hasClass('mdc-layout-grid'));
assert.isTrue(wrapper.hasClass('test-class-name'));
});

test('align prop adds correct className', () => {
const wrapper = shallow(<Grid align='right' />, {disableLifecycleMethods: true});
const wrapper = shallow(<Grid align='right'>Children</Grid>, {disableLifecycleMethods: true});
assert.isTrue(wrapper.hasClass('mdc-layout-grid'));
assert.isTrue(wrapper.hasClass('mdc-layout-grid--align-right'));
});

test('fixedColumnWidth prop adds correct className', () => {
const wrapper = shallow(<Grid fixedColumnWidth />, {disableLifecycleMethods: true});
const wrapper = shallow(<Grid fixedColumnWidth>Children</Grid>, {disableLifecycleMethods: true});
assert.isTrue(wrapper.hasClass('mdc-layout-grid'));
assert.isTrue(wrapper.hasClass('mdc-layout-grid--fixed-column-width'));
});

test('keeps custom props', () => {
const wrapper = shallow(<Grid propOne={true} propTwo='test-prop' />, {disableLifecycleMethods: true});
const wrapper = shallow(<Grid propOne={true} propTwo='test-prop'>Children</Grid>, {disableLifecycleMethods: true});
assert.isTrue(wrapper.props().propOne);
assert.equal(wrapper.props().propTwo, 'test-prop');
});
4 changes: 2 additions & 2 deletions test/unit/layout-grid/Row.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import {Row} from '../../../packages/layout-grid/index';
suite('LayoutGridRow');

test('classNames adds classes', () => {
const wrapper = shallow(<Row className='test-class-name' />, {disableLifecycleMethods: true});
const wrapper = shallow(<Row className='test-class-name'>Children</Row>, {disableLifecycleMethods: true});
assert.isTrue(wrapper.hasClass('mdc-layout-grid__inner'));
assert.isTrue(wrapper.hasClass('test-class-name'));
});

test('keeps custom props', () => {
const wrapper = shallow(<Row propOne={true} propTwo='test-prop' />, {disableLifecycleMethods: true});
const wrapper = shallow(<Row propOne={true} propTwo='test-prop'>Children</Row>, {disableLifecycleMethods: true});
assert.isTrue(wrapper.props().propOne);
assert.equal(wrapper.props().propTwo, 'test-prop');
});

0 comments on commit 408cdd2

Please sign in to comment.