Skip to content

Commit

Permalink
fix: rename hasChips to hasContent
Browse files Browse the repository at this point in the history
  • Loading branch information
HellWolf93 committed Jun 26, 2020
1 parent 7f8a4b0 commit 04907dd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import hasChips from '../hasChips';
import hasContent from '../hasContent';

describe('hasChips', () => {
describe('hasContent', () => {
it('should return true', () => {
const values = [{ label: 'Label', name: 'Name' }, [{ label: 'Label', name: 'Name' }]];
values.forEach(value => {
expect(hasChips(value)).toBe(true);
expect(hasContent(value)).toBe(true);
});
});

it('should return false', () => {
const values = [undefined, null, 0, false, true, []];
values.forEach(value => {
expect(hasChips(value)).toBe(false);
expect(hasContent(value)).toBe(false);
});
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function hasChips(value) {
export default function hasContent(value) {
if (!value) {
return false;
}
Expand Down
6 changes: 4 additions & 2 deletions src/components/MultiSelect/helpers/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import hasChips from './hasChips';
import hasContent from './hasContent';
import positionResolver from './positionResolver';
import getContent from './getContent';
import normalizeValue from './normalizeValue';

export { hasChips, positionResolver };
export { hasContent, positionResolver, getContent, normalizeValue };

0 comments on commit 04907dd

Please sign in to comment.