Coding is as much a matter of personal growth as it is of logic and control-flow. I keep patience, curiosity, & exuberance in the same toolbox as vim and git.
*Opinions posted are my own*
if your goal is to test that the shadow root renders the way you expect, I suggest using the open-wc package semantic-dom-diff, which is built-in to open-wc's testing setup, like so:
import{expect,fixture}from`@open-wc/testing`;describe('skyscanner flight search',function(){it('should render the correct Shadow DOM',asyncfunction(){constel=awaitfixture(`<skyscanner-flight-search></skyscanner-flight-search>`);awaitwindow.customElements.whenDefined('skyscanner-flight-search')expect(el).shadowDom.to.equal(`
<!-- this dom string will be semantically compared to the real dom -->
<!-- comments will be stripped out -->
<!-- and you'll get a helpful diff as otuput if you use open-wc's testing setup -->
<div id="firstDiv"></div>
<input id="inputSessionKey"/>
`);});});
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
if your goal is to test that the shadow root renders the way you expect, I suggest using the open-wc package
semantic-dom-diff
, which is built-in to open-wc's testing setup, like so: