Skip to content

Commit

Permalink
fix(currentRefinedValues): allow array of strings for cssClasses.*
Browse files Browse the repository at this point in the history
  • Loading branch information
vvo authored and Jerska committed Jan 28, 2016
1 parent 477967e commit 55b3a3f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,17 @@ describe('currentRefinedValues()', () => {
expect(ReactDOM.render.calledOnce).toBe(true);
expect(ReactDOM.render.firstCall.args[0]).toEqualJSX(<CurrentRefinedValues {...expectedProps} />);
});

it('should work with an array', () => {
parameters.cssClasses.body = ['custom-body', 'custom-body-2'];

currentRefinedValues(parameters).render(renderParameters);

expectedProps.cssClasses.body = 'ais-current-refined-values--body custom-body custom-body-2';

expect(ReactDOM.render.calledOnce).toBe(true);
expect(ReactDOM.render.firstCall.args[0]).toEqualJSX(<CurrentRefinedValues {...expectedProps} />);
});
});

context('with attributes', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function currentRefinedValues({
reduce(userCssClasses, (res, val, key) => {
return res &&
userCssClassesKeys.indexOf(key) !== -1 &&
isString(val);
isString(val) || isArray(val);
}, true);

const showUsage = false ||
Expand Down

0 comments on commit 55b3a3f

Please sign in to comment.