Skip to content

Commit

Permalink
fix(MultiCascader): fix not rendering the count of selected values (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
simonguo committed Jan 10, 2022
1 parent be9c756 commit 324e90c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/MultiCascader/MultiCascader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ const MultiCascader: PickerComponent<MultiCascaderProps> = React.forwardRef(
...props,
classPrefix,
hasValue,
countable,
name: 'cascader',
appearance,
cleanable
Expand Down
4 changes: 3 additions & 1 deletion src/MultiCascader/test/MultiCascaderSpec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import ReactTestUtils from 'react-dom/test-utils';
import { act, render } from '@testing-library/react';
import { getDOMNode, getInstance } from '@test/testUtils';
import { getDOMNode, getInstance, getStyle } from '@test/testUtils';
import MultiCascader from '../MultiCascader';
import Button from '../../Button';

Expand Down Expand Up @@ -47,6 +47,8 @@ describe('MultiCascader', () => {
const instance = getDOMNode(<MultiCascader data={items} value={['abcde-1', 'abcde-2']} />);

assert.equal(instance.querySelector('.rs-picker-value-count').textContent, '1');
assert.include(instance.className, 'rs-picker-countable');
assert.equal(getStyle(instance.querySelector('.rs-picker-toggle-value'), 'display'), 'flex');
});

it('Should not render number', () => {
Expand Down

1 comment on commit 324e90c

@vercel
Copy link

@vercel vercel bot commented on 324e90c Jan 10, 2022

Choose a reason for hiding this comment

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

Please sign in to comment.