jeudi 27 juillet 2017

jQuery [object Object] is not a valid selector

I am trying to select tree-node element with children and first child but it is not a valid selector.

<g class="nodes">
   <g class="tree-node enter" id="tree-node-cdl3c5he">
      <g class="node-group">
        <circle class="node-shape" r="80"></circle>
        <g class="node-label-group" transform="translate(-80,-80)">
        <foreignObject class="node-content-container" width="160" height="160">
        <div class="node-content">
         <div class="inner">
          <div class="node-label" data-test-id="node-label-new-part">New Part</div>
        </div></div></foreignObject></g><g class="root-group" transform="translate(0,-80)"><circle class="root-shape" r="15"></circle></g>
</g>
</g>
</g>

Using first child:

$('.nodes > .tree-node:first-child')

Ember test:

await click($('.nodes > .tree-node:first-child'));

Error: Failed to execute 'querySelector' on 'Document': '#ember-testing [object Object]' is not a valid selector.




Aucun commentaire:

Enregistrer un commentaire