feat: add custom fetch override #5024
Annotations
10 errors and 1 warning
Test:
packages/react/test/upload-button.test.tsx#L112
Error: expect(element).toHaveAttribute("data-state", "ready") // element.getAttribute("data-state") === "ready"
Expected the element to have attribute:
data-state="ready"
Received:
data-state="readying"
Ignored nodes: comments, script, style
<html>
<head />
<body>
<div>
<div
class="flex flex-col items-center justify-center gap-1"
data-state="readying"
>
<label
class="group relative flex h-10 w-36 cursor-pointer items-center justify-center overflow-hidden rounded-md text-white after:transition-[width] after:duration-500 focus-within:ring-2 focus-within:ring-blue-600 focus-within:ring-offset-2 cursor-not-allowed bg-blue-400"
data-state="readying"
data-ut-element="button"
>
<input
accept=""
class="sr-only"
tabindex="0"
type="file"
/>
Loading...
</label>
<div
class="h-[1.25rem] text-xs leading-5 text-gray-600"
data-state="readying"
data-ut-element="allowed-content"
/>
</div>
</div>
</body>
</html>
❯ test/upload-button.test.tsx:112:39
❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/@testing-library/dom/dist/config.js:47:12
❯ checkCallback ../../node_modules/@testing-library/dom/dist/wait-for.js:124:77
❯ Timeout.checkRealTimersCallback ../../node_modules/@testing-library/dom/dist/wait-for.js:118:16
|
Test:
packages/react/test/upload-button.test.tsx#L132
Error: expect(element).toHaveAttribute("data-state", "ready") // element.getAttribute("data-state") === "ready"
Expected the element to have attribute:
data-state="ready"
Received:
data-state="readying"
Ignored nodes: comments, script, style
<html>
<head />
<body>
<div>
<div
class="flex flex-col items-center justify-center gap-1"
data-state="readying"
>
<label
class="group relative flex h-10 w-36 cursor-pointer items-center justify-center overflow-hidden rounded-md text-white after:transition-[width] after:duration-500 focus-within:ring-2 focus-within:ring-blue-600 focus-within:ring-offset-2 cursor-not-allowed bg-blue-400"
data-state="readying"
data-ut-element="button"
>
<input
accept=""
class="sr-only"
tabindex="0"
type="file"
/>
Loading...
</label>
<div
class="h-[1.25rem] text-xs leading-5 text-gray-600"
data-state="readying"
data-ut-element="allowed-content"
/>
</div>
</div>
</body>
</html>
❯ test/upload-button.test.tsx:132:39
❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/@testing-library/dom/dist/config.js:47:12
❯ checkCallback ../../node_modules/@testing-library/dom/dist/wait-for.js:124:77
❯ Timeout.checkRealTimersCallback ../../node_modules/@testing-library/dom/dist/wait-for.js:118:16
|
Test:
packages/react/test/upload-button.test.tsx#L150
Error: expect(element).toHaveAttribute("data-state", "ready") // element.getAttribute("data-state") === "ready"
Expected the element to have attribute:
data-state="ready"
Received:
data-state="readying"
Ignored nodes: comments, script, style
<html>
<head />
<body>
<div>
<div
class="flex flex-col items-center justify-center gap-1"
data-state="readying"
>
<label
class="group relative flex h-10 w-36 cursor-pointer items-center justify-center overflow-hidden rounded-md text-white after:transition-[width] after:duration-500 focus-within:ring-2 focus-within:ring-blue-600 focus-within:ring-offset-2 cursor-not-allowed bg-blue-400"
data-state="readying"
data-ut-element="button"
>
<input
accept=""
class="sr-only"
tabindex="0"
type="file"
/>
Loading...
</label>
<div
class="h-[1.25rem] text-xs leading-5 text-gray-600"
data-state="readying"
data-ut-element="allowed-content"
/>
</div>
</div>
</body>
</html>
❯ test/upload-button.test.tsx:150:39
❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/@testing-library/dom/dist/config.js:47:12
❯ checkCallback ../../node_modules/@testing-library/dom/dist/wait-for.js:124:77
❯ Timeout.checkRealTimersCallback ../../node_modules/@testing-library/dom/dist/wait-for.js:118:16
|
Test:
packages/react/test/upload-button.test.tsx#L167
Error: expect(element).toHaveAttribute("data-state", "ready") // element.getAttribute("data-state") === "ready"
Expected the element to have attribute:
data-state="ready"
Received:
data-state="readying"
Ignored nodes: comments, script, style
<html>
<head />
<body>
<div>
<div
class="flex flex-col items-center justify-center gap-1"
data-state="readying"
>
<label
class="group relative flex h-10 w-36 cursor-pointer items-center justify-center overflow-hidden rounded-md text-white after:transition-[width] after:duration-500 focus-within:ring-2 focus-within:ring-blue-600 focus-within:ring-offset-2 cursor-not-allowed bg-blue-400"
data-state="readying"
data-ut-element="button"
>
<input
accept=""
class="sr-only"
tabindex="0"
type="file"
/>
Loading...
</label>
<div
class="h-[1.25rem] text-xs leading-5 text-gray-600"
data-state="readying"
data-ut-element="allowed-content"
/>
</div>
</div>
</body>
</html>
❯ test/upload-button.test.tsx:167:39
❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/@testing-library/dom/dist/config.js:47:12
❯ checkCallback ../../node_modules/@testing-library/dom/dist/wait-for.js:124:77
❯ Timeout.checkRealTimersCallback ../../node_modules/@testing-library/dom/dist/wait-for.js:118:16
|
Test:
packages/react/test/upload-button.test.tsx#L195
Error: expect(element).toHaveAttribute("data-state", "ready") // element.getAttribute("data-state") === "ready"
Expected the element to have attribute:
data-state="ready"
Received:
data-state="readying"
Ignored nodes: comments, script, style
<html>
<head />
<body>
<div>
<div
class="flex flex-col items-center justify-center gap-1"
data-state="readying"
>
<label
class="group relative flex h-10 w-36 cursor-pointer items-center justify-center overflow-hidden rounded-md text-white after:transition-[width] after:duration-500 focus-within:ring-2 focus-within:ring-blue-600 focus-within:ring-offset-2 cursor-not-allowed bg-blue-400"
data-state="readying"
data-ut-element="button"
>
<input
accept=""
class="sr-only"
tabindex="0"
type="file"
/>
Loading...
</label>
<div
class="h-[1.25rem] text-xs leading-5 text-gray-600"
data-state="readying"
data-ut-element="allowed-content"
/>
</div>
</div>
</body>
</html>
❯ test/upload-button.test.tsx:195:39
❯ runWithExpensiveErrorDiagnosticsDisabled ../../node_modules/@testing-library/dom/dist/config.js:47:12
❯ checkCallback ../../node_modules/@testing-library/dom/dist/wait-for.js:124:77
❯ Timeout.checkRealTimersCallback ../../node_modules/@testing-library/dom/dist/wait-for.js:118:16
|
Test:
packages/react/test/upload-button.test.tsx#L233
TestingLibraryElementError: Unable to find an element with the text: Choose File. 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 flex-col items-center justify-center gap-1"
data-state="readying"
>
<label
class="group relative flex h-10 w-36 cursor-pointer items-center justify-center overflow-hidden rounded-md text-white after:transition-[width] after:duration-500 focus-within:ring-2 focus-within:ring-blue-600 focus-within:ring-offset-2 cursor-not-allowed bg-blue-400"
data-state="readying"
data-ut-element="button"
>
<input
accept=""
class="sr-only"
tabindex="0"
type="file"
/>
Loading...
</label>
<div
class="h-[1.25rem] text-xs leading-5 text-gray-600"
data-state="readying"
data-ut-element="allowed-content"
/>
</div>
</div>
</body>
Ignored nodes: comments, script, style
<html>
<head />
<body>
<div>
<div
class="flex flex-col items-center justify-center gap-1"
data-state="readying"
>
<label
class="group relative flex h-10 w-36 cursor-pointer items-center justify-center overflow-hidden rounded-md text-white after:transition-[width] after:duration-500 focus-within:ring-2 focus-within:ring-blue-600 focus-within:ring-offset-2 cursor-not-allowed bg-blue-400"
data-state="readying"
data-ut-element="button"
>
<input
accept=""
class="sr-only"
tabindex="0"
type="file"
/>
Loading...
</label>
<div
class="h-[1.25rem] text-xs leading-5 text-gray-600"
data-state="readying"
data-ut-element="allowed-content"
/>
</div>
</div>
</body>
</html>
❯ Proxy.waitForWrapper ../../node_modules/@testing-library/dom/dist/wait-for.js:163:27
❯ test/upload-button.test.tsx:233:11
|
Test:
packages/react/test/upload-button.test.tsx#L256
TestingLibraryElementError: Unable to find an element with the text: Choose File(s). 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 flex-col items-center justify-center gap-1"
data-state="readying"
>
<label
class="group relative flex h-10 w-36 cursor-pointer items-center justify-center overflow-hidden rounded-md text-white after:transition-[width] after:duration-500 focus-within:ring-2 focus-within:ring-blue-600 focus-within:ring-offset-2 cursor-not-allowed bg-blue-400"
data-state="readying"
data-ut-element="button"
>
<input
accept=""
class="sr-only"
tabindex="0"
type="file"
/>
Loading...
</label>
<div
class="h-[1.25rem] text-xs leading-5 text-gray-600"
data-state="readying"
data-ut-element="allowed-content"
/>
</div>
</div>
</body>
Ignored nodes: comments, script, style
<html>
<head />
<body>
<div>
<div
class="flex flex-col items-center justify-center gap-1"
data-state="readying"
>
<label
class="group relative flex h-10 w-36 cursor-pointer items-center justify-center overflow-hidden rounded-md text-white after:transition-[width] after:duration-500 focus-within:ring-2 focus-within:ring-blue-600 focus-within:ring-offset-2 cursor-not-allowed bg-blue-400"
data-state="readying"
data-ut-element="button"
>
<input
accept=""
class="sr-only"
tabindex="0"
type="file"
/>
Loading...
</label>
<div
class="h-[1.25rem] text-xs leading-5 text-gray-600"
data-state="readying"
data-ut-element="allowed-content"
/>
</div>
</div>
</body>
</html>
❯ Proxy.waitForWrapper ../../node_modules/@testing-library/dom/dist/wait-for.js:163:27
❯ test/upload-button.test.tsx:256:11
|
Test:
packages/react/test/upload-button.test.tsx#L281
TestingLibraryElementError: Unable to find an element with the text: Choose File. 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 flex-col items-center justify-center gap-1"
data-state="readying"
>
<label
class="group relative flex h-10 w-36 cursor-pointer items-center justify-center overflow-hidden rounded-md text-white after:transition-[width] after:duration-500 focus-within:ring-2 focus-within:ring-blue-600 focus-within:ring-offset-2 cursor-not-allowed bg-blue-400"
data-state="readying"
data-ut-element="button"
style="background-color: red;"
>
<input
accept=""
class="sr-only"
tabindex="0"
type="file"
/>
Loading...
</label>
<div
class="h-[1.25rem] text-xs leading-5 text-gray-600"
data-state="readying"
data-ut-element="allowed-content"
/>
</div>
</div>
</body>
Ignored nodes: comments, script, style
<html>
<head />
<body>
<div>
<div
class="flex flex-col items-center justify-center gap-1"
data-state="readying"
>
<label
class="group relative flex h-10 w-36 cursor-pointer items-center justify-center overflow-hidden rounded-md text-white after:transition-[width] after:duration-500 focus-within:ring-2 focus-within:ring-blue-600 focus-within:ring-offset-2 cursor-not-allowed bg-blue-400"
data-state="readying"
data-ut-element="button"
style="background-color: red;"
>
<input
accept=""
class="sr-only"
tabindex="0"
type="file"
/>
Loading...
</label>
<div
class="h-[1.25rem] text-xs leading-5 text-gray-600"
data-state="readying"
data-ut-element="allowed-content"
/>
</div>
</div>
</body>
</html>
❯ Proxy.waitForWrapper ../../node_modules/@testing-library/dom/dist/wait-for.js:163:27
❯ test/upload-button.test.tsx:281:11
|
Test:
packages/uploadthing/test/client.test.ts#L250
AssertionError: expected "spy" to be called with arguments: [ Any<String>, ObjectContaining{…} ]
Received:
1st spy call:
Array [
- Any<String>,
- ObjectContaining {
- "body": Any<FormData>,
+ "http://localhost:39605/api/uploadthing?actionType=upload&slug=foo",
+ Object {
+ "body": "{\"files\":[{\"name\":\"foo.txt\",\"size\":3,\"type\":\"text/plain\",\"lastModified\":1734969336283}]}",
+ "headers": Headers {
+ Symbol(entries): Object {
+ "content-type": Object {
+ "name": "Content-Type",
+ "value": Array [
+ "application/json",
+ ],
+ },
+ "x-uploadthing-package": Object {
+ "name": "x-uploadthing-package",
+ "value": Array [
+ "vitest",
+ ],
+ },
+ "x-uploadthing-version": Object {
+ "name": "x-uploadthing-version",
+ "value": Array [
+ "7.4.1",
+ ],
+ },
+ },
+ },
"method": "POST",
+ "signal": AbortSignal {
+ "aborted": false,
+ "onabort": null,
+ "reason": null,
+ Symbol(listeners): Object {
+ "abort": Array [
+ [Function anonymous],
+ [Function abort],
+ ],
+ },
+ Symbol(listenerOptions): Object {
+ "abort": Array [
+ Object {
+ "once": true,
+ },
+ Object {
+ "once": true,
+ },
+ ],
+ },
+ },
},
]
2nd spy call:
Array [
- Any<String>,
- ObjectContaining {
- "body": Any<FormData>,
- "method": "POST",
+ "https://fra1.ingest.uploadthing.com/u7rKiJYp268sQrjyl3cc2DHM7ZGTOa6Jxhr8FojUqIyXbAB4?expires=1734972936309&x-ut-identifier=app-1&x-ut-file-name=foo.txt&x-ut-file-size=3&x-ut-file-type=text%252Fplain&x-ut-slug=foo&x-ut-content-disposition=inline&signature=hmac-sha256%3D5fd81b653c1f235fba5009b100efaf53f9c491f311a205766cb60747a81a3215",
+ Object {
+ "headers": Headers {
+ Symbol(entries): Object {},
+ },
+ "method": "HEAD",
+ "signal": AbortSignal {
+ "aborted": false,
+ "onabort": null,
+ "reason": null,
+ Symbol(listeners): Object {
+ "abort": Array [
+ [Function anonymous],
+ ],
+ },
+ Symbol(listenerOptions): Object {
+ "abort": Array [
+ Object {
+ "once": true,
+ },
+ ],
+ },
+ },
},
]
Number of calls: 2
❯ test/client.test.ts:250:21
|
Test
Process completed with exit code 1.
|
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
Loading