You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am clicking a button and then i am expecting a new element to be rendered
What happened:
RUNS src/component/element/__tests__/asset.upload.spec.jsx
Test Suites: 0 of 1 total
Tests: 0 total
Snapshots: 0 total
Time: 5s, estimated 7s
console.log node_modules/react-testing-library/dist/index.js:59
<body>
<div>
<div
id="asset_upload_container"
>
<div
data-identity="asset container"
>
<div
id="8433d0a9-c7e2-4986-9c63-74ab9808132b"
>
<form>
<input
type="text"
value=""
/>
<label>
<div>
Asset
</div>
<input
type="file"
value=""
/>
</label>
</form>
<input
type="button"
value="remove"
/>
</div>
</div>
<input
FAIL src/component/element/__tests__/asset.upload.spec.jsx (7.732s)
AssetUpload Page
× add child uploads (4553ms)
√ remove child (2ms)
● AssetUpload Page › add child uploads
SyntaxError: '#8433d0a9-c7e2-4986-9c63-74ab9808132b' is not a valid selector
37 | const first_asset = await waitForElement(()=>dom.querySelector(`#${asset_key}`))
38 |
> 39 | // expect(first_asset).toBeDefined()
| ^
40 |
41 | })
42 |
at emit (node_modules/nwsapi/src/nwsapi.js:559:17)
at _querySelectorAll (node_modules/nwsapi/src/nwsapi.js:1451:9)
at Object._querySelector [as first] (node_modules/nwsapi/src/nwsapi.js:1387:14)
at HTMLDivElementImpl.<anonymous> (node_modules/jsdom/lib/jsdom/living/nodes/ParentNode-impl.js:65:42)
at HTMLDivElementImpl.querySelector (node_modules/jsdom/lib/jsdom/utils.js:123:45)
at HTMLDivElement.querySelector (node_modules/jsdom/lib/jsdom/living/generated/Element.js:708:45)
at src/component/element/__tests__/asset.upload.spec.tsx:39:58
at onMutation (node_modules/dom-testing-library/dist/wait-for-element.js:43:24)
at Promise (node_modules/dom-testing-library/dist/wait-for-element.js:59:5)
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 passed, 2 total
Snapshots: 0 total
Time: 10.012s
Ran all test suites matching /asset.upload/i.
//and other times i get
RUNS src/component/element/__tests__/asset.upload.spec.jsx
Test Suites: 0 of 1 total
Tests: 0 total
Snapshots: 0 total
console.log node_modules/react-testing-library/dist/index.js:59
<body>
<div>
<div
id="asset_upload_container"
>
<div
data-identity="asset container"
>
<div
id="a7dea6ec-5d3b-4fa6-97e9-50df75f7fbb3"
>
<form>
<input
type="text"
value=""
/>
<label>
<div>
Asset
</div>
<input
type="file"
value=""
/>
</label>
</form>
<input
type="button"
value="remove"
/>
</div>
</div>
<input
id="add_asset"
PASS src/component/element/__tests__/asset.upload.spec.jsx
AssetUpload Page
√ add child uploads (37ms)
√ remove child (2ms)
Test Suites: 1 passed, 1 total
Tests: 2 passed, 2 total
Snapshots: 0 total
Time: 3.164s
Reproduction:
Problem description:
Some times it renders correctly and gives me no errors other times it doesn't.
the code is complete synchronous, so i am expecting the same result everytime.
plus the message in the error is, Syntax is invalid.
I am pretty sure my div id is a correct format. It's just a uuid. Plus when i print my page debug i see the content of the page and it has the div with that id.
The uuid is generated randomly so i think sometimes it fails that test because it doesn't like the characters and other times it is okay with it.
Essentially a useless ticket, sorry if it wastes your time, figured out the issue. This can be closed.
dom-testing-library
version: 3.13.0react
version:16.7.0-alpha.2node
version:v10.11.0npm
(oryarn
) version :yarn 1.12.3Relevant code or config:
What you did:
I am clicking a button and then i am expecting a new element to be rendered
What happened:
Reproduction:
Problem description:
Some times it renders correctly and gives me no errors other times it doesn't.
the code is complete synchronous, so i am expecting the same result everytime.
plus the message in the error is, Syntax is invalid.
I am pretty sure my div id is a correct format. It's just a uuid. Plus when i print my page debug i see the content of the page and it has the div with that id.
The uuid is generated randomly so i think sometimes it fails that test because it doesn't like the characters and other times it is okay with it.
eg
Fails: 8433d0a9-c7e2-4986-9c63-74ab9808132b
Pass: a7dea6ec-5d3b-4fa6-97e9-50df75f7fbb3
My first guess is an id can't start with number?
I don't know if this is true tho?
Suggested solution:
I found the issue ids must start with a letter and you get this issue on chrome as well.
The text was updated successfully, but these errors were encountered: