feat: use @stacklok/ui-kit #150
Annotations
3 errors and 2 warnings
Run tests:
src/components/CopyToClipboard.tsx#L363
Error: [vitest] No "TooltipTrigger" export is defined on the "@stacklok/ui-kit" mock. Did you forget to return it from "vi.mock"?
If you need to partially mock a module, you can use "importOriginal" helper inside:
vi.mock(import("@stacklok/ui-kit"), async (importOriginal) => {
const actual = await importOriginal()
return {
...actual,
// your mocked methods
}
})
❯ CopyToClipboard src/components/CopyToClipboard.tsx:363:81
❯ Object.react-stack-bottom-frame node_modules/react-dom/cjs/react-dom-client.development.js:22428:20
❯ renderWithHooks node_modules/react-dom/cjs/react-dom-client.development.js:5757:22
❯ updateFunctionComponent node_modules/react-dom/cjs/react-dom-client.development.js:8018:19
❯ beginWork node_modules/react-dom/cjs/react-dom-client.development.js:9683:18
❯ runWithFiberInDEV node_modules/react-dom/cjs/react-dom-client.development.js:543:16
❯ performUnitOfWork node_modules/react-dom/cjs/react-dom-client.development.js:15052:22
❯ workLoopSync node_modules/react-dom/cjs/react-dom-client.development.js:14870:41
|
Run tests:
src/components/__tests__/CopyToClipboard.test.tsx#L11
TestingLibraryElementError: Unable to find an element with the role "img"
Here are the available roles:
button:
Name "":
<button
class="outline outline-0 outline-offset-2 outline-brand-700 forced-colors:outline-[Highlight] inline-flex shrink-0 cursor-pointer items-center justify-center gap-1 rounded-sm border px-4 py-2 text-center text-base font-medium [&_svg]:size-4 [&_svg]:shrink-0 border-transparent bg-transparent hover:bg-gray-100 pressed:bg-gray-200 disabled:bg-transparent disabled:text-disabled focus-within:&:has([data-focus-visible]):outline-2 invalid:!outline-red-700 focus-visible:outline-2 size-7 text-secondary"
data-rac=""
id="react-aria-:r1:"
type="button"
/>
--------------------------------------------------
Ignored nodes: comments, script, style
<body>
<div>
<button
class="outline outline-0 outline-offset-2 outline-brand-700 forced-colors:outline-[Highlight] inline-flex shrink-0 cursor-pointer items-center justify-center gap-1 rounded-sm border px-4 py-2 text-center text-base font-medium [&_svg]:size-4 [&_svg]:shrink-0 border-transparent bg-transparent hover:bg-gray-100 pressed:bg-gray-200 disabled:bg-transparent disabled:text-disabled focus-within:&:has([data-focus-visible]):outline-2 invalid:!outline-red-700 focus-visible:outline-2 size-7 text-secondary"
data-rac=""
id="react-aria-:r1:"
type="button"
>
<svg
class="lucide lucide-clipboard-copy"
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="4"
rx="1"
ry="1"
width="8"
x="8"
y="2"
/>
<path
d="M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2"
/>
<path
d="M16 4h2a2 2 0 0 1 2 2v4"
/>
<path
d="M21 14H11"
/>
<path
d="m15 10-4 4 4 4"
/>
</svg>
</button>
</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
❯ getByRole node_modules/@testing-library/dom/dist/query-helpers.js:95:19
❯ src/components/__tests__/CopyToClipboard.test.tsx:11:19
|
Run tests
Process completed with exit code 1.
|
Your workflow is using a version of actions/cache that is scheduled for deprecation, actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9. Please update your workflow to use either v3 or v4 of actions/cache to avoid interruptions. Learn more: https://github.blog/changelog/2024-12-05-notice-of-upcoming-releases-and-breaking-changes-for-github-actions/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-down
|
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
Loading