feat(checkbox): support title API #4170
Annotations
3 errors
Run npm run test:
src/cascader/__tests__/cascader.test.tsx#L445
TestingLibraryElementError: Found multiple elements with the title: 子选项一.
Here are the matching elements:
Ignored nodes: comments, script, style
<label
class="t-checkbox"
tabindex="0"
title="子选项一"
>
<input
class="t-checkbox__former"
name="1.1"
tabindex="-1"
title="子选项一"
type="checkbox"
value=""
/>
<span
class="t-checkbox__input"
/>
<span
class="t-checkbox__label"
>
子选项一
</span>
</label>
Ignored nodes: comments, script, style
<input
class="t-checkbox__former"
name="1.1"
tabindex="-1"
title="子选项一"
type="checkbox"
value=""
/>
(If this is intentional, then use the `*AllBy*` variant of the query (like `queryAllByText`, `getAllByText`, or `findAllByText`)).
Ignored nodes: comments, script, style
<body>
<div>
<div
class="t-cascader__panel t-cascader--normal"
>
<ul
class="t-cascader__menu narrow-scrollbar t-cascader__menu--segment"
>
<li
class="t-cascader__item t-is-selected t-is-expanded t-size-m t-cascader__item--with-icon"
>
<label
class="t-checkbox"
tabindex="0"
title="选项一"
>
<input
class="t-checkbox__former"
name="1"
tabindex="-1"
title="选项一"
type="checkbox"
value=""
/>
<span
class="t-checkbox__input"
/>
<span
class="t-checkbox__label"
>
选项一
</span>
</label>
<svg
class="t-icon t-icon-chevron-right t-cascader__item-icon t-icon t-is-selected t-is-expanded"
fill="none"
height="1em"
viewBox="0 0 24 24"
width="1em"
>
<path
d="M8.09 17.5l5.5-5.5-5.5-5.5L9.5 5.09 16.41 12 9.5 18.91 8.09 17.5z"
fill="currentColor"
/>
</svg>
</li>
<li
class="t-cascader__item t-size-m t-cascader__item--with-icon"
>
<label
class="t-checkbox"
tabindex="0"
title="选项二"
>
<input
class="t-checkbox__former"
name="2"
tabindex="-1"
title="选项二"
type="checkbox"
value=""
/>
<span
class="t-checkbox__input"
/>
<span
class="t-checkbox__label"
>
选项二
</span>
</label>
<svg
class="t-icon t-icon-chevron-right t-cascader__item-icon t-icon"
fill="none"
height="1em"
viewBox="0 0 24 24"
width="1em"
>
<path
d="M8.09 17.5l5.5-5.5-5.5-5.5L9.5 5.09 16.41 12 9.5 18.91 8.09 17.5z"
fill="currentColor"
/>
</svg>
</li>
</ul>
<ul
class="t-cascader__menu narrow-scrollbar"
>
<li
class="t-cascader__item t-size-m t-cascader__item--leaf"
>
<label
class="t-checkbox"
tabindex="0"
title="子选项一"
>
<input
class="t-checkbox__former"
name="1.1"
tabindex="-1"
title="子选项一"
type="checkbox"
value=""
/>
<span
class="t-checkbox__input"
/>
<span
class="t-checkbox__label"
>
子选项一
</span>
</label>
</li>
<li
class="t-cascader__item t-size-m t-cascader__item--leaf"
>
<label
class="t-checkbox"
tabindex="0"
title="子选项二"
>
<input
class="t-checkbox__former"
name="1.2"
tabindex="-1"
title="子选项二"
type="checkbox"
valu
|
Run npm run test:
src/cascader/__tests__/cascader.test.tsx#L469
TestingLibraryElementError: Found multiple elements with the title: 选项一.
Here are the matching elements:
Ignored nodes: comments, script, style
<label
class="t-checkbox"
tabindex="0"
title="选项一"
>
<input
class="t-checkbox__former"
name="1"
tabindex="-1"
title="选项一"
type="checkbox"
value=""
/>
<span
class="t-checkbox__input"
/>
<span
class="t-checkbox__label"
>
选项一
</span>
</label>
Ignored nodes: comments, script, style
<input
class="t-checkbox__former"
name="1"
tabindex="-1"
title="选项一"
type="checkbox"
value=""
/>
(If this is intentional, then use the `*AllBy*` variant of the query (like `queryAllByText`, `getAllByText`, or `findAllByText`)).
Ignored nodes: comments, script, style
<body>
<div>
<button>
set max 1
</button>
<div
class="t-cascader__panel t-cascader--normal"
>
<ul
class="t-cascader__menu narrow-scrollbar"
>
<li
class="t-cascader__item t-size-m t-cascader__item--with-icon"
>
<label
class="t-checkbox"
tabindex="0"
title="选项一"
>
<input
class="t-checkbox__former"
name="1"
tabindex="-1"
title="选项一"
type="checkbox"
value=""
/>
<span
class="t-checkbox__input"
/>
<span
class="t-checkbox__label"
>
选项一
</span>
</label>
<svg
class="t-icon t-icon-chevron-right t-cascader__item-icon t-icon"
fill="none"
height="1em"
viewBox="0 0 24 24"
width="1em"
>
<path
d="M8.09 17.5l5.5-5.5-5.5-5.5L9.5 5.09 16.41 12 9.5 18.91 8.09 17.5z"
fill="currentColor"
/>
</svg>
</li>
<li
class="t-cascader__item t-size-m t-cascader__item--with-icon"
>
<label
class="t-checkbox"
tabindex="0"
title="选项二"
>
<input
class="t-checkbox__former"
name="2"
tabindex="-1"
title="选项二"
type="checkbox"
value=""
/>
<span
class="t-checkbox__input"
/>
<span
class="t-checkbox__label"
>
选项二
</span>
</label>
<svg
class="t-icon t-icon-chevron-right t-cascader__item-icon t-icon"
fill="none"
height="1em"
viewBox="0 0 24 24"
width="1em"
>
<path
d="M8.09 17.5l5.5-5.5-5.5-5.5L9.5 5.09 16.41 12 9.5 18.91 8.09 17.5z"
fill="currentColor"
/>
</svg>
</li>
</ul>
</div>
</div>
</body>
❯ Object.getElementError node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/config.js:37:19
❯ getElementError node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:20:35
❯ getMultipleElementsFoundError node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:23:10
❯ node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:55:13
❯ node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:95:19
❯ src/cascader/__tests__/cascader.test.tsx:469:21
|
Run npm run test
Process completed with exit code 1.
|
Loading