Skip to content

Commit

Permalink
make component unit test for component/panel/row.js
Browse files Browse the repository at this point in the history
  • Loading branch information
hideokamoto authored and youknowriad committed Dec 3, 2017
1 parent 429fb42 commit 7f518a4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions components/panel/test/row.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* External dependencies
*/
import { shallow } from 'enzyme';

/**
* Internal dependencies
*/
import PanelRow from '../row';

describe( 'PanelRow', () => {
it( 'should defined default class name', () => {
const wrapper = shallow( <PanelRow /> );
expect( wrapper.hasClass( 'components-panel__row' ) ).toBe( true );
} );
it( 'should defined custom class name', () => {
const wrapper = shallow( <PanelRow className="custom" /> );
expect( wrapper.hasClass( 'custom' ) ).toBe( true );
} );
it( 'should return child components', () => {
const wrapper = shallow( <PanelRow><p>children</p></PanelRow> );
expect( wrapper.find( 'p' ).text() ).toBe( 'children' );
} );
} );

0 comments on commit 7f518a4

Please sign in to comment.