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

refactor(commonTests): rename for consistency and clarity #481

Closed
levithomason opened this issue Sep 9, 2016 · 1 comment
Closed

refactor(commonTests): rename for consistency and clarity #481

levithomason opened this issue Sep 9, 2016 · 1 comment

Comments

@levithomason
Copy link
Member

Factory Props

Some components pass a prop value to a factory, giving it many supported values. Other components might implement the same prop name but without a factory. Our current implements*Prop tests are only applicable to props that are implemented with the corresponding factory. These should be renamed:

implementsIconProp => implementsIconFactoryProp
implementsLabelProp => implementsLabelFactoryProp
implementsImageProp => implementsImageFactoryProp

className Props

Every className builder (src/lib/classNameBuilders.js) has a corresponding common test with a similar name. However, useKeyOrValueAndKey and propKeyOrValueToClassName are not consistent.

The tests doesn't assert key or value, it asserts key or value and key. Rename to propKeyOrValueToClassName => propKeyOrValueAndKeyToClassName.

@levithomason levithomason changed the title refactory(commonTests): rename for consistency and clarity refactor(commonTests): rename for consistency and clarity Sep 9, 2016
@levithomason
Copy link
Member Author

levithomason commented Sep 9, 2016

While we're at this, we can likely create a implementsFactoryProp() test instead. The Icon/Image/Label tests are virtually identical. They only vary in terms of the component factory used, and the prop name used.

Consider a single implementsFactoryProp(Component, propName, factoryProp) test instead where:

  • Component - The component implementing the prop
  • propName - The prop that receives the value to pass to the factory
  • factoryProp - The component prop the factory maps the propName prop to. (i.e. src for image prop)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant