Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Remove legacy test runner #4596

Merged
merged 12 commits into from
Apr 21, 2016
9 changes: 4 additions & 5 deletions client/components/feature-example/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ import { shallow } from 'enzyme';
import FeatureExample from '../index';

describe( 'Feature Example', function() {
it( 'should have Feature-example class', function() {
it( 'should have Feature-example class', () => {
const featureExample = shallow( <FeatureExample /> );
assert.equal( 1, featureExample.find( '.feature-example' ).length );
assert.lengthOf( featureExample.find( '.feature-example' ), 1 );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The expected value is usually first.

Copy link
Member Author

@gziolo gziolo Apr 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, lenghtOf is tricky:

.lengthOf(object, length, [message])

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I get it now – the grammar would be wrong if the length was the first argument.

} );

// TODO: fix it
it.skip( 'should contains the passed children wrapped by a feature-example div', function() {
it( 'should contains the passed children wrapped by a feature-example div', () => {
const featureExample = shallow( <FeatureExample><div>test</div></FeatureExample> );
assert.equal( true, featureExample.contains( '<div>test</div>' ) );
assert.isTrue( featureExample.contains( <div>test</div> ) );
} );
} );