2022-04-28 19:39:52 +08:00
|
|
|
import { AppstoreOutlined, BarsOutlined } from '@ant-design/icons';
|
2023-01-06 16:48:44 +08:00
|
|
|
import React, { useState } from 'react';
|
2022-04-28 19:39:52 +08:00
|
|
|
|
2022-04-11 11:13:16 +08:00
|
|
|
import mountTest from '../../../tests/shared/mountTest';
|
|
|
|
import rtlTest from '../../../tests/shared/rtlTest';
|
2022-06-22 14:57:09 +08:00
|
|
|
import { fireEvent, render } from '../../../tests/utils';
|
2022-05-13 22:00:01 +08:00
|
|
|
|
2022-04-11 11:13:16 +08:00
|
|
|
import type { SegmentedValue } from '../index';
|
2022-06-22 14:57:09 +08:00
|
|
|
import Segmented from '../index';
|
2022-04-11 11:13:16 +08:00
|
|
|
|
|
|
|
// Make CSSMotion working without transition
|
|
|
|
jest.mock('rc-motion/lib/util/motion', () => ({
|
|
|
|
...jest.requireActual('rc-motion/lib/util/motion'),
|
|
|
|
supportTransition: false,
|
|
|
|
}));
|
|
|
|
|
|
|
|
const prefixCls = 'ant-segmented';
|
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
function expectMatchChecked(container: HTMLElement, checkedList: boolean[]) {
|
|
|
|
const inputList = Array.from(
|
|
|
|
container.querySelectorAll<HTMLInputElement>(`.${prefixCls}-item-input`),
|
|
|
|
);
|
|
|
|
expect(inputList).toHaveLength(checkedList.length);
|
|
|
|
|
|
|
|
inputList.forEach((input, i) => {
|
|
|
|
const checked = checkedList[i];
|
|
|
|
|
|
|
|
expect(input.checked).toBe(checked);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-04-11 11:13:16 +08:00
|
|
|
describe('Segmented', () => {
|
|
|
|
mountTest(Segmented);
|
|
|
|
rtlTest(Segmented);
|
|
|
|
|
|
|
|
beforeAll(() => {
|
|
|
|
jest.useFakeTimers();
|
|
|
|
});
|
|
|
|
|
|
|
|
afterAll(() => {
|
|
|
|
jest.useRealTimers();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('render empty segmented', () => {
|
2022-05-13 22:00:01 +08:00
|
|
|
const { asFragment } = render(<Segmented options={[]} />);
|
|
|
|
expect(asFragment().firstChild).toMatchSnapshot();
|
2022-04-11 11:13:16 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
it('render segmented ok', () => {
|
2022-05-13 22:00:01 +08:00
|
|
|
const { asFragment, container } = render(
|
2022-04-11 11:13:16 +08:00
|
|
|
<Segmented options={[{ label: 'Daily', value: 'Daily' }, 'Weekly', 'Monthly']} />,
|
|
|
|
);
|
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
expect(asFragment().firstChild).toMatchSnapshot();
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
expectMatchChecked(container, [true, false, false]);
|
2022-04-11 11:13:16 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
it('render label with ReactNode', () => {
|
2022-05-13 22:00:01 +08:00
|
|
|
const { asFragment, container } = render(
|
2022-04-11 11:13:16 +08:00
|
|
|
<Segmented
|
|
|
|
options={[
|
|
|
|
{ label: 'Daily', value: 'Daily' },
|
|
|
|
{ label: <div id="weekly">Weekly</div>, value: 'Weekly' },
|
|
|
|
{ label: <h2>Monthly</h2>, value: 'Monthly' },
|
|
|
|
]}
|
|
|
|
/>,
|
|
|
|
);
|
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
expect(asFragment().firstChild).toMatchSnapshot();
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
expectMatchChecked(container, [true, false, false]);
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
expect(container.querySelector('#weekly')?.textContent).toContain('Weekly');
|
|
|
|
expect(container.querySelectorAll('h2')[0].textContent).toContain('Monthly');
|
2022-04-11 11:13:16 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
it('render segmented with defaultValue', () => {
|
2022-05-13 22:00:01 +08:00
|
|
|
const { container } = render(
|
2022-04-11 11:13:16 +08:00
|
|
|
<Segmented
|
|
|
|
options={['Daily', 'Weekly', 'Monthly', 'Quarterly', 'Yearly']}
|
|
|
|
defaultValue="Quarterly"
|
|
|
|
/>,
|
|
|
|
);
|
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
expectMatchChecked(container, [false, false, false, true, false]);
|
2022-04-11 11:13:16 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
it('render segmented with string options', () => {
|
|
|
|
const handleValueChange = jest.fn();
|
2022-05-13 22:00:01 +08:00
|
|
|
const { asFragment, container } = render(
|
2022-04-28 19:39:52 +08:00
|
|
|
<Segmented options={['Daily', 'Weekly', 'Monthly']} onChange={handleValueChange} />,
|
2022-04-11 11:13:16 +08:00
|
|
|
);
|
2022-05-13 22:00:01 +08:00
|
|
|
expect(asFragment().firstChild).toMatchSnapshot();
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
expectMatchChecked(container, [true, false, false]);
|
2022-04-11 11:13:16 +08:00
|
|
|
expect(
|
2022-05-13 22:00:01 +08:00
|
|
|
container
|
|
|
|
.querySelectorAll(`label.${prefixCls}-item`)[0]
|
|
|
|
.classList.contains(`${prefixCls}-item-selected`),
|
2022-04-11 11:13:16 +08:00
|
|
|
).toBeTruthy();
|
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
fireEvent.click(container.querySelectorAll(`.${prefixCls}-item-input`)[2]);
|
2022-08-30 10:57:13 +08:00
|
|
|
expect(handleValueChange).toHaveBeenCalledWith('Monthly');
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
expectMatchChecked(container, [false, false, true]);
|
2022-04-11 11:13:16 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
it('render segmented with numeric options', () => {
|
|
|
|
const handleValueChange = jest.fn();
|
2022-05-13 22:00:01 +08:00
|
|
|
const { asFragment, container } = render(
|
2022-11-19 13:47:33 +08:00
|
|
|
<Segmented options={[1, 2, 3, 4, 5]} onChange={(value) => handleValueChange(value)} />,
|
2022-04-11 11:13:16 +08:00
|
|
|
);
|
2022-05-13 22:00:01 +08:00
|
|
|
expect(asFragment().firstChild).toMatchSnapshot();
|
|
|
|
expectMatchChecked(container, [true, false, false, false, false]);
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
fireEvent.click(container.querySelectorAll(`.${prefixCls}-item-input`)[4]);
|
2022-08-30 10:57:13 +08:00
|
|
|
expect(handleValueChange).toHaveBeenCalledWith(5);
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
expectMatchChecked(container, [false, false, false, false, true]);
|
2022-04-11 11:13:16 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
it('render segmented with mixed options', () => {
|
|
|
|
const handleValueChange = jest.fn();
|
2022-05-13 22:00:01 +08:00
|
|
|
const { asFragment, container } = render(
|
2022-04-11 11:13:16 +08:00
|
|
|
<Segmented
|
|
|
|
options={['Daily', { label: 'Weekly', value: 'Weekly' }, 'Monthly']}
|
2022-11-19 13:47:33 +08:00
|
|
|
onChange={(value) => handleValueChange(value)}
|
2022-04-11 11:13:16 +08:00
|
|
|
/>,
|
|
|
|
);
|
2022-05-13 22:00:01 +08:00
|
|
|
expect(asFragment().firstChild).toMatchSnapshot();
|
|
|
|
expectMatchChecked(container, [true, false, false]);
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
fireEvent.click(container.querySelectorAll(`.${prefixCls}-item-input`)[1]);
|
2022-08-30 10:57:13 +08:00
|
|
|
expect(handleValueChange).toHaveBeenCalledWith('Weekly');
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
expectMatchChecked(container, [false, true, false]);
|
2022-04-11 11:13:16 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
it('render segmented with options: disabled', () => {
|
|
|
|
const handleValueChange = jest.fn();
|
2022-05-13 22:00:01 +08:00
|
|
|
const { asFragment, container } = render(
|
2022-04-11 11:13:16 +08:00
|
|
|
<Segmented
|
|
|
|
options={['Daily', { label: 'Weekly', value: 'Weekly', disabled: true }, 'Monthly']}
|
2022-11-19 13:47:33 +08:00
|
|
|
onChange={(value) => handleValueChange(value)}
|
2022-04-11 11:13:16 +08:00
|
|
|
/>,
|
|
|
|
);
|
2022-05-13 22:00:01 +08:00
|
|
|
expect(asFragment().firstChild).toMatchSnapshot();
|
2022-04-11 11:13:16 +08:00
|
|
|
expect(
|
2022-05-13 22:00:01 +08:00
|
|
|
container
|
|
|
|
.querySelectorAll(`label.${prefixCls}-item`)[1]
|
|
|
|
.classList.contains(`${prefixCls}-item-disabled`),
|
2022-04-11 11:13:16 +08:00
|
|
|
).toBeTruthy();
|
2022-05-13 22:00:01 +08:00
|
|
|
expect(container.querySelectorAll(`.${prefixCls}-item-input`)[1]).toHaveAttribute('disabled');
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
fireEvent.click(container.querySelectorAll(`.${prefixCls}-item-input`)[1]);
|
2022-08-30 10:57:13 +08:00
|
|
|
expect(handleValueChange).not.toHaveBeenCalled();
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
expectMatchChecked(container, [true, false, false]);
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
fireEvent.click(container.querySelectorAll(`.${prefixCls}-item-input`)[2]);
|
2022-08-30 10:57:13 +08:00
|
|
|
expect(handleValueChange).toHaveBeenCalledWith('Monthly');
|
|
|
|
expect(handleValueChange).toHaveBeenCalledTimes(1);
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
expectMatchChecked(container, [false, false, true]);
|
2022-04-11 11:13:16 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
it('render segmented: disabled', () => {
|
|
|
|
const handleValueChange = jest.fn();
|
2022-05-13 22:00:01 +08:00
|
|
|
const { asFragment, container } = render(
|
2022-04-11 11:13:16 +08:00
|
|
|
<Segmented
|
|
|
|
disabled
|
|
|
|
options={['Daily', 'Weekly', 'Monthly']}
|
2022-11-19 13:47:33 +08:00
|
|
|
onChange={(value) => handleValueChange(value)}
|
2022-04-11 11:13:16 +08:00
|
|
|
/>,
|
|
|
|
);
|
2022-05-13 22:00:01 +08:00
|
|
|
expect(asFragment().firstChild).toMatchSnapshot();
|
|
|
|
expect(
|
|
|
|
container.querySelectorAll(`.${prefixCls}`)[0].classList.contains(`${prefixCls}-disabled`),
|
|
|
|
).toBeTruthy();
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
fireEvent.click(container.querySelectorAll(`.${prefixCls}-item-input`)[1]);
|
2022-08-30 10:57:13 +08:00
|
|
|
expect(handleValueChange).not.toHaveBeenCalled();
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
expectMatchChecked(container, [true, false, false]);
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
fireEvent.click(container.querySelectorAll(`.${prefixCls}-item-input`)[2]);
|
2022-08-30 10:57:13 +08:00
|
|
|
expect(handleValueChange).not.toHaveBeenCalled();
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
expectMatchChecked(container, [true, false, false]);
|
2022-04-11 11:13:16 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
it('render segmented with className and other html attributes', () => {
|
2022-04-18 21:02:11 +08:00
|
|
|
const { container } = render(
|
2022-04-11 11:13:16 +08:00
|
|
|
<Segmented
|
|
|
|
options={['Daily', 'Monthly', 'Weekly']}
|
|
|
|
defaultValue="Weekly"
|
|
|
|
className="mock-cls"
|
|
|
|
data-test-id="hello"
|
|
|
|
/>,
|
|
|
|
);
|
|
|
|
|
2022-04-18 21:02:11 +08:00
|
|
|
expect(container.querySelector('.mock-cls')).toBeTruthy();
|
|
|
|
expect(container.querySelector('[data-test-id]')).toHaveAttribute('data-test-id', 'hello');
|
2022-04-11 11:13:16 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
it('render segmented with ref', () => {
|
|
|
|
const ref = React.createRef<HTMLDivElement>();
|
2022-05-13 22:00:01 +08:00
|
|
|
const { container } = render(
|
2022-04-11 11:13:16 +08:00
|
|
|
<Segmented options={['Daily', 'Monthly', 'Weekly']} defaultValue="Weekly" ref={ref} />,
|
|
|
|
);
|
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
expect(ref.current).toBe(container.querySelector(`.${prefixCls}`));
|
2022-04-11 11:13:16 +08:00
|
|
|
});
|
|
|
|
|
2022-04-23 21:00:05 +08:00
|
|
|
it('render segmented with controlled mode', async () => {
|
2023-01-06 16:48:44 +08:00
|
|
|
const Demo: React.FC = () => {
|
|
|
|
const [value, setValue] = useState<SegmentedValue>('Map');
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<Segmented options={['Map', 'Transit', 'Satellite']} value={value} onChange={setValue} />
|
|
|
|
<div className="value">{value}</div>
|
|
|
|
<input
|
|
|
|
className="control"
|
|
|
|
onChange={(e) => {
|
|
|
|
setValue(e.target.value);
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|
2022-05-13 22:00:01 +08:00
|
|
|
const { container } = render(<Demo />);
|
|
|
|
fireEvent.click(container.querySelectorAll(`.${prefixCls}-item-input`)[0]);
|
|
|
|
expect(container.querySelector('.value')?.textContent).toBe('Map');
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
fireEvent.click(container.querySelectorAll(`.${prefixCls}-item-input`)[1]);
|
|
|
|
expect(container.querySelector('.value')?.textContent).toBe('Transit');
|
2022-04-11 11:13:16 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
it('render segmented with options null/undefined', () => {
|
|
|
|
const handleValueChange = jest.fn();
|
2022-05-13 22:00:01 +08:00
|
|
|
const { asFragment, container } = render(
|
2022-04-11 11:13:16 +08:00
|
|
|
<Segmented
|
|
|
|
options={[null, undefined, ''] as any}
|
|
|
|
disabled
|
2022-11-19 13:47:33 +08:00
|
|
|
onChange={(value) => handleValueChange(value)}
|
2022-04-11 11:13:16 +08:00
|
|
|
/>,
|
|
|
|
);
|
2022-05-13 22:00:01 +08:00
|
|
|
expect(asFragment().firstChild).toMatchSnapshot();
|
|
|
|
expect(
|
2022-11-19 13:47:33 +08:00
|
|
|
Array.from(container.querySelectorAll(`.${prefixCls}-item-label`)).map((n) => n.textContent),
|
2022-05-13 22:00:01 +08:00
|
|
|
).toEqual(['', '', '']);
|
2022-04-11 11:13:16 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
it('render segmented with thumb', () => {
|
|
|
|
const handleValueChange = jest.fn();
|
2022-05-13 22:00:01 +08:00
|
|
|
const { asFragment, container } = render(
|
2022-04-11 11:13:16 +08:00
|
|
|
<Segmented
|
|
|
|
options={['Map', 'Transit', 'Satellite']}
|
2022-11-19 13:47:33 +08:00
|
|
|
onChange={(value) => handleValueChange(value)}
|
2022-04-11 11:13:16 +08:00
|
|
|
/>,
|
|
|
|
);
|
2022-05-13 22:00:01 +08:00
|
|
|
expect(asFragment().firstChild).toMatchSnapshot();
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
expectMatchChecked(container, [true, false, false]);
|
2022-04-11 11:13:16 +08:00
|
|
|
expect(
|
2022-05-13 22:00:01 +08:00
|
|
|
container
|
|
|
|
.querySelectorAll(`label.${prefixCls}-item`)[0]
|
|
|
|
.classList.contains(`${prefixCls}-item-selected`),
|
2022-04-11 11:13:16 +08:00
|
|
|
).toBeTruthy();
|
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
fireEvent.click(container.querySelectorAll(`.${prefixCls}-item-input`)[2]);
|
2022-08-30 10:57:13 +08:00
|
|
|
expect(handleValueChange).toHaveBeenCalledWith('Satellite');
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
expectMatchChecked(container, [false, false, true]);
|
2022-04-11 11:13:16 +08:00
|
|
|
|
|
|
|
// thumb appeared
|
2023-02-06 21:15:43 +08:00
|
|
|
// expect(container.querySelectorAll(`.${prefixCls}-thumb`).length).toBe(1);
|
2022-04-11 11:13:16 +08:00
|
|
|
|
|
|
|
// change selection again
|
2022-05-13 22:00:01 +08:00
|
|
|
fireEvent.click(container.querySelectorAll(`.${prefixCls}-item-input`)[1]);
|
2022-08-30 10:57:13 +08:00
|
|
|
expect(handleValueChange).toHaveBeenCalledWith('Transit');
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
expectMatchChecked(container, [false, true, false]);
|
2022-04-11 11:13:16 +08:00
|
|
|
|
|
|
|
// thumb appeared
|
2023-02-06 21:15:43 +08:00
|
|
|
// expect(container.querySelectorAll(`.${prefixCls}-thumb`).length).toBe(1);
|
2022-04-11 11:13:16 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
it('render segmented with `block`', () => {
|
2022-05-13 22:00:01 +08:00
|
|
|
const { asFragment, container } = render(
|
|
|
|
<Segmented block options={['Daily', 'Weekly', 'Monthly']} />,
|
|
|
|
);
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
expect(asFragment().firstChild).toMatchSnapshot();
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
expect(
|
|
|
|
container.querySelectorAll(`.${prefixCls}`)[0].classList.contains(`${prefixCls}-block`),
|
|
|
|
).toBeTruthy();
|
2022-04-11 11:13:16 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
it('render segmented with `size#small`', () => {
|
2022-05-13 22:00:01 +08:00
|
|
|
const { asFragment, container } = render(
|
|
|
|
<Segmented size="small" options={['Daily', 'Weekly', 'Monthly']} />,
|
|
|
|
);
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
expect(asFragment().firstChild).toMatchSnapshot();
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
expect(
|
|
|
|
container.querySelectorAll(`.${prefixCls}`)[0].classList.contains(`${prefixCls}-sm`),
|
|
|
|
).toBeTruthy();
|
2022-04-11 11:13:16 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
it('render segmented with `size#large`', () => {
|
2022-05-13 22:00:01 +08:00
|
|
|
const { asFragment, container } = render(
|
|
|
|
<Segmented size="large" options={['Daily', 'Weekly', 'Monthly']} />,
|
|
|
|
);
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
expect(asFragment().firstChild).toMatchSnapshot();
|
2022-04-11 11:13:16 +08:00
|
|
|
|
2022-05-13 22:00:01 +08:00
|
|
|
expect(
|
|
|
|
container.querySelectorAll(`.${prefixCls}`)[0].classList.contains(`${prefixCls}-lg`),
|
|
|
|
).toBeTruthy();
|
2022-04-11 11:13:16 +08:00
|
|
|
});
|
2022-04-28 19:39:52 +08:00
|
|
|
|
|
|
|
it('render with icons', () => {
|
2022-05-13 22:00:01 +08:00
|
|
|
const { asFragment, container } = render(
|
2022-04-28 19:39:52 +08:00
|
|
|
<Segmented
|
|
|
|
options={[
|
|
|
|
{
|
|
|
|
value: 'List',
|
|
|
|
icon: <BarsOutlined />,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
value: 'Kanban',
|
|
|
|
label: 'KanbanYes',
|
|
|
|
icon: <AppstoreOutlined />,
|
|
|
|
},
|
|
|
|
]}
|
|
|
|
/>,
|
|
|
|
);
|
2022-05-13 22:00:01 +08:00
|
|
|
expect(asFragment().firstChild).toMatchSnapshot();
|
|
|
|
expect(container.querySelectorAll(`span.${prefixCls}-item-icon`).length).toBe(2);
|
|
|
|
expect(
|
|
|
|
container
|
|
|
|
.querySelectorAll(`div.${prefixCls}-item-label`)[1]
|
|
|
|
.textContent?.includes('KanbanYes'),
|
|
|
|
).toBeTruthy();
|
2022-04-28 19:39:52 +08:00
|
|
|
});
|
2022-04-11 11:13:16 +08:00
|
|
|
});
|