feat(tests): tests for Opensearch components #1608
pr-coverage-annotation.yml
on: pull_request
coverage-report
3m 41s
Annotations
3 errors and 1 warning
src/components/Opensearch/main/Filtering/Drawer/Filterable/DateRange.test.tsx > FilterableDateRange > should display from and to date if value has both:
react-app/src/components/Opensearch/main/Filtering/Drawer/Filterable/DateRange.test.tsx#L40
TestingLibraryElementError: Unable to find an element with the text: Jan 01, 2025 - Mar 30, 2025. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.
Ignored nodes: comments, script, style
<body>
<div>
<div
class="flex items-center"
>
<button
aria-controls="radix-:r3:"
aria-expanded="false"
aria-haspopup="dialog"
data-state="closed"
type="button"
>
<div
class="flex items-center w-[270px] border-[1px] border-black p-2 justify-start text-left font-normal"
id="date"
>
<svg
class="mr-2 h-4 w-4"
fill="none"
height="24"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<rect
height="18"
rx="2"
ry="2"
width="18"
x="3"
y="4"
/>
<line
x1="16"
x2="16"
y1="2"
y2="6"
/>
<line
x1="8"
x2="8"
y1="2"
y2="6"
/>
<line
x1="3"
x2="21"
y1="10"
y2="10"
/>
</svg>
Jan 01, 2025 - Mar 31, 2025
</div>
</button>
<button
class="inline-flex items-center justify-center rounded-md text-[16px] font-bold ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-primary hover:bg-primary-dark h-10 px-4 py-2 text-white"
>
Clear
</button>
</div>
</div>
</body>
❯ Object.getElementError ../node_modules/@testing-library/dom/dist/config.js:37:19
❯ ../node_modules/@testing-library/dom/dist/query-helpers.js:76:38
❯ ../node_modules/@testing-library/dom/dist/query-helpers.js:52:17
❯ getByText ../node_modules/@testing-library/dom/dist/query-helpers.js:95:19
❯ src/components/Opensearch/main/Filtering/Drawer/Filterable/DateRange.test.tsx:40:19
|
src/components/Opensearch/main/Filtering/Drawer/Filterable/DateRange.test.tsx > FilterableDateRange > should handle clicking the popover trigger:
react-app/src/components/Opensearch/main/Filtering/Drawer/Filterable/DateRange.test.tsx#L58
TestingLibraryElementError: Unable to find an element with the text: Jan 01, 2025 - Mar 30, 2025. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.
Ignored nodes: comments, script, style
<body>
<div>
<div
class="flex items-center"
>
<button
aria-controls="radix-:r5:"
aria-expanded="false"
aria-haspopup="dialog"
data-state="closed"
type="button"
>
<div
class="flex items-center w-[270px] border-[1px] border-black p-2 justify-start text-left font-normal"
id="date"
>
<svg
class="mr-2 h-4 w-4"
fill="none"
height="24"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<rect
height="18"
rx="2"
ry="2"
width="18"
x="3"
y="4"
/>
<line
x1="16"
x2="16"
y1="2"
y2="6"
/>
<line
x1="8"
x2="8"
y1="2"
y2="6"
/>
<line
x1="3"
x2="21"
y1="10"
y2="10"
/>
</svg>
Jan 01, 2025 - Mar 31, 2025
</div>
</button>
<button
class="inline-flex items-center justify-center rounded-md text-[16px] font-bold ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-primary hover:bg-primary-dark h-10 px-4 py-2 text-white"
>
Clear
</button>
</div>
</div>
</body>
❯ Object.getElementError ../node_modules/@testing-library/dom/dist/config.js:37:19
❯ ../node_modules/@testing-library/dom/dist/query-helpers.js:76:38
❯ ../node_modules/@testing-library/dom/dist/query-helpers.js:52:17
❯ getByText ../node_modules/@testing-library/dom/dist/query-helpers.js:95:19
❯ src/components/Opensearch/main/Filtering/Drawer/Filterable/DateRange.test.tsx:58:29
|
coverage-report
Process completed with exit code 1.
|
coverage-report
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|