Socket
Socket
Sign inDemoInstall

shadow-dom-testing-library

Package Overview
Dependencies
122
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.6.0 to 1.6.1

2

dist/index.js

@@ -1,2 +0,2 @@

var ue=Object.defineProperty;var se=(e,t)=>{for(var a in t)ue(e,a,{get:t[a],enumerable:!0})};import{queries as Ne,within as We}from"@testing-library/dom";var f={};se(f,{findAllByShadowAltText:()=>Y,findAllByShadowDisplayValue:()=>k,findAllByShadowLabelText:()=>q,findAllByShadowPlaceholderText:()=>H,findAllByShadowRole:()=>E,findAllByShadowTestId:()=>le,findAllByShadowText:()=>$,findAllByShadowTitle:()=>Z,findByShadowAltText:()=>z,findByShadowDisplayValue:()=>v,findByShadowLabelText:()=>g,findByShadowPlaceholderText:()=>I,findByShadowRole:()=>x,findByShadowTestId:()=>ne,findByShadowText:()=>F,findByShadowTitle:()=>ee,getAllByShadowAltText:()=>N,getAllByShadowDisplayValue:()=>C,getAllByShadowLabelText:()=>L,getAllByShadowPlaceholderText:()=>b,getAllByShadowRole:()=>p,getAllByShadowTestId:()=>oe,getAllByShadowText:()=>V,getAllByShadowTitle:()=>K,getByShadowAltText:()=>W,getByShadowDisplayValue:()=>j,getByShadowLabelText:()=>R,getByShadowPlaceholderText:()=>D,getByShadowRole:()=>A,getByShadowTestId:()=>ae,getByShadowText:()=>_,getByShadowTitle:()=>X,queryAllByShadowAltText:()=>w,queryAllByShadowDisplayValue:()=>S,queryAllByShadowLabelText:()=>s,queryAllByShadowPlaceholderText:()=>m,queryAllByShadowRole:()=>u,queryAllByShadowTestId:()=>T,queryAllByShadowText:()=>i,queryAllByShadowTitle:()=>y,queryByShadowAltText:()=>J,queryByShadowDisplayValue:()=>U,queryByShadowLabelText:()=>P,queryByShadowPlaceholderText:()=>Q,queryByShadowRole:()=>B,queryByShadowTestId:()=>te,queryByShadowText:()=>O,queryByShadowTitle:()=>G});import{buildQueries as d,queryAllByRole as ie,queryAllByLabelText as Se,queryAllByPlaceholderText as we,queryAllByText as ye,queryAllByDisplayValue as Te,queryAllByAltText as fe,queryAllByTitle as Me,queryAllByTestId as Be}from"@testing-library/dom";function me(e,t,a={shallow:!1},o=[]){let l=n(e,t,a,o);return Array.isArray(l)&&l.length>0?l[0]:null}function n(e,t,a={shallow:!1},o=[]){return e instanceof Document&&(e=document.documentElement),o.push(e),e instanceof HTMLElement&&e.shadowRoot!=null&&e.shadowRoot.mode!=="closed"&&o.push(e.shadowRoot),e.querySelectorAll(t).forEach(l=>{if(l.shadowRoot==null||l.shadowRoot.mode==="closed"){o.push(l);return}if(o.push(l.shadowRoot),a.shallow===!0){l.shadowRoot.querySelectorAll(t).forEach(r=>o.push(r));return}l.shadowRoot.querySelectorAll(t).forEach(r=>o.push(r)),n(l.shadowRoot,t,a,o)}),[...new Set(o)]}var h="*";function c(e){return e.map(t=>(...a)=>{let[o,l,r,...ce]=a;return r==null&&(r={}),r.suggest=!1,t(o,l,r,...ce)})}function u(...e){let[t,a,o]=e;return o==null&&(o={}),o.suggest=!1,[...new Set(n(t,h,o).map(l=>ie(l,a,o)).flat(1/0))]}var pe=(e,t)=>`Found multiple elements with the role of: ${t}`,Ae=(e,t)=>`Unable to find an element with the role of: ${t}`,[B,p,A,E,x]=c(d(u,pe,Ae));function s(...e){let[t,a,o]=e;return o==null&&(o={}),o.suggest=!1,[...new Set(n(t,h,o).map(l=>Se(l,a,o)).flat(1/0))]}var Ee=(e,t)=>`Found multiple elements with the label text of: ${t}`,xe=(e,t)=>`Unable to find an element with the label text of: ${t}`,[P,L,R,q,g]=c(d(s,Ee,xe));function m(...e){let[t,a,o]=e;return o==null&&(o={}),o.suggest=!1,[...new Set(n(t,h,o).map(l=>we(l,a,o)).flat(1/0))]}var Pe=(e,t)=>`Found multiple elements with the placeholder text of: ${t}`,Le=(e,t)=>`Unable to find an element with the placeholder text of: ${t}`,[Q,b,D,H,I]=c(d(m,Pe,Le));function i(...e){let[t,a,o]=e;return o==null&&(o={}),o.suggest=!1,[...new Set(n(t,h,o).map(l=>ye(l,a,o)).flat(1/0))]}var Re=(e,t)=>`Found multiple elements with the text of: ${t}`,qe=(e,t)=>`Unable to find an element with the text of: ${t}`,[O,V,_,$,F]=c(d(i,Re,qe));function S(...e){let[t,a,o]=e;return o==null&&(o={}),o.suggest=!1,[...new Set(n(t,h,o).map(l=>Te(l,a,o)).flat(1/0))]}var ge=(e,t)=>`Found multiple elements with the display value of: ${t}`,Qe=(e,t)=>`Unable to find an element with the display value of: ${t}`,[U,C,j,k,v]=c(d(S,ge,Qe));function w(...e){let[t,a,o]=e;return o==null&&(o={}),o.suggest=!1,[...new Set(n(t,h,o).map(l=>fe(l,a,o)).flat(1/0))]}var be=(e,t)=>`Found multiple elements with the alt text of: ${t}`,De=(e,t)=>`Unable to find an element with the alt text of: ${t}`,[J,N,W,Y,z]=c(d(w,be,De));function y(...e){let[t,a,o]=e;return o==null&&(o={}),o.suggest=!1,[...new Set(n(t,h,o).map(l=>Me(l,a,o)).flat(1/0))]}var He=(e,t)=>`Found multiple elements with the title of: ${t}`,Ie=(e,t)=>`Unable to find an element with the title of: ${t}`,[G,K,X,Z,ee]=c(d(y,He,Ie));function T(...e){let[t,a,o]=e;return o==null&&(o={}),o.suggest=!1,[...new Set(n(t,h,o).map(l=>Be(l,a,o)).flat(1/0))]}var Oe=(e,t)=>`Found multiple elements with the test id of: ${t}`,Ve=(e,t)=>`Unable to find an element with the test id of: ${t}`,[te,oe,ae,le,ne]=c(d(T,Oe,Ve));import{logDOM as ke}from"@testing-library/dom";import{TextEncoder as _e,TextDecoder as $e}from"util";global.TextEncoder=_e;global.TextDecoder=$e;import{prettyDOM as Fe}from"@testing-library/dom";import{JSDOM as Ue}from"jsdom";function Ce(...e){let[t,a,o]=e;return Fe(re(t),a,o)}function re(e){e==null&&(e=document.documentElement);let t="";"outerHTML"in e&&(t=e.outerHTML),t=je(e,t),t=t.replace(/<!--.*?-->/g,""),t=t.replace(/>\s+</g,"><");let a=new Ue(t);return e instanceof Document||e instanceof HTMLHtmlElement||e instanceof HTMLBodyElement?a.window.document.body:a.window.document.body.firstElementChild}function je(e,t="",a=Array.from(e.children)){for(("shadowRoot"in e)&&e.shadowRoot!=null&&a.unshift(e.shadowRoot),a.unshift(e);a.length>0;){let o=a.shift();if(o&&"shadowRoot"in o&&o.shadowRoot!=null){let l=o.outerHTML,r=document.createElement("shadow-root");r.innerHTML=o.shadowRoot.innerHTML,o.insertAdjacentElement("afterbegin",r),t=t.replace(l,o.outerHTML),a.push(...Array.from(o.shadowRoot.children))}a.push(...Array.from(o.children))}return t}function M(...e){let[t,a,o]=e;ke(re(t),a,o)}function de(...e){let[t,a,o]=e;Array.isArray(t)?t.forEach(l=>M(l,a,o)):M(t,a,o)}import{screen as ve}from"@testing-library/dom";var Je={...ve,debug:de,queryAllByShadowRole:(...e)=>u(document.documentElement,e[0],e[1]),queryByShadowRole:(...e)=>B(document.documentElement,e[0],e[1]),getAllByShadowRole:(...e)=>p(document.documentElement,e[0],e[1]),getByShadowRole:(...e)=>A(document.documentElement,e[0],e[1]),findAllByShadowRole:(...e)=>E(document.documentElement,e[0],e[1],e[2]),findByShadowRole:(...e)=>x(document.documentElement,e[0],e[1],e[2]),queryAllByShadowLabelText:(...e)=>s(document.documentElement,e[0],e[1]),queryByShadowLabelText:(...e)=>P(document.documentElement,e[0],e[1]),getAllByShadowLabelText:(...e)=>L(document.documentElement,e[0],e[1]),getByShadowLabelText:(...e)=>R(document.documentElement,e[0],e[1]),findAllByShadowLabelText:(...e)=>q(document.documentElement,e[0],e[1],e[2]),findByShadowLabelText:(...e)=>g(document.documentElement,e[0],e[1],e[2]),queryAllByShadowPlaceholderText:(...e)=>m(document.documentElement,e[0],e[1]),queryByShadowPlaceholderText:(...e)=>Q(document.documentElement,e[0],e[1]),getAllByShadowPlaceholderText:(...e)=>b(document.documentElement,e[0],e[1]),getByShadowPlaceholderText:(...e)=>D(document.documentElement,e[0],e[1]),findAllByShadowPlaceholderText:(...e)=>H(document.documentElement,e[0],e[1],e[2]),findByShadowPlaceholderText:(...e)=>I(document.documentElement,e[0],e[1],e[2]),queryAllByShadowText:(...e)=>i(document.documentElement,e[0],e[1]),queryByShadowText:(...e)=>O(document.documentElement,e[0],e[1]),getAllByShadowText:(...e)=>V(document.documentElement,e[0],e[1]),getByShadowText:(...e)=>_(document.documentElement,e[0],e[1]),findAllByShadowText:(...e)=>$(document.documentElement,e[0],e[1],e[2]),findByShadowText:(...e)=>F(document.documentElement,e[0],e[1],e[2]),queryAllByShadowDisplayValue:(...e)=>S(document.documentElement,e[0],e[1]),queryByShadowDisplayValue:(...e)=>U(document.documentElement,e[0],e[1]),getAllByShadowDisplayValue:(...e)=>C(document.documentElement,e[0],e[1]),getByShadowDisplayValue:(...e)=>j(document.documentElement,e[0],e[1]),findAllByShadowDisplayValue:(...e)=>k(document.documentElement,e[0],e[1],e[2]),findByShadowDisplayValue:(...e)=>v(document.documentElement,e[0],e[1],e[2]),queryAllByShadowAltText:(...e)=>w(document.documentElement,e[0],e[1]),queryByShadowAltText:(...e)=>J(document.documentElement,e[0],e[1]),getAllByShadowAltText:(...e)=>N(document.documentElement,e[0],e[1]),getByShadowAltText:(...e)=>W(document.documentElement,e[0],e[1]),findAllByShadowAltText:(...e)=>Y(document.documentElement,e[0],e[1],e[2]),findByShadowAltText:(...e)=>z(document.documentElement,e[0],e[1],e[2]),queryAllByShadowTitle:(...e)=>y(document.documentElement,e[0],e[1]),queryByShadowTitle:(...e)=>G(document.documentElement,e[0],e[1]),getAllByShadowTitle:(...e)=>K(document.documentElement,e[0],e[1]),getByShadowTitle:(...e)=>X(document.documentElement,e[0],e[1]),findAllByShadowTitle:(...e)=>Z(document.documentElement,e[0],e[1],e[2]),findByShadowTitle:(...e)=>ee(document.documentElement,e[0],e[1],e[2]),queryAllByShadowTestId:(...e)=>T(document.documentElement,e[0],e[1]),queryByShadowTestId:(...e)=>te(document.documentElement,e[0],e[1]),getAllByShadowTestId:(...e)=>oe(document.documentElement,e[0],e[1]),getByShadowTestId:(...e)=>ae(document.documentElement,e[0],e[1]),findAllByShadowTestId:(...e)=>le(document.documentElement,e[0],e[1],e[2]),findByShadowTestId:(...e)=>ne(document.documentElement,e[0],e[1],e[2])};function he(){if(typeof ShadowRoot>"u")throw"Your environment does not support shadow roots.";ShadowRoot.prototype.matches==null&&Object.defineProperties(ShadowRoot.prototype,{matches:{get(){return function(e){return e.trim()==="*"?!0:this.querySelector(e)!=null}}}}),ShadowRoot.prototype.outerHTML==null&&Object.defineProperties(ShadowRoot.prototype,{outerHTML:{get(){return this.innerHTML}}})}he();var Ye={...Ne,...f};function pt(e){return We(e,Ye)}export{de as debug,me as deepQuerySelector,n as deepQuerySelectorAll,Y as findAllByShadowAltText,k as findAllByShadowDisplayValue,q as findAllByShadowLabelText,H as findAllByShadowPlaceholderText,E as findAllByShadowRole,le as findAllByShadowTestId,$ as findAllByShadowText,Z as findAllByShadowTitle,z as findByShadowAltText,v as findByShadowDisplayValue,g as findByShadowLabelText,I as findByShadowPlaceholderText,x as findByShadowRole,ne as findByShadowTestId,F as findByShadowText,ee as findByShadowTitle,N as getAllByShadowAltText,C as getAllByShadowDisplayValue,L as getAllByShadowLabelText,b as getAllByShadowPlaceholderText,p as getAllByShadowRole,oe as getAllByShadowTestId,V as getAllByShadowText,K as getAllByShadowTitle,W as getByShadowAltText,j as getByShadowDisplayValue,R as getByShadowLabelText,D as getByShadowPlaceholderText,A as getByShadowRole,ae as getByShadowTestId,_ as getByShadowText,X as getByShadowTitle,M as logShadowDOM,Ce as prettyShadowDOM,w as queryAllByShadowAltText,S as queryAllByShadowDisplayValue,s as queryAllByShadowLabelText,m as queryAllByShadowPlaceholderText,u as queryAllByShadowRole,T as queryAllByShadowTestId,i as queryAllByShadowText,y as queryAllByShadowTitle,J as queryByShadowAltText,U as queryByShadowDisplayValue,P as queryByShadowLabelText,Q as queryByShadowPlaceholderText,B as queryByShadowRole,te as queryByShadowTestId,O as queryByShadowText,G as queryByShadowTitle,Je as screen,pt as within};
var ue=Object.defineProperty;var se=(e,t)=>{for(var a in t)ue(e,a,{get:t[a],enumerable:!0})};import{queries as Je,within as We}from"@testing-library/dom";var M={};se(M,{findAllByShadowAltText:()=>z,findAllByShadowDisplayValue:()=>k,findAllByShadowLabelText:()=>Q,findAllByShadowPlaceholderText:()=>I,findAllByShadowRole:()=>x,findAllByShadowTestId:()=>ne,findAllByShadowText:()=>F,findAllByShadowTitle:()=>ee,findByShadowAltText:()=>G,findByShadowDisplayValue:()=>v,findByShadowLabelText:()=>g,findByShadowPlaceholderText:()=>O,findByShadowRole:()=>P,findByShadowTestId:()=>re,findByShadowText:()=>U,findByShadowTitle:()=>te,getAllByShadowAltText:()=>W,getAllByShadowDisplayValue:()=>N,getAllByShadowLabelText:()=>R,getAllByShadowPlaceholderText:()=>D,getAllByShadowRole:()=>A,getAllByShadowTestId:()=>ae,getAllByShadowText:()=>_,getAllByShadowTitle:()=>X,getByShadowAltText:()=>Y,getByShadowDisplayValue:()=>j,getByShadowLabelText:()=>q,getByShadowPlaceholderText:()=>H,getByShadowRole:()=>E,getByShadowTestId:()=>le,getByShadowText:()=>$,getByShadowTitle:()=>Z,queryAllByShadowAltText:()=>y,queryAllByShadowDisplayValue:()=>w,queryAllByShadowLabelText:()=>m,queryAllByShadowPlaceholderText:()=>i,queryAllByShadowRole:()=>s,queryAllByShadowTestId:()=>f,queryAllByShadowText:()=>S,queryAllByShadowTitle:()=>T,queryByShadowAltText:()=>J,queryByShadowDisplayValue:()=>C,queryByShadowLabelText:()=>L,queryByShadowPlaceholderText:()=>b,queryByShadowRole:()=>p,queryByShadowTestId:()=>oe,queryByShadowText:()=>V,queryByShadowTitle:()=>K});import{buildQueries as d,queryAllByRole as ie,queryAllByLabelText as Se,queryAllByPlaceholderText as we,queryAllByText as ye,queryAllByDisplayValue as Te,queryAllByAltText as fe,queryAllByTitle as Me,queryAllByTestId as Be}from"@testing-library/dom";function me(e,t,a={shallow:!1},o=[]){let l=n(e,t,a,o);return Array.isArray(l)&&l.length>0?l[0]:null}function n(e,t,a={shallow:!1},o=[]){return e instanceof Document&&(e=document.documentElement),o.push(e),e instanceof HTMLElement&&e.shadowRoot!=null&&e.shadowRoot.mode!=="closed"&&o.push(e.shadowRoot),e.querySelectorAll(t).forEach(l=>{if(l.shadowRoot==null||l.shadowRoot.mode==="closed"){o.push(l);return}if(o.push(l.shadowRoot),a.shallow===!0){l.shadowRoot.querySelectorAll(t).forEach(r=>o.push(r));return}l.shadowRoot.querySelectorAll(t).forEach(r=>o.push(r)),n(l.shadowRoot,t,a,o)}),[...new Set(o)]}var h="*";function c(e){return e.map(t=>(...a)=>{let[o,l,r,...u]=a;return r==null&&(r={}),r.suggest=!1,t(o,l,r,...u)})}function s(...e){let[t,a,o]=e;return o==null&&(o={}),o.suggest=!1,[...new Set(n(t,h,o).map(l=>ie(l,a,o)).flat(1/0))]}var pe=(e,t)=>`Found multiple elements with the role of: ${t}`,Ae=(e,t)=>`Unable to find an element with the role of: ${t}`,[p,A,E,x,P]=c(d(s,pe,Ae));function m(...e){let[t,a,o]=e;return o==null&&(o={}),o.suggest=!1,[...new Set(n(t,h,o).map(l=>Se(l,a,o)).flat(1/0))]}var Ee=(e,t)=>`Found multiple elements with the label text of: ${t}`,xe=(e,t)=>`Unable to find an element with the label text of: ${t}`,[L,R,q,Q,g]=c(d(m,Ee,xe));function i(...e){let[t,a,o]=e;return o==null&&(o={}),o.suggest=!1,[...new Set(n(t,h,o).map(l=>we(l,a,o)).flat(1/0))]}var Pe=(e,t)=>`Found multiple elements with the placeholder text of: ${t}`,Le=(e,t)=>`Unable to find an element with the placeholder text of: ${t}`,[b,D,H,I,O]=c(d(i,Pe,Le));function S(...e){let[t,a,o]=e;return o==null&&(o={}),o.suggest=!1,[...new Set(n(t,h,o).map(l=>ye(l,a,o)).flat(1/0))]}var Re=(e,t)=>`Found multiple elements with the text of: ${t}`,qe=(e,t)=>`Unable to find an element with the text of: ${t}`,[V,_,$,F,U]=c(d(S,Re,qe));function w(...e){let[t,a,o]=e;return o==null&&(o={}),o.suggest=!1,[...new Set(n(t,h,o).map(l=>Te(l,a,o)).flat(1/0))]}var Qe=(e,t)=>`Found multiple elements with the display value of: ${t}`,ge=(e,t)=>`Unable to find an element with the display value of: ${t}`,[C,N,j,k,v]=c(d(w,Qe,ge));function y(...e){let[t,a,o]=e;return o==null&&(o={}),o.suggest=!1,[...new Set(n(t,h,o).map(l=>fe(l,a,o)).flat(1/0))]}var be=(e,t)=>`Found multiple elements with the alt text of: ${t}`,De=(e,t)=>`Unable to find an element with the alt text of: ${t}`,[J,W,Y,z,G]=c(d(y,be,De));function T(...e){let[t,a,o]=e;return o==null&&(o={}),o.suggest=!1,[...new Set(n(t,h,o).map(l=>Me(l,a,o)).flat(1/0))]}var He=(e,t)=>`Found multiple elements with the title of: ${t}`,Ie=(e,t)=>`Unable to find an element with the title of: ${t}`,[K,X,Z,ee,te]=c(d(T,He,Ie));function f(...e){let[t,a,o]=e;return o==null&&(o={}),o.suggest=!1,[...new Set(n(t,h,o).map(l=>Be(l,a,o)).flat(1/0))]}var Oe=(e,t)=>`Found multiple elements with the test id of: ${t}`,Ve=(e,t)=>`Unable to find an element with the test id of: ${t}`,[oe,ae,le,ne,re]=c(d(f,Oe,Ve));import{logDOM as je}from"@testing-library/dom";import{TextEncoder as _e,TextDecoder as $e}from"util";global.TextEncoder=_e;global.TextDecoder=$e;import{prettyDOM as Fe}from"@testing-library/dom";import{JSDOM as Ue}from"jsdom";function Ce(...e){let[t,a,o]=e;return Fe(de(t),a,o)}function de(e){e==null&&(e=document.documentElement);let t="";"outerHTML"in e&&(t=e.outerHTML),t=Ne(e,t),t=t.replace(/<!--.*?-->/g,""),t=t.replace(/>\s+</g,"><");let a=new Ue(t);return e instanceof Document||e instanceof HTMLHtmlElement||e instanceof HTMLBodyElement?a.window.document.body:a.window.document.body.firstElementChild}function Ne(e,t="",a=Array.from(e.children)){for(("shadowRoot"in e)&&e.shadowRoot!=null&&a.unshift(e.shadowRoot),a.unshift(e);a.length>0;){let o=a.shift();if(o&&"shadowRoot"in o&&o.shadowRoot!=null){let l=o.outerHTML,r=document.createElement("shadow-root");r.innerHTML=o.shadowRoot.innerHTML;let u=o.cloneNode(!0);u.insertAdjacentElement("afterbegin",r),t=t.replace(l,u.outerHTML),t=t.replace(l,o.outerHTML),a.push(...Array.from(o.shadowRoot.children))}a.push(...Array.from(o.children))}return t}function B(...e){let[t,a,o]=e;je(de(t),a,o)}function he(...e){let[t,a,o]=e;Array.isArray(t)?t.forEach(l=>B(l,a,o)):B(t,a,o)}import{screen as ke}from"@testing-library/dom";var ve={...ke,debug:he,queryAllByShadowRole:(...e)=>s(document.documentElement,e[0],e[1]),queryByShadowRole:(...e)=>p(document.documentElement,e[0],e[1]),getAllByShadowRole:(...e)=>A(document.documentElement,e[0],e[1]),getByShadowRole:(...e)=>E(document.documentElement,e[0],e[1]),findAllByShadowRole:(...e)=>x(document.documentElement,e[0],e[1],e[2]),findByShadowRole:(...e)=>P(document.documentElement,e[0],e[1],e[2]),queryAllByShadowLabelText:(...e)=>m(document.documentElement,e[0],e[1]),queryByShadowLabelText:(...e)=>L(document.documentElement,e[0],e[1]),getAllByShadowLabelText:(...e)=>R(document.documentElement,e[0],e[1]),getByShadowLabelText:(...e)=>q(document.documentElement,e[0],e[1]),findAllByShadowLabelText:(...e)=>Q(document.documentElement,e[0],e[1],e[2]),findByShadowLabelText:(...e)=>g(document.documentElement,e[0],e[1],e[2]),queryAllByShadowPlaceholderText:(...e)=>i(document.documentElement,e[0],e[1]),queryByShadowPlaceholderText:(...e)=>b(document.documentElement,e[0],e[1]),getAllByShadowPlaceholderText:(...e)=>D(document.documentElement,e[0],e[1]),getByShadowPlaceholderText:(...e)=>H(document.documentElement,e[0],e[1]),findAllByShadowPlaceholderText:(...e)=>I(document.documentElement,e[0],e[1],e[2]),findByShadowPlaceholderText:(...e)=>O(document.documentElement,e[0],e[1],e[2]),queryAllByShadowText:(...e)=>S(document.documentElement,e[0],e[1]),queryByShadowText:(...e)=>V(document.documentElement,e[0],e[1]),getAllByShadowText:(...e)=>_(document.documentElement,e[0],e[1]),getByShadowText:(...e)=>$(document.documentElement,e[0],e[1]),findAllByShadowText:(...e)=>F(document.documentElement,e[0],e[1],e[2]),findByShadowText:(...e)=>U(document.documentElement,e[0],e[1],e[2]),queryAllByShadowDisplayValue:(...e)=>w(document.documentElement,e[0],e[1]),queryByShadowDisplayValue:(...e)=>C(document.documentElement,e[0],e[1]),getAllByShadowDisplayValue:(...e)=>N(document.documentElement,e[0],e[1]),getByShadowDisplayValue:(...e)=>j(document.documentElement,e[0],e[1]),findAllByShadowDisplayValue:(...e)=>k(document.documentElement,e[0],e[1],e[2]),findByShadowDisplayValue:(...e)=>v(document.documentElement,e[0],e[1],e[2]),queryAllByShadowAltText:(...e)=>y(document.documentElement,e[0],e[1]),queryByShadowAltText:(...e)=>J(document.documentElement,e[0],e[1]),getAllByShadowAltText:(...e)=>W(document.documentElement,e[0],e[1]),getByShadowAltText:(...e)=>Y(document.documentElement,e[0],e[1]),findAllByShadowAltText:(...e)=>z(document.documentElement,e[0],e[1],e[2]),findByShadowAltText:(...e)=>G(document.documentElement,e[0],e[1],e[2]),queryAllByShadowTitle:(...e)=>T(document.documentElement,e[0],e[1]),queryByShadowTitle:(...e)=>K(document.documentElement,e[0],e[1]),getAllByShadowTitle:(...e)=>X(document.documentElement,e[0],e[1]),getByShadowTitle:(...e)=>Z(document.documentElement,e[0],e[1]),findAllByShadowTitle:(...e)=>ee(document.documentElement,e[0],e[1],e[2]),findByShadowTitle:(...e)=>te(document.documentElement,e[0],e[1],e[2]),queryAllByShadowTestId:(...e)=>f(document.documentElement,e[0],e[1]),queryByShadowTestId:(...e)=>oe(document.documentElement,e[0],e[1]),getAllByShadowTestId:(...e)=>ae(document.documentElement,e[0],e[1]),getByShadowTestId:(...e)=>le(document.documentElement,e[0],e[1]),findAllByShadowTestId:(...e)=>ne(document.documentElement,e[0],e[1],e[2]),findByShadowTestId:(...e)=>re(document.documentElement,e[0],e[1],e[2])};function ce(){if(typeof ShadowRoot>"u")throw"Your environment does not support shadow roots.";ShadowRoot.prototype.matches==null&&Object.defineProperties(ShadowRoot.prototype,{matches:{get(){return function(e){return e.trim()==="*"?!0:this.querySelector(e)!=null}}}}),ShadowRoot.prototype.outerHTML==null&&Object.defineProperties(ShadowRoot.prototype,{outerHTML:{get(){return this.innerHTML}}})}ce();var Ye={...Je,...M};function pt(e){return We(e,Ye)}export{he as debug,me as deepQuerySelector,n as deepQuerySelectorAll,z as findAllByShadowAltText,k as findAllByShadowDisplayValue,Q as findAllByShadowLabelText,I as findAllByShadowPlaceholderText,x as findAllByShadowRole,ne as findAllByShadowTestId,F as findAllByShadowText,ee as findAllByShadowTitle,G as findByShadowAltText,v as findByShadowDisplayValue,g as findByShadowLabelText,O as findByShadowPlaceholderText,P as findByShadowRole,re as findByShadowTestId,U as findByShadowText,te as findByShadowTitle,W as getAllByShadowAltText,N as getAllByShadowDisplayValue,R as getAllByShadowLabelText,D as getAllByShadowPlaceholderText,A as getAllByShadowRole,ae as getAllByShadowTestId,_ as getAllByShadowText,X as getAllByShadowTitle,Y as getByShadowAltText,j as getByShadowDisplayValue,q as getByShadowLabelText,H as getByShadowPlaceholderText,E as getByShadowRole,le as getByShadowTestId,$ as getByShadowText,Z as getByShadowTitle,B as logShadowDOM,Ce as prettyShadowDOM,y as queryAllByShadowAltText,w as queryAllByShadowDisplayValue,m as queryAllByShadowLabelText,i as queryAllByShadowPlaceholderText,s as queryAllByShadowRole,f as queryAllByShadowTestId,S as queryAllByShadowText,T as queryAllByShadowTitle,J as queryByShadowAltText,C as queryByShadowDisplayValue,L as queryByShadowLabelText,b as queryByShadowPlaceholderText,p as queryByShadowRole,oe as queryByShadowTestId,V as queryByShadowText,K as queryByShadowTitle,ve as screen,pt as within};
//# sourceMappingURL=index.js.map

@@ -1,1 +0,1 @@

{"inputs":{"src/deep-query-selectors.ts":{"bytes":1882,"imports":[]},"src/shadow-queries.ts":{"bytes":10255,"imports":[{"path":"src/deep-query-selectors.ts","kind":"import-statement"}]},"src/jsdom-setup.ts":{"bytes":226,"imports":[]},"src/pretty-shadow-dom.ts":{"bytes":2102,"imports":[{"path":"src/jsdom-setup.ts","kind":"import-statement"}]},"src/log-shadow-dom.ts":{"bytes":282,"imports":[{"path":"src/pretty-shadow-dom.ts","kind":"import-statement"}]},"src/debug.ts":{"bytes":407,"imports":[{"path":"src/log-shadow-dom.ts","kind":"import-statement"}]},"src/shadow-screen.ts":{"bytes":9324,"imports":[{"path":"src/debug.ts","kind":"import-statement"},{"path":"src/shadow-queries.ts","kind":"import-statement"}]},"src/trick-dom-testing-library.ts":{"bytes":1227,"imports":[]},"src/types.ts":{"bytes":2196,"imports":[]},"src/index.ts":{"bytes":789,"imports":[{"path":"src/shadow-queries.ts","kind":"import-statement"},{"path":"src/debug.ts","kind":"import-statement"},{"path":"src/log-shadow-dom.ts","kind":"import-statement"},{"path":"src/pretty-shadow-dom.ts","kind":"import-statement"},{"path":"src/shadow-screen.ts","kind":"import-statement"},{"path":"src/trick-dom-testing-library.ts","kind":"import-statement"},{"path":"src/types.ts","kind":"import-statement"},{"path":"src/shadow-queries.ts","kind":"import-statement"},{"path":"src/deep-query-selectors.ts","kind":"import-statement"}]}},"outputs":{"dist/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":45085},"dist/index.cjs":{"imports":[],"exports":[],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":1651},"src/shadow-queries.ts":{"bytesInOutput":4060},"src/deep-query-selectors.ts":{"bytesInOutput":603},"src/log-shadow-dom.ts":{"bytesInOutput":94},"src/jsdom-setup.ts":{"bytesInOutput":91},"src/pretty-shadow-dom.ts":{"bytesInOutput":908},"src/debug.ts":{"bytesInOutput":80},"src/shadow-screen.ts":{"bytesInOutput":3431},"src/trick-dom-testing-library.ts":{"bytesInOutput":395}},"bytes":12931}}}
{"inputs":{"src/deep-query-selectors.ts":{"bytes":1882,"imports":[]},"src/shadow-queries.ts":{"bytes":10255,"imports":[{"path":"src/deep-query-selectors.ts","kind":"import-statement"}]},"src/jsdom-setup.ts":{"bytes":226,"imports":[]},"src/pretty-shadow-dom.ts":{"bytes":2239,"imports":[{"path":"src/jsdom-setup.ts","kind":"import-statement"}]},"src/log-shadow-dom.ts":{"bytes":282,"imports":[{"path":"src/pretty-shadow-dom.ts","kind":"import-statement"}]},"src/debug.ts":{"bytes":407,"imports":[{"path":"src/log-shadow-dom.ts","kind":"import-statement"}]},"src/shadow-screen.ts":{"bytes":9324,"imports":[{"path":"src/debug.ts","kind":"import-statement"},{"path":"src/shadow-queries.ts","kind":"import-statement"}]},"src/trick-dom-testing-library.ts":{"bytes":1227,"imports":[]},"src/types.ts":{"bytes":2196,"imports":[]},"src/index.ts":{"bytes":789,"imports":[{"path":"src/shadow-queries.ts","kind":"import-statement"},{"path":"src/debug.ts","kind":"import-statement"},{"path":"src/log-shadow-dom.ts","kind":"import-statement"},{"path":"src/pretty-shadow-dom.ts","kind":"import-statement"},{"path":"src/shadow-screen.ts","kind":"import-statement"},{"path":"src/trick-dom-testing-library.ts","kind":"import-statement"},{"path":"src/types.ts","kind":"import-statement"},{"path":"src/shadow-queries.ts","kind":"import-statement"},{"path":"src/deep-query-selectors.ts","kind":"import-statement"}]}},"outputs":{"dist/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":45315},"dist/index.cjs":{"imports":[],"exports":[],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":1652},"src/shadow-queries.ts":{"bytesInOutput":4060},"src/deep-query-selectors.ts":{"bytesInOutput":603},"src/log-shadow-dom.ts":{"bytesInOutput":94},"src/jsdom-setup.ts":{"bytesInOutput":91},"src/pretty-shadow-dom.ts":{"bytesInOutput":957},"src/debug.ts":{"bytesInOutput":80},"src/shadow-screen.ts":{"bytesInOutput":3432},"src/trick-dom-testing-library.ts":{"bytesInOutput":395}},"bytes":12982}}}

@@ -1,1 +0,1 @@

{"inputs":{"src/deep-query-selectors.ts":{"bytes":1882,"imports":[]},"src/shadow-queries.ts":{"bytes":10255,"imports":[{"path":"src/deep-query-selectors.ts","kind":"import-statement"}]},"src/jsdom-setup.ts":{"bytes":226,"imports":[]},"src/pretty-shadow-dom.ts":{"bytes":2102,"imports":[{"path":"src/jsdom-setup.ts","kind":"import-statement"}]},"src/log-shadow-dom.ts":{"bytes":282,"imports":[{"path":"src/pretty-shadow-dom.ts","kind":"import-statement"}]},"src/debug.ts":{"bytes":407,"imports":[{"path":"src/log-shadow-dom.ts","kind":"import-statement"}]},"src/shadow-screen.ts":{"bytes":9324,"imports":[{"path":"src/debug.ts","kind":"import-statement"},{"path":"src/shadow-queries.ts","kind":"import-statement"}]},"src/trick-dom-testing-library.ts":{"bytes":1227,"imports":[]},"src/types.ts":{"bytes":2196,"imports":[]},"src/index.ts":{"bytes":789,"imports":[{"path":"src/shadow-queries.ts","kind":"import-statement"},{"path":"src/debug.ts","kind":"import-statement"},{"path":"src/log-shadow-dom.ts","kind":"import-statement"},{"path":"src/pretty-shadow-dom.ts","kind":"import-statement"},{"path":"src/shadow-screen.ts","kind":"import-statement"},{"path":"src/trick-dom-testing-library.ts","kind":"import-statement"},{"path":"src/types.ts","kind":"import-statement"},{"path":"src/shadow-queries.ts","kind":"import-statement"},{"path":"src/deep-query-selectors.ts","kind":"import-statement"}]}},"outputs":{"dist/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":43597},"dist/index.js":{"imports":[],"exports":["debug","deepQuerySelector","deepQuerySelectorAll","findAllByShadowAltText","findAllByShadowDisplayValue","findAllByShadowLabelText","findAllByShadowPlaceholderText","findAllByShadowRole","findAllByShadowTestId","findAllByShadowText","findAllByShadowTitle","findByShadowAltText","findByShadowDisplayValue","findByShadowLabelText","findByShadowPlaceholderText","findByShadowRole","findByShadowTestId","findByShadowText","findByShadowTitle","getAllByShadowAltText","getAllByShadowDisplayValue","getAllByShadowLabelText","getAllByShadowPlaceholderText","getAllByShadowRole","getAllByShadowTestId","getAllByShadowText","getAllByShadowTitle","getByShadowAltText","getByShadowDisplayValue","getByShadowLabelText","getByShadowPlaceholderText","getByShadowRole","getByShadowTestId","getByShadowText","getByShadowTitle","logShadowDOM","prettyShadowDOM","queryAllByShadowAltText","queryAllByShadowDisplayValue","queryAllByShadowLabelText","queryAllByShadowPlaceholderText","queryAllByShadowRole","queryAllByShadowTestId","queryAllByShadowText","queryAllByShadowTitle","queryByShadowAltText","queryByShadowDisplayValue","queryByShadowLabelText","queryByShadowPlaceholderText","queryByShadowRole","queryByShadowTestId","queryByShadowText","queryByShadowTitle","screen","within"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":117},"src/shadow-queries.ts":{"bytesInOutput":3962},"src/deep-query-selectors.ts":{"bytesInOutput":603},"src/log-shadow-dom.ts":{"bytesInOutput":91},"src/jsdom-setup.ts":{"bytesInOutput":98},"src/pretty-shadow-dom.ts":{"bytesInOutput":911},"src/debug.ts":{"bytesInOutput":80},"src/shadow-screen.ts":{"bytesInOutput":3433},"src/trick-dom-testing-library.ts":{"bytesInOutput":395}},"bytes":11234}}}
{"inputs":{"src/deep-query-selectors.ts":{"bytes":1882,"imports":[]},"src/shadow-queries.ts":{"bytes":10255,"imports":[{"path":"src/deep-query-selectors.ts","kind":"import-statement"}]},"src/jsdom-setup.ts":{"bytes":226,"imports":[]},"src/pretty-shadow-dom.ts":{"bytes":2239,"imports":[{"path":"src/jsdom-setup.ts","kind":"import-statement"}]},"src/log-shadow-dom.ts":{"bytes":282,"imports":[{"path":"src/pretty-shadow-dom.ts","kind":"import-statement"}]},"src/debug.ts":{"bytes":407,"imports":[{"path":"src/log-shadow-dom.ts","kind":"import-statement"}]},"src/shadow-screen.ts":{"bytes":9324,"imports":[{"path":"src/debug.ts","kind":"import-statement"},{"path":"src/shadow-queries.ts","kind":"import-statement"}]},"src/trick-dom-testing-library.ts":{"bytes":1227,"imports":[]},"src/types.ts":{"bytes":2196,"imports":[]},"src/index.ts":{"bytes":789,"imports":[{"path":"src/shadow-queries.ts","kind":"import-statement"},{"path":"src/debug.ts","kind":"import-statement"},{"path":"src/log-shadow-dom.ts","kind":"import-statement"},{"path":"src/pretty-shadow-dom.ts","kind":"import-statement"},{"path":"src/shadow-screen.ts","kind":"import-statement"},{"path":"src/trick-dom-testing-library.ts","kind":"import-statement"},{"path":"src/types.ts","kind":"import-statement"},{"path":"src/shadow-queries.ts","kind":"import-statement"},{"path":"src/deep-query-selectors.ts","kind":"import-statement"}]}},"outputs":{"dist/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":43827},"dist/index.js":{"imports":[],"exports":["debug","deepQuerySelector","deepQuerySelectorAll","findAllByShadowAltText","findAllByShadowDisplayValue","findAllByShadowLabelText","findAllByShadowPlaceholderText","findAllByShadowRole","findAllByShadowTestId","findAllByShadowText","findAllByShadowTitle","findByShadowAltText","findByShadowDisplayValue","findByShadowLabelText","findByShadowPlaceholderText","findByShadowRole","findByShadowTestId","findByShadowText","findByShadowTitle","getAllByShadowAltText","getAllByShadowDisplayValue","getAllByShadowLabelText","getAllByShadowPlaceholderText","getAllByShadowRole","getAllByShadowTestId","getAllByShadowText","getAllByShadowTitle","getByShadowAltText","getByShadowDisplayValue","getByShadowLabelText","getByShadowPlaceholderText","getByShadowRole","getByShadowTestId","getByShadowText","getByShadowTitle","logShadowDOM","prettyShadowDOM","queryAllByShadowAltText","queryAllByShadowDisplayValue","queryAllByShadowLabelText","queryAllByShadowPlaceholderText","queryAllByShadowRole","queryAllByShadowTestId","queryAllByShadowText","queryAllByShadowTitle","queryByShadowAltText","queryByShadowDisplayValue","queryByShadowLabelText","queryByShadowPlaceholderText","queryByShadowRole","queryByShadowTestId","queryByShadowText","queryByShadowTitle","screen","within"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":117},"src/shadow-queries.ts":{"bytesInOutput":3962},"src/deep-query-selectors.ts":{"bytesInOutput":603},"src/log-shadow-dom.ts":{"bytesInOutput":91},"src/jsdom-setup.ts":{"bytesInOutput":98},"src/pretty-shadow-dom.ts":{"bytesInOutput":960},"src/debug.ts":{"bytesInOutput":80},"src/shadow-screen.ts":{"bytesInOutput":3434},"src/trick-dom-testing-library.ts":{"bytesInOutput":395}},"bytes":11285}}}
{
"name": "shadow-dom-testing-library",
"version": "1.6.0",
"version": "1.6.1",
"description": "An extension of DOM-testing-library to provide hooks into the shadow dom",

@@ -5,0 +5,0 @@ "type": "module",

@@ -64,4 +64,7 @@ import "./jsdom-setup";

node.insertAdjacentElement("afterbegin", shadowRootPseudoNode);
const clonedNode = node.cloneNode(true) as Element
clonedNode.insertAdjacentElement("afterbegin", shadowRootPseudoNode);
stringBuffer = stringBuffer.replace(outerHTML, clonedNode.outerHTML);
stringBuffer = stringBuffer.replace(outerHTML, node.outerHTML);

@@ -68,0 +71,0 @@ nodes.push(...Array.from(node.shadowRoot.children));

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc