You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
The text was updated successfully, but these errors were encountered:
levithomason
changed the title
refactory(commonTests): rename for consistency and clarity
refactor(commonTests): rename for consistency and clarity
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)
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
andpropKeyOrValueToClassName
are not consistent.The tests doesn't assert key or value, it asserts key or value and key. Rename to
propKeyOrValueToClassName
=>propKeyOrValueAndKeyToClassName
.The text was updated successfully, but these errors were encountered: