shadow-dom-testing-library
Advanced tools
Comparing version 1.11.0 to 1.11.1
@@ -1,6 +0,6 @@ | ||
var Re=Object.defineProperty;var Le=(e,o)=>{for(var n in o)Re(e,n,{get:o[n],enumerable:!0})};import{queries as Tt,within as Mt,configure as Et,getConfig as Bt}from"@testing-library/dom";var x={};Le(x,{findAllByShadowAltText:()=>te,findAllByShadowDisplayValue:()=>J,findAllByShadowLabelText:()=>O,findAllByShadowPlaceholderText:()=>$,findAllByShadowRole:()=>Q,findAllByShadowTestId:()=>ue,findAllByShadowText:()=>k,findAllByShadowTitle:()=>ae,findByShadowAltText:()=>oe,findByShadowDisplayValue:()=>K,findByShadowLabelText:()=>N,findByShadowPlaceholderText:()=>F,findByShadowRole:()=>D,findByShadowTestId:()=>ie,findByShadowText:()=>G,findByShadowTitle:()=>de,getAllByShadowAltText:()=>v,getAllByShadowDisplayValue:()=>z,getAllByShadowLabelText:()=>H,getAllByShadowPlaceholderText:()=>V,getAllByShadowRole:()=>L,getAllByShadowTestId:()=>he,getAllByShadowText:()=>j,getAllByShadowTitle:()=>le,getByShadowAltText:()=>ee,getByShadowDisplayValue:()=>Y,getByShadowLabelText:()=>I,getByShadowPlaceholderText:()=>_,getByShadowRole:()=>q,getByShadowTestId:()=>se,getByShadowText:()=>W,getByShadowTitle:()=>re,queryAllByShadowAltText:()=>E,queryAllByShadowDisplayValue:()=>M,queryAllByShadowLabelText:()=>f,queryAllByShadowPlaceholderText:()=>p,queryAllByShadowRole:()=>y,queryAllByShadowTestId:()=>A,queryAllByShadowText:()=>T,queryAllByShadowTitle:()=>B,queryByShadowAltText:()=>Z,queryByShadowDisplayValue:()=>X,queryByShadowLabelText:()=>b,queryByShadowPlaceholderText:()=>C,queryByShadowRole:()=>R,queryByShadowTestId:()=>ce,queryByShadowText:()=>U,queryByShadowTitle:()=>ne});import{buildQueries as u,queryAllByRole as He,queryAllByLabelText as Ie,queryAllByPlaceholderText as Oe,queryAllByText as Ne,queryAllByDisplayValue as Ce,queryAllByAltText as Ve,queryAllByTitle as _e,queryAllByTestId as $e}from"@testing-library/dom";Qe();function qe(){De()}function ye(){HTMLSlotElement.prototype.querySelectorAll=HTMLElement.prototype.querySelectorAll}function d(e){qe();try{let o=e();return typeof o=="object"&&"finally"in o&&typeof o.finally=="function"&&o.finally(()=>ye()),o}finally{ye()}}function Qe(){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:Boolean(this.querySelector(e))}}}}),ShadowRoot.prototype.outerHTML==null&&Object.defineProperties(ShadowRoot.prototype,{outerHTML:{get(){return this.innerHTML}}})}function De(){HTMLSlotElement.prototype.querySelectorAll=function(e){let o=HTMLElement.prototype.querySelectorAll,n=[];return this.assignedElements({flatten:!0}).forEach(t=>{let l=t,r=document.createElement("div");r.appendChild(l.cloneNode(!1)),r.querySelector(e)&&n.push(l),n=n.concat(Array.from(l.querySelectorAll(e)))}),n.length==0&&(n=Array.from(o.call(this,e))),[...new Set(n)]}}function be(e,o,n={shallow:!1}){let t=fe(e,o,n);return Array.isArray(t)&&t.length>0?t[0]:null}function fe(e,o,n={shallow:!1}){return d(()=>{let l=h(e,n).map(r=>Array.from(r.querySelectorAll(o))).flat(1/0);return[...new Set(l)]})}function h(e,o={shallow:!1}){return pe(e,"*",o)}function pe(e,o,n={shallow:!1},t=[],l=[]){return e instanceof Document&&(e=document.documentElement),t=[e],l.push(e),e instanceof HTMLElement&&e.shadowRoot!=null&&e.shadowRoot.mode!=="closed"&&(l.push(e.shadowRoot),t.push(e.shadowRoot)),t.forEach(r=>{r.querySelectorAll(o).forEach(a=>{if(a.shadowRoot==null||a.shadowRoot.mode==="closed"){l.push(a);return}if(l.push(a.shadowRoot),n.shallow===!0){a.shadowRoot.querySelectorAll(o).forEach(c=>{l.push(c)});return}a.shadowRoot.querySelectorAll(o).forEach(c=>{l.push(c),t.push(c)}),pe(a.shadowRoot,o,n,t,l)})}),[...new Set(l)]}function i(e){return e.map(o=>(...n)=>{let[t,l,r,...a]=n;return r==null&&(r={}),r.suggest=!1,o(t,l,r,...a)})}function y(...e){let[o,n,t]=e;return t==null&&(t={}),t.suggest=!1,[...new Set(d(()=>h(o,t).map(l=>He(l,n,t)).flat(1/0)))]}var Fe=(e,o)=>`Found multiple elements with the role of: ${o}`,Ue=(e,o)=>`Unable to find an element with the role of: ${o}`,[R,L,q,Q,D]=i(u(y,Fe,Ue));function f(...e){let[o,n,t]=e;return t==null&&(t={}),t.suggest=!1,[...new Set(d(()=>h(o,t).map(l=>Ie(l,n,t)).flat(1/0)))]}var je=(e,o)=>`Found multiple elements with the label text of: ${o}`,We=(e,o)=>`Unable to find an element with the label text of: ${o}`,[b,H,I,O,N]=i(u(f,je,We));function p(...e){let[o,n,t]=e;return t==null&&(t={}),t.suggest=!1,[...new Set(d(()=>h(o,t).map(l=>Oe(l,n,t)).flat(1/0)))]}var ke=(e,o)=>`Found multiple elements with the placeholder text of: ${o}`,Ge=(e,o)=>`Unable to find an element with the placeholder text of: ${o}`,[C,V,_,$,F]=i(u(p,ke,Ge));function T(...e){let[o,n,t]=e;return t==null&&(t={}),t.suggest=!1,[...new Set(d(()=>h(o,t).map(l=>Ne(l,n,t)).flat(1/0)))]}var Xe=(e,o)=>`Found multiple elements with the text of: ${o}`,ze=(e,o)=>`Unable to find an element with the text of: ${o}`,[U,j,W,k,G]=i(u(T,Xe,ze));function M(...e){let[o,n,t]=e;return t==null&&(t={}),t.suggest=!1,[...new Set(d(()=>h(o,t).map(l=>Ce(l,n,t)).flat(1/0)))]}var Ye=(e,o)=>`Found multiple elements with the display value of: ${o}`,Je=(e,o)=>`Unable to find an element with the display value of: ${o}`,[X,z,Y,J,K]=i(u(M,Ye,Je));function E(...e){let[o,n,t]=e;return t==null&&(t={}),t.suggest=!1,[...new Set(d(()=>h(o,t).map(l=>Ve(l,n,t)).flat(1/0)))]}var Ke=(e,o)=>`Found multiple elements with the alt text of: ${o}`,Ze=(e,o)=>`Unable to find an element with the alt text of: ${o}`,[Z,v,ee,te,oe]=i(u(E,Ke,Ze));function B(...e){let[o,n,t]=e;return t==null&&(t={}),t.suggest=!1,[...new Set(d(()=>h(o,t).map(l=>_e(l,n,t)).flat(1/0)))]}var ve=(e,o)=>`Found multiple elements with the title of: ${o}`,et=(e,o)=>`Unable to find an element with the title of: ${o}`,[ne,le,re,ae,de]=i(u(B,ve,et));function A(...e){let[o,n,t]=e;return t==null&&(t={}),t.suggest=!1,[...new Set(d(()=>h(o,t).map(l=>$e(l,n,t)).flat(1/0)))]}var tt=(e,o)=>`Found multiple elements with the test id of: ${o}`,ot=(e,o)=>`Unable to find an element with the test id of: ${o}`,[ce,he,se,ue,ie]=i(u(A,tt,ot));import{logDOM as yt}from"@testing-library/dom";import{prettyDOM as nt,getConfig as lt}from"@testing-library/dom";var Te=/([^\S\r\n]*[\f\n\r\t\v]+)/.source;function rt(e){return e.replace(new RegExp(`${Te}.*${Te}{2,}`,"g"),"")}function Ee(...e){let[o,n,t]=e,l=g((t==null?void 0:t.filterNode)||me);return t==null&&(t={}),t.plugins==null&&(t.plugins=[]),t.plugins.push(l),d(()=>nt(o,n,{...t,plugins:[l]}))}function Be(e){return e.replace(/</g,"<").replace(/>/g,">")}function me(e){return e.nodeType!==Se&&(e.nodeType!==xe||!e.matches(lt().defaultIgnore))}var at=(e,o,n,t,l,r,a)=>{let c=t+n.indent,s=n.colors;return e.map(m=>{let w=o[m],S=a(w,n,c,l,r);return typeof w!="string"&&(S.indexOf(` | ||
`)!==-1&&(S=n.spacingOuter+c+S+n.spacingOuter+t),S="{"+S+"}"),n.spacingInner+t+s.prop.open+m+s.prop.close+"="+s.value.open+S+s.value.close}).join("")},dt=3,ct=(e,o,n,t,l,r)=>rt(e.map(a=>{let c=typeof a=="string"?Ae(a,o):r(a,o,n,t,l);return c===""&&typeof a=="object"&&a!=null&&a.nodeType!==dt?"":o.spacingOuter+n+c}).join("")),Ae=(e,o)=>{let n=o.colors.content;return n.open+Be(e)+n.close},ht=(e,o)=>{let n=o.colors.comment;return n.open+"<!--"+Be(e)+"-->"+n.close},st=(e,o,n,t,l)=>{let r=t.colors.tag;return r.open+"<"+e+(o&&r.close+o+t.spacingOuter+l+r.open)+(n?">"+r.close+n+t.spacingOuter+l+r.open+"</"+e:(o&&!t.min?"":" ")+"/")+">"+r.close},ut=(e,o)=>{let n=o.colors.tag;return n.open+"<"+e+n.close+" \u2026"+n.open+" />"+n.close},xe=1,ge=3,Se=8,Pe=11,it=/^((HTML|SVG)\w*)?Element$/,mt=e=>{var r;let o=((r=e==null?void 0:e.constructor)==null?void 0:r.name)||"",{nodeType:n,tagName:t}=e,l=typeof t=="string"&&t.includes("-")||typeof e.hasAttribute=="function"&&e.hasAttribute("is")||e instanceof HTMLElement;return n===xe&&(it.test(o)||l)||n===ge&&o==="Text"||n===Se&&o==="Comment"||n===Pe};function St(e){return e.nodeType===ge}function wt(e){return e.nodeType===Se}function Me(e){return e.nodeType===Pe}function g(e){function o(n){let t=Array.prototype.slice.call(n.childNodes||n.children);return"shadowRoot"in n&&n.shadowRoot!=null&&n.shadowRoot.mode!=="closed"&&t.unshift(n.shadowRoot),t.filter(e)}return{test:n=>(n==null?void 0:n.constructor)&&mt(n),serialize:(n,t,l,r,a,c)=>{if(St(n))return Ae(n.data,t);if(wt(n))return ht(n.data,t);let s="DocumentFragment";return"tagName"in n&&n.tagName?s=n.tagName.toLowerCase():n instanceof ShadowRoot&&(s="ShadowRoot"),++r>t.maxDepth?ut(s,t):st(s,at(Me(n)?[]:Array.from(n.attributes).map(m=>m.name).sort(),Me(n)?{}:Array.from(n.attributes).reduce((m,w)=>(m[w.name]=w.value,m),{}),t,l+t.indent,r,a,c),ct(o(n),t,l+t.indent,r,a,c),t,l)}}}function P(...e){let[o,n,t]=e,l=g((t==null?void 0:t.filterNode)||me);t==null&&(t={}),t.plugins==null&&(t.plugins=[]),t.plugins.push(l),d(()=>yt(o,n,t))}function we(...e){let[o,n,t]=e;Array.isArray(o)?o.forEach(l=>P(l,n,t)):P(o,n,t)}import{screen as ft}from"@testing-library/dom";var pt={...ft,debug:we,queryAllByShadowRole:(...e)=>y(document.documentElement,e[0],e[1]),queryByShadowRole:(...e)=>R(document.documentElement,e[0],e[1]),getAllByShadowRole:(...e)=>L(document.documentElement,e[0],e[1]),getByShadowRole:(...e)=>q(document.documentElement,e[0],e[1]),findAllByShadowRole:(...e)=>Q(document.documentElement,e[0],e[1],e[2]),findByShadowRole:(...e)=>D(document.documentElement,e[0],e[1],e[2]),queryAllByShadowLabelText:(...e)=>f(document.documentElement,e[0],e[1]),queryByShadowLabelText:(...e)=>b(document.documentElement,e[0],e[1]),getAllByShadowLabelText:(...e)=>H(document.documentElement,e[0],e[1]),getByShadowLabelText:(...e)=>I(document.documentElement,e[0],e[1]),findAllByShadowLabelText:(...e)=>O(document.documentElement,e[0],e[1],e[2]),findByShadowLabelText:(...e)=>N(document.documentElement,e[0],e[1],e[2]),queryAllByShadowPlaceholderText:(...e)=>p(document.documentElement,e[0],e[1]),queryByShadowPlaceholderText:(...e)=>C(document.documentElement,e[0],e[1]),getAllByShadowPlaceholderText:(...e)=>V(document.documentElement,e[0],e[1]),getByShadowPlaceholderText:(...e)=>_(document.documentElement,e[0],e[1]),findAllByShadowPlaceholderText:(...e)=>$(document.documentElement,e[0],e[1],e[2]),findByShadowPlaceholderText:(...e)=>F(document.documentElement,e[0],e[1],e[2]),queryAllByShadowText:(...e)=>T(document.documentElement,e[0],e[1]),queryByShadowText:(...e)=>U(document.documentElement,e[0],e[1]),getAllByShadowText:(...e)=>j(document.documentElement,e[0],e[1]),getByShadowText:(...e)=>W(document.documentElement,e[0],e[1]),findAllByShadowText:(...e)=>k(document.documentElement,e[0],e[1],e[2]),findByShadowText:(...e)=>G(document.documentElement,e[0],e[1],e[2]),queryAllByShadowDisplayValue:(...e)=>M(document.documentElement,e[0],e[1]),queryByShadowDisplayValue:(...e)=>X(document.documentElement,e[0],e[1]),getAllByShadowDisplayValue:(...e)=>z(document.documentElement,e[0],e[1]),getByShadowDisplayValue:(...e)=>Y(document.documentElement,e[0],e[1]),findAllByShadowDisplayValue:(...e)=>J(document.documentElement,e[0],e[1],e[2]),findByShadowDisplayValue:(...e)=>K(document.documentElement,e[0],e[1],e[2]),queryAllByShadowAltText:(...e)=>E(document.documentElement,e[0],e[1]),queryByShadowAltText:(...e)=>Z(document.documentElement,e[0],e[1]),getAllByShadowAltText:(...e)=>v(document.documentElement,e[0],e[1]),getByShadowAltText:(...e)=>ee(document.documentElement,e[0],e[1]),findAllByShadowAltText:(...e)=>te(document.documentElement,e[0],e[1],e[2]),findByShadowAltText:(...e)=>oe(document.documentElement,e[0],e[1],e[2]),queryAllByShadowTitle:(...e)=>B(document.documentElement,e[0],e[1]),queryByShadowTitle:(...e)=>ne(document.documentElement,e[0],e[1]),getAllByShadowTitle:(...e)=>le(document.documentElement,e[0],e[1]),getByShadowTitle:(...e)=>re(document.documentElement,e[0],e[1]),findAllByShadowTitle:(...e)=>ae(document.documentElement,e[0],e[1],e[2]),findByShadowTitle:(...e)=>de(document.documentElement,e[0],e[1],e[2]),queryAllByShadowTestId:(...e)=>A(document.documentElement,e[0],e[1]),queryByShadowTestId:(...e)=>ce(document.documentElement,e[0],e[1]),getAllByShadowTestId:(...e)=>he(document.documentElement,e[0],e[1]),getByShadowTestId:(...e)=>se(document.documentElement,e[0],e[1]),findAllByShadowTestId:(...e)=>ue(document.documentElement,e[0],e[1],e[2]),findByShadowTestId:(...e)=>ie(document.documentElement,e[0],e[1],e[2])};Et({getElementError(e,o){let n=Ee(o),t=new Error([e,`Ignored nodes: comments, ${Bt().defaultIgnore} | ||
${n}`].filter(Boolean).join(` | ||
var Pe=Object.defineProperty;var Re=(e,n)=>{for(var o in n)Pe(e,o,{get:n[o],enumerable:!0})};import{queries as an,within as rn,configure as dn,getConfig as sn}from"@testing-library/dom";var A={};Re(A,{findAllByShadowAltText:()=>te,findAllByShadowDisplayValue:()=>J,findAllByShadowLabelText:()=>I,findAllByShadowPlaceholderText:()=>V,findAllByShadowRole:()=>_,findAllByShadowTestId:()=>ue,findAllByShadowText:()=>W,findAllByShadowTitle:()=>re,findByShadowAltText:()=>ne,findByShadowDisplayValue:()=>K,findByShadowLabelText:()=>F,findByShadowPlaceholderText:()=>G,findByShadowRole:()=>q,findByShadowTestId:()=>he,findByShadowText:()=>k,findByShadowTitle:()=>de,getAllByShadowAltText:()=>v,getAllByShadowDisplayValue:()=>z,getAllByShadowLabelText:()=>Q,getAllByShadowPlaceholderText:()=>N,getAllByShadowRole:()=>R,getAllByShadowTestId:()=>Te,getAllByShadowText:()=>U,getAllByShadowTitle:()=>le,getByShadowAltText:()=>ee,getByShadowDisplayValue:()=>Y,getByShadowLabelText:()=>D,getByShadowPlaceholderText:()=>C,getByShadowRole:()=>H,getByShadowTestId:()=>ye,getByShadowText:()=>j,getByShadowTitle:()=>ae,queryAllByShadowAltText:()=>x,queryAllByShadowDisplayValue:()=>B,queryAllByShadowLabelText:()=>w,queryAllByShadowPlaceholderText:()=>p,queryAllByShadowRole:()=>S,queryAllByShadowTestId:()=>E,queryAllByShadowText:()=>f,queryAllByShadowTitle:()=>M,queryByShadowAltText:()=>Z,queryByShadowDisplayValue:()=>X,queryByShadowLabelText:()=>b,queryByShadowPlaceholderText:()=>O,queryByShadowRole:()=>P,queryByShadowTestId:()=>se,queryByShadowText:()=>$,queryByShadowTitle:()=>oe});import{buildQueries as u,queryAllByRole as Qe,queryAllByLabelText as De,queryAllByPlaceholderText as Ie,queryAllByText as Fe,queryAllByDisplayValue as Oe,queryAllByAltText as Ne,queryAllByTitle as Ce,queryAllByTestId as Ve}from"@testing-library/dom";_e();function He(){qe()}function Se(){HTMLSlotElement.prototype.querySelectorAll=HTMLElement.prototype.querySelectorAll}function d(e){He();try{let n=e();return typeof n=="object"&&"finally"in n&&typeof n.finally=="function"&&n.finally(()=>Se()),n}finally{Se()}}function _e(){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:Boolean(this.querySelector(e))}}}}),ShadowRoot.prototype.outerHTML==null&&Object.defineProperties(ShadowRoot.prototype,{outerHTML:{get(){return this.innerHTML}}})}function qe(){HTMLSlotElement.prototype.querySelectorAll=function(e){let n=HTMLElement.prototype.querySelectorAll,o=[];return this.assignedElements({flatten:!0}).forEach(t=>{let l=t,a=document.createElement("div");a.appendChild(l.cloneNode(!1)),a.querySelector(e)&&o.push(l),o=o.concat(Array.from(l.querySelectorAll(e)))}),o.length==0&&(o=Array.from(n.call(this,e))),[...new Set(o)]}}function be(e,n,o={shallow:!1}){let t=we(e,n,o);return Array.isArray(t)&&t.length>0?t[0]:null}function we(e,n,o={shallow:!1}){return d(()=>{let l=T(e,o).map(a=>Array.from(a.querySelectorAll(n))).flat(1/0);return[...new Set(l)]})}function T(e,n={shallow:!1}){return pe(e,"*",n)}function pe(e,n,o={shallow:!1},t=[],l=[]){return e instanceof Document&&(e=document.documentElement),t=[e],l.push(e),e instanceof HTMLElement&&e.shadowRoot!=null&&e.shadowRoot.mode!=="closed"&&(l.push(e.shadowRoot),t.push(e.shadowRoot)),t.forEach(a=>{a.querySelectorAll(n).forEach(r=>{if(r.shadowRoot==null||r.shadowRoot.mode==="closed"){l.push(r);return}if(l.push(r.shadowRoot),o.shallow===!0){r.shadowRoot.querySelectorAll(n).forEach(s=>{l.push(s)});return}r.shadowRoot.querySelectorAll(n).forEach(s=>{l.push(s),t.push(s)}),pe(r.shadowRoot,n,o,t,l)})}),[...new Set(l)]}function h(e){return e.map(n=>(...o)=>{let[t,l,a,...r]=o;return a==null&&(a={}),a.suggest=!1,n(t,l,a,...r)})}function S(...e){let[n,o,t]=e;return t==null&&(t={}),t.suggest=!1,[...new Set(d(()=>T(n,t).map(l=>Qe(l,o,t)).flat(1/0)))]}var Ge=(e,n)=>`Found multiple elements with the role of: ${n}`,$e=(e,n)=>`Unable to find an element with the role of: ${n}`,[Ue,je,We,ke,Xe]=h(u(S,Ge,$e)),P=(...e)=>Ue(...e),R=(...e)=>je(...e),H=(...e)=>We(...e),_=(...e)=>ke(...e),q=(...e)=>Xe(...e);function w(...e){let[n,o,t]=e;return t==null&&(t={}),t.suggest=!1,[...new Set(d(()=>T(n,t).map(l=>De(l,o,t)).flat(1/0)))]}var ze=(e,n)=>`Found multiple elements with the label text of: ${n}`,Ye=(e,n)=>`Unable to find an element with the label text of: ${n}`,[Je,Ke,Ze,ve,et]=h(u(w,ze,Ye)),b=(...e)=>Je(...e),Q=(...e)=>Ke(...e),D=(...e)=>Ze(...e),I=(...e)=>ve(...e),F=(...e)=>et(...e);function p(...e){let[n,o,t]=e;return t==null&&(t={}),t.suggest=!1,[...new Set(d(()=>T(n,t).map(l=>Ie(l,o,t)).flat(1/0)))]}var tt=(e,n)=>`Found multiple elements with the placeholder text of: ${n}`,nt=(e,n)=>`Unable to find an element with the placeholder text of: ${n}`,[ot,lt,at,rt,dt]=h(u(p,tt,nt)),O=(...e)=>ot(...e),N=(...e)=>lt(...e),C=(...e)=>at(...e),V=(...e)=>rt(...e),G=(...e)=>dt(...e);function f(...e){let[n,o,t]=e;return t==null&&(t={}),t.suggest=!1,[...new Set(d(()=>T(n,t).map(l=>Fe(l,o,t)).flat(1/0)))]}var st=(e,n)=>`Found multiple elements with the text of: ${n}`,Tt=(e,n)=>`Unable to find an element with the text of: ${n}`,[yt,ut,ht,mt,ct]=h(u(f,st,Tt)),$=(...e)=>yt(...e),U=(...e)=>ut(...e),j=(...e)=>ht(...e),W=(...e)=>mt(...e),k=(...e)=>ct(...e);function B(...e){let[n,o,t]=e;return t==null&&(t={}),t.suggest=!1,[...new Set(d(()=>T(n,t).map(l=>Oe(l,o,t)).flat(1/0)))]}var it=(e,n)=>`Found multiple elements with the display value of: ${n}`,St=(e,n)=>`Unable to find an element with the display value of: ${n}`,[wt,pt,ft,Bt,xt]=h(u(B,it,St)),X=(...e)=>wt(...e),z=(...e)=>pt(...e),Y=(...e)=>ft(...e),J=(...e)=>Bt(...e),K=(...e)=>xt(...e);function x(...e){let[n,o,t]=e;return t==null&&(t={}),t.suggest=!1,[...new Set(d(()=>T(n,t).map(l=>Ne(l,o,t)).flat(1/0)))]}var Mt=(e,n)=>`Found multiple elements with the alt text of: ${n}`,Et=(e,n)=>`Unable to find an element with the alt text of: ${n}`,[At,Lt,gt,Pt,Rt]=h(u(x,Mt,Et)),Z=(...e)=>At(...e),v=(...e)=>Lt(...e),ee=(...e)=>gt(...e),te=(...e)=>Pt(...e),ne=(...e)=>Rt(...e);function M(...e){let[n,o,t]=e;return t==null&&(t={}),t.suggest=!1,[...new Set(d(()=>T(n,t).map(l=>Ce(l,o,t)).flat(1/0)))]}var Ht=(e,n)=>`Found multiple elements with the title of: ${n}`,_t=(e,n)=>`Unable to find an element with the title of: ${n}`,[qt,bt,Qt,Dt,It]=h(u(M,Ht,_t)),oe=(...e)=>qt(...e),le=(...e)=>bt(...e),ae=(...e)=>Qt(...e),re=(...e)=>Dt(...e),de=(...e)=>It(...e);function E(...e){let[n,o,t]=e;return t==null&&(t={}),t.suggest=!1,[...new Set(d(()=>T(n,t).map(l=>Ve(l,o,t)).flat(1/0)))]}var Ft=(e,n)=>`Found multiple elements with the test id of: ${n}`,Ot=(e,n)=>`Unable to find an element with the test id of: ${n}`,[Nt,Ct,Vt,Gt,$t]=h(u(E,Ft,Ot)),se=(...e)=>Nt(...e),Te=(...e)=>Ct(...e),ye=(...e)=>Vt(...e),ue=(...e)=>Gt(...e),he=(...e)=>$t(...e);import{logDOM as nn}from"@testing-library/dom";import{prettyDOM as Ut,getConfig as jt}from"@testing-library/dom";var fe=/([^\S\r\n]*[\f\n\r\t\v]+)/.source;function Wt(e){return e.replace(new RegExp(`${fe}.*${fe}{2,}`,"g"),"")}function xe(...e){let[n,o,t]=e,l=L((t==null?void 0:t.filterNode)||me);return t==null&&(t={}),t.plugins==null&&(t.plugins=[]),t.plugins.push(l),d(()=>Ut(n,o,{...t,plugins:[l]}))}function Me(e){return e.replace(/</g,"<").replace(/>/g,">")}function me(e){return e.nodeType!==ce&&(e.nodeType!==Ae||!e.matches(jt().defaultIgnore))}var kt=(e,n,o,t,l,a,r)=>{let s=t+o.indent,y=o.colors;return e.map(m=>{let i=n[m],c=r(i,o,s,l,a);return typeof i!="string"&&(c.indexOf(` | ||
`)!==-1&&(c=o.spacingOuter+s+c+o.spacingOuter+t),c="{"+c+"}"),o.spacingInner+t+y.prop.open+m+y.prop.close+"="+y.value.open+c+y.value.close}).join("")},Xt=3,zt=(e,n,o,t,l,a)=>Wt(e.map(r=>{let s=typeof r=="string"?Ee(r,n):a(r,n,o,t,l);return s===""&&typeof r=="object"&&r!=null&&r.nodeType!==Xt?"":n.spacingOuter+o+s}).join("")),Ee=(e,n)=>{let o=n.colors.content;return o.open+Me(e)+o.close},Yt=(e,n)=>{let o=n.colors.comment;return o.open+"<!--"+Me(e)+"-->"+o.close},Jt=(e,n,o,t,l)=>{let a=t.colors.tag;return a.open+"<"+e+(n&&a.close+n+t.spacingOuter+l+a.open)+(o?">"+a.close+o+t.spacingOuter+l+a.open+"</"+e:(n&&!t.min?"":" ")+"/")+">"+a.close},Kt=(e,n)=>{let o=n.colors.tag;return o.open+"<"+e+o.close+" \u2026"+o.open+" />"+o.close},Ae=1,Le=3,ce=8,ge=11,Zt=/^((HTML|SVG)\w*)?Element$/,vt=e=>{var a;let n=((a=e==null?void 0:e.constructor)==null?void 0:a.name)||"",{nodeType:o,tagName:t}=e,l=typeof t=="string"&&t.includes("-")||typeof e.hasAttribute=="function"&&e.hasAttribute("is")||e instanceof HTMLElement;return o===Ae&&(Zt.test(n)||l)||o===Le&&n==="Text"||o===ce&&n==="Comment"||o===ge};function en(e){return e.nodeType===Le}function tn(e){return e.nodeType===ce}function Be(e){return e.nodeType===ge}function L(e){function n(o){let t=Array.prototype.slice.call(o.childNodes||o.children);return"shadowRoot"in o&&o.shadowRoot!=null&&o.shadowRoot.mode!=="closed"&&t.unshift(o.shadowRoot),t.filter(e)}return{test:o=>(o==null?void 0:o.constructor)&&vt(o),serialize:(o,t,l,a,r,s)=>{if(en(o))return Ee(o.data,t);if(tn(o))return Yt(o.data,t);let y="DocumentFragment";return"tagName"in o&&o.tagName?y=o.tagName.toLowerCase():o instanceof ShadowRoot&&(y="ShadowRoot"),++a>t.maxDepth?Kt(y,t):Jt(y,kt(Be(o)?[]:Array.from(o.attributes).map(m=>m.name).sort(),Be(o)?{}:Array.from(o.attributes).reduce((m,i)=>(m[i.name]=i.value,m),{}),t,l+t.indent,a,r,s),zt(n(o),t,l+t.indent,a,r,s),t,l)}}}function g(...e){let[n,o,t]=e,l=L((t==null?void 0:t.filterNode)||me);t==null&&(t={}),t.plugins==null&&(t.plugins=[]),t.plugins.push(l),d(()=>nn(n,o,t))}function ie(...e){let[n,o,t]=e;Array.isArray(n)?n.forEach(l=>g(l,o,t)):g(n,o,t)}import{screen as on}from"@testing-library/dom";var ln={...on,debug:ie,queryAllByShadowRole:(...e)=>S(document.documentElement,e[0],e[1]),queryByShadowRole:(...e)=>P(document.documentElement,e[0],e[1]),getAllByShadowRole:(...e)=>R(document.documentElement,e[0],e[1]),getByShadowRole:(...e)=>H(document.documentElement,e[0],e[1]),findAllByShadowRole:(...e)=>_(document.documentElement,e[0],e[1],e[2]),findByShadowRole:(...e)=>q(document.documentElement,e[0],e[1],e[2]),queryAllByShadowLabelText:(...e)=>w(document.documentElement,e[0],e[1]),queryByShadowLabelText:(...e)=>b(document.documentElement,e[0],e[1]),getAllByShadowLabelText:(...e)=>Q(document.documentElement,e[0],e[1]),getByShadowLabelText:(...e)=>D(document.documentElement,e[0],e[1]),findAllByShadowLabelText:(...e)=>I(document.documentElement,e[0],e[1],e[2]),findByShadowLabelText:(...e)=>F(document.documentElement,e[0],e[1],e[2]),queryAllByShadowPlaceholderText:(...e)=>p(document.documentElement,e[0],e[1]),queryByShadowPlaceholderText:(...e)=>O(document.documentElement,e[0],e[1]),getAllByShadowPlaceholderText:(...e)=>N(document.documentElement,e[0],e[1]),getByShadowPlaceholderText:(...e)=>C(document.documentElement,e[0],e[1]),findAllByShadowPlaceholderText:(...e)=>V(document.documentElement,e[0],e[1],e[2]),findByShadowPlaceholderText:(...e)=>G(document.documentElement,e[0],e[1],e[2]),queryAllByShadowText:(...e)=>f(document.documentElement,e[0],e[1]),queryByShadowText:(...e)=>$(document.documentElement,e[0],e[1]),getAllByShadowText:(...e)=>U(document.documentElement,e[0],e[1]),getByShadowText:(...e)=>j(document.documentElement,e[0],e[1]),findAllByShadowText:(...e)=>W(document.documentElement,e[0],e[1],e[2]),findByShadowText:(...e)=>k(document.documentElement,e[0],e[1],e[2]),queryAllByShadowDisplayValue:(...e)=>B(document.documentElement,e[0],e[1]),queryByShadowDisplayValue:(...e)=>X(document.documentElement,e[0],e[1]),getAllByShadowDisplayValue:(...e)=>z(document.documentElement,e[0],e[1]),getByShadowDisplayValue:(...e)=>Y(document.documentElement,e[0],e[1]),findAllByShadowDisplayValue:(...e)=>J(document.documentElement,e[0],e[1],e[2]),findByShadowDisplayValue:(...e)=>K(document.documentElement,e[0],e[1],e[2]),queryAllByShadowAltText:(...e)=>x(document.documentElement,e[0],e[1]),queryByShadowAltText:(...e)=>Z(document.documentElement,e[0],e[1]),getAllByShadowAltText:(...e)=>v(document.documentElement,e[0],e[1]),getByShadowAltText:(...e)=>ee(document.documentElement,e[0],e[1]),findAllByShadowAltText:(...e)=>te(document.documentElement,e[0],e[1],e[2]),findByShadowAltText:(...e)=>ne(document.documentElement,e[0],e[1],e[2]),queryAllByShadowTitle:(...e)=>M(document.documentElement,e[0],e[1]),queryByShadowTitle:(...e)=>oe(document.documentElement,e[0],e[1]),getAllByShadowTitle:(...e)=>le(document.documentElement,e[0],e[1]),getByShadowTitle:(...e)=>ae(document.documentElement,e[0],e[1]),findAllByShadowTitle:(...e)=>re(document.documentElement,e[0],e[1],e[2]),findByShadowTitle:(...e)=>de(document.documentElement,e[0],e[1],e[2]),queryAllByShadowTestId:(...e)=>E(document.documentElement,e[0],e[1]),queryByShadowTestId:(...e)=>se(document.documentElement,e[0],e[1]),getAllByShadowTestId:(...e)=>Te(document.documentElement,e[0],e[1]),getByShadowTestId:(...e)=>ye(document.documentElement,e[0],e[1]),findAllByShadowTestId:(...e)=>ue(document.documentElement,e[0],e[1],e[2]),findByShadowTestId:(...e)=>he(document.documentElement,e[0],e[1],e[2])};dn({getElementError(e,n){let o=xe(n),t=new Error([e,`Ignored nodes: comments, ${sn().defaultIgnore} | ||
${o}`].filter(Boolean).join(` | ||
`));return t.name="ShadowDOMTestingLibraryElementError",t}});var At={...Tt,...x};function Jt(e){return Mt(e,At)}export{g as createDOMElementFilter,we as debug,be as deepQuerySelector,fe as deepQuerySelectorAll,te as findAllByShadowAltText,J as findAllByShadowDisplayValue,O as findAllByShadowLabelText,$ as findAllByShadowPlaceholderText,Q as findAllByShadowRole,ue as findAllByShadowTestId,k as findAllByShadowText,ae as findAllByShadowTitle,oe as findByShadowAltText,K as findByShadowDisplayValue,N as findByShadowLabelText,F as findByShadowPlaceholderText,D as findByShadowRole,ie as findByShadowTestId,G as findByShadowText,de as findByShadowTitle,v as getAllByShadowAltText,z as getAllByShadowDisplayValue,H as getAllByShadowLabelText,V as getAllByShadowPlaceholderText,L as getAllByShadowRole,he as getAllByShadowTestId,j as getAllByShadowText,le as getAllByShadowTitle,h as getAllElementsAndShadowRoots,ee as getByShadowAltText,Y as getByShadowDisplayValue,I as getByShadowLabelText,_ as getByShadowPlaceholderText,q as getByShadowRole,se as getByShadowTestId,W as getByShadowText,re as getByShadowTitle,P as logShadowDOM,Ee as prettyShadowDOM,E as queryAllByShadowAltText,M as queryAllByShadowDisplayValue,f as queryAllByShadowLabelText,p as queryAllByShadowPlaceholderText,y as queryAllByShadowRole,A as queryAllByShadowTestId,T as queryAllByShadowText,B as queryAllByShadowTitle,Z as queryByShadowAltText,X as queryByShadowDisplayValue,b as queryByShadowLabelText,C as queryByShadowPlaceholderText,R as queryByShadowRole,ce as queryByShadowTestId,U as queryByShadowText,ne as queryByShadowTitle,pt as screen,x as shadowQueries,Jt as within}; | ||
`));return t.name="ShadowDOMTestingLibraryElementError",t}});var Tn={...an,...A};function Zn(e){return rn(e,Tn)}export{L as createDOMElementFilter,ie as debug,be as deepQuerySelector,we as deepQuerySelectorAll,te as findAllByShadowAltText,J as findAllByShadowDisplayValue,I as findAllByShadowLabelText,V as findAllByShadowPlaceholderText,_ as findAllByShadowRole,ue as findAllByShadowTestId,W as findAllByShadowText,re as findAllByShadowTitle,ne as findByShadowAltText,K as findByShadowDisplayValue,F as findByShadowLabelText,G as findByShadowPlaceholderText,q as findByShadowRole,he as findByShadowTestId,k as findByShadowText,de as findByShadowTitle,v as getAllByShadowAltText,z as getAllByShadowDisplayValue,Q as getAllByShadowLabelText,N as getAllByShadowPlaceholderText,R as getAllByShadowRole,Te as getAllByShadowTestId,U as getAllByShadowText,le as getAllByShadowTitle,T as getAllElementsAndShadowRoots,ee as getByShadowAltText,Y as getByShadowDisplayValue,D as getByShadowLabelText,C as getByShadowPlaceholderText,H as getByShadowRole,ye as getByShadowTestId,j as getByShadowText,ae as getByShadowTitle,g as logShadowDOM,xe as prettyShadowDOM,x as queryAllByShadowAltText,B as queryAllByShadowDisplayValue,w as queryAllByShadowLabelText,p as queryAllByShadowPlaceholderText,S as queryAllByShadowRole,E as queryAllByShadowTestId,f as queryAllByShadowText,M as queryAllByShadowTitle,Z as queryByShadowAltText,X as queryByShadowDisplayValue,b as queryByShadowLabelText,O as queryByShadowPlaceholderText,P as queryByShadowRole,se as queryByShadowTestId,$ as queryByShadowText,oe as queryByShadowTitle,ln as screen,A as shadowQueries,Zn as within}; | ||
//# sourceMappingURL=index.js.map |
@@ -1,1 +0,1 @@ | ||
{"inputs":{"src/trick-dom-testing-library.ts":{"bytes":3555,"imports":[]},"src/deep-query-selectors.ts":{"bytes":3655,"imports":[{"path":"src/trick-dom-testing-library.ts","kind":"import-statement"}]},"src/shadow-queries.ts":{"bytes":10587,"imports":[{"path":"src/deep-query-selectors.ts","kind":"import-statement"},{"path":"src/trick-dom-testing-library.ts","kind":"import-statement"}]},"src/pretty-shadow-dom.ts":{"bytes":8367,"imports":[{"path":"src/trick-dom-testing-library.ts","kind":"import-statement"}]},"src/log-shadow-dom.ts":{"bytes":700,"imports":[{"path":"src/pretty-shadow-dom.ts","kind":"import-statement"},{"path":"src/trick-dom-testing-library.ts","kind":"import-statement"}]},"src/debug.ts":{"bytes":352,"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/types.ts":{"bytes":2196,"imports":[]},"src/index.ts":{"bytes":1367,"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/types.ts","kind":"import-statement"},{"path":"src/shadow-queries.ts","kind":"import-statement"},{"path":"src/pretty-shadow-dom.ts","kind":"import-statement"},{"path":"src/deep-query-selectors.ts","kind":"import-statement"}]}},"outputs":{"dist/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":62633},"dist/index.cjs":{"imports":[],"exports":[],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":1954},"src/shadow-queries.ts":{"bytesInOutput":4104},"src/trick-dom-testing-library.ts":{"bytesInOutput":1043},"src/deep-query-selectors.ts":{"bytesInOutput":848},"src/log-shadow-dom.ts":{"bytesInOutput":202},"src/pretty-shadow-dom.ts":{"bytesInOutput":2531},"src/debug.ts":{"bytesInOutput":80},"src/shadow-screen.ts":{"bytesInOutput":3440}},"bytes":15886}}} | ||
{"inputs":{"src/trick-dom-testing-library.ts":{"bytes":3556,"imports":[]},"src/deep-query-selectors.ts":{"bytes":3659,"imports":[{"path":"src/trick-dom-testing-library.ts","kind":"import-statement"}]},"src/shadow-queries.ts":{"bytes":18348,"imports":[{"path":"src/deep-query-selectors.ts","kind":"import-statement"},{"path":"src/trick-dom-testing-library.ts","kind":"import-statement"}]},"src/pretty-shadow-dom.ts":{"bytes":8382,"imports":[{"path":"src/trick-dom-testing-library.ts","kind":"import-statement"}]},"src/log-shadow-dom.ts":{"bytes":701,"imports":[{"path":"src/pretty-shadow-dom.ts","kind":"import-statement"},{"path":"src/trick-dom-testing-library.ts","kind":"import-statement"}]},"src/debug.ts":{"bytes":352,"imports":[{"path":"src/log-shadow-dom.ts","kind":"import-statement"}]},"src/shadow-screen.ts":{"bytes":11148,"imports":[{"path":"src/debug.ts","kind":"import-statement"},{"path":"src/shadow-queries.ts","kind":"import-statement"}]},"src/types.ts":{"bytes":2208,"imports":[]},"src/index.ts":{"bytes":1368,"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/types.ts","kind":"import-statement"},{"path":"src/shadow-queries.ts","kind":"import-statement"},{"path":"src/pretty-shadow-dom.ts","kind":"import-statement"},{"path":"src/deep-query-selectors.ts","kind":"import-statement"}]}},"outputs":{"dist/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":75450},"dist/index.cjs":{"imports":[],"exports":[],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":1954},"src/shadow-queries.ts":{"bytesInOutput":4904},"src/trick-dom-testing-library.ts":{"bytesInOutput":1043},"src/deep-query-selectors.ts":{"bytesInOutput":848},"src/log-shadow-dom.ts":{"bytesInOutput":202},"src/pretty-shadow-dom.ts":{"bytesInOutput":2531},"src/debug.ts":{"bytesInOutput":80},"src/shadow-screen.ts":{"bytesInOutput":3440}},"bytes":16686}}} |
@@ -1,1 +0,1 @@ | ||
{"inputs":{"src/trick-dom-testing-library.ts":{"bytes":3555,"imports":[]},"src/deep-query-selectors.ts":{"bytes":3655,"imports":[{"path":"src/trick-dom-testing-library.ts","kind":"import-statement"}]},"src/shadow-queries.ts":{"bytes":10587,"imports":[{"path":"src/deep-query-selectors.ts","kind":"import-statement"},{"path":"src/trick-dom-testing-library.ts","kind":"import-statement"}]},"src/pretty-shadow-dom.ts":{"bytes":8367,"imports":[{"path":"src/trick-dom-testing-library.ts","kind":"import-statement"}]},"src/log-shadow-dom.ts":{"bytes":700,"imports":[{"path":"src/pretty-shadow-dom.ts","kind":"import-statement"},{"path":"src/trick-dom-testing-library.ts","kind":"import-statement"}]},"src/debug.ts":{"bytes":352,"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/types.ts":{"bytes":2196,"imports":[]},"src/index.ts":{"bytes":1367,"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/types.ts","kind":"import-statement"},{"path":"src/shadow-queries.ts","kind":"import-statement"},{"path":"src/pretty-shadow-dom.ts","kind":"import-statement"},{"path":"src/deep-query-selectors.ts","kind":"import-statement"}]}},"outputs":{"dist/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":61126},"dist/index.js":{"imports":[],"exports":["createDOMElementFilter","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","getAllElementsAndShadowRoots","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","shadowQueries","within"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":336},"src/shadow-queries.ts":{"bytesInOutput":4004},"src/trick-dom-testing-library.ts":{"bytesInOutput":1043},"src/deep-query-selectors.ts":{"bytesInOutput":848},"src/log-shadow-dom.ts":{"bytesInOutput":199},"src/pretty-shadow-dom.ts":{"bytesInOutput":2530},"src/debug.ts":{"bytesInOutput":80},"src/shadow-screen.ts":{"bytesInOutput":3440}},"bytes":14113}}} | ||
{"inputs":{"src/trick-dom-testing-library.ts":{"bytes":3556,"imports":[]},"src/deep-query-selectors.ts":{"bytes":3659,"imports":[{"path":"src/trick-dom-testing-library.ts","kind":"import-statement"}]},"src/shadow-queries.ts":{"bytes":18348,"imports":[{"path":"src/deep-query-selectors.ts","kind":"import-statement"},{"path":"src/trick-dom-testing-library.ts","kind":"import-statement"}]},"src/pretty-shadow-dom.ts":{"bytes":8382,"imports":[{"path":"src/trick-dom-testing-library.ts","kind":"import-statement"}]},"src/log-shadow-dom.ts":{"bytes":701,"imports":[{"path":"src/pretty-shadow-dom.ts","kind":"import-statement"},{"path":"src/trick-dom-testing-library.ts","kind":"import-statement"}]},"src/debug.ts":{"bytes":352,"imports":[{"path":"src/log-shadow-dom.ts","kind":"import-statement"}]},"src/shadow-screen.ts":{"bytes":11148,"imports":[{"path":"src/debug.ts","kind":"import-statement"},{"path":"src/shadow-queries.ts","kind":"import-statement"}]},"src/types.ts":{"bytes":2208,"imports":[]},"src/index.ts":{"bytes":1368,"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/types.ts","kind":"import-statement"},{"path":"src/shadow-queries.ts","kind":"import-statement"},{"path":"src/pretty-shadow-dom.ts","kind":"import-statement"},{"path":"src/deep-query-selectors.ts","kind":"import-statement"}]}},"outputs":{"dist/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":73951},"dist/index.js":{"imports":[],"exports":["createDOMElementFilter","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","getAllElementsAndShadowRoots","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","shadowQueries","within"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":336},"src/shadow-queries.ts":{"bytesInOutput":4804},"src/trick-dom-testing-library.ts":{"bytesInOutput":1043},"src/deep-query-selectors.ts":{"bytesInOutput":848},"src/log-shadow-dom.ts":{"bytesInOutput":199},"src/pretty-shadow-dom.ts":{"bytesInOutput":2530},"src/debug.ts":{"bytesInOutput":80},"src/shadow-screen.ts":{"bytesInOutput":3440}},"bytes":14913}}} |
{ | ||
"name": "shadow-dom-testing-library", | ||
"version": "1.11.0", | ||
"version": "1.11.1", | ||
"description": "An extension of DOM-testing-library to provide hooks into the shadow dom", | ||
@@ -16,4 +16,4 @@ "type": "module", | ||
"test": "vitest run", | ||
"format": "npx prettier ./src ./__tests__ ./README.md --write", | ||
"check": "npx prettier ./src ./__tests__ ./README.md --check", | ||
"format": "prettier ./src ./__tests__ ./README.md --write", | ||
"check": "prettier ./src ./__tests__ ./README.md --check", | ||
"test:watch": "vitest", | ||
@@ -68,2 +68,3 @@ "test:ci": "npm run build && npm run test && npm run jest", | ||
"jsdom": "^20.0.2", | ||
"prettier": "^3.1.1", | ||
"react": "^18.2.0", | ||
@@ -70,0 +71,0 @@ "react-dom": "^18.2.0", |
@@ -283,1 +283,10 @@ # Why? | ||
``` | ||
## Usage with TypeScript | ||
```ts | ||
import { screen, shadowQueries } from "shadow-dom-testing-library"; | ||
const btn = await screen.findByShadowRole<HTMLButtonElement>("button"); | ||
const btn = shadowQueries.getByShadowRole<HTMLButtonElement>("button"); | ||
``` |
@@ -7,3 +7,3 @@ import { patchWrap } from "./trick-dom-testing-library"; | ||
selector: string, | ||
options: ShadowOptions = { shallow: false } | ||
options: ShadowOptions = { shallow: false }, | ||
): T | null { | ||
@@ -34,3 +34,3 @@ const els = deepQuerySelectorAll(container, selector, options); | ||
selector: string, | ||
options: ShadowOptions = { shallow: false } | ||
options: ShadowOptions = { shallow: false }, | ||
): T[] { | ||
@@ -51,3 +51,3 @@ return patchWrap(() => { | ||
container: Container, | ||
options: ShadowOptions = { shallow: false } | ||
options: ShadowOptions = { shallow: false }, | ||
) { | ||
@@ -63,3 +63,3 @@ const selector = "*"; | ||
elementsToProcess: (Element | ShadowRoot | Document)[] = [], | ||
elements: (Element | ShadowRoot | Document)[] = [] | ||
elements: (Element | ShadowRoot | Document)[] = [], | ||
) { | ||
@@ -66,0 +66,0 @@ // if "document" is passed in, it will also pick up "<html>" causing the query to run twice. |
@@ -21,3 +21,3 @@ import { queries, within, configure, getConfig } from "@testing-library/dom"; | ||
.filter(Boolean) | ||
.join("\n\n") | ||
.join("\n\n"), | ||
); | ||
@@ -24,0 +24,0 @@ error.name = "ShadowDOMTestingLibraryElementError"; |
@@ -15,3 +15,3 @@ import { logDOM } from "@testing-library/dom"; | ||
const plugin: NewPlugin = createDOMElementFilter( | ||
options?.filterNode || filterCommentsAndDefaultIgnoreTagsTags | ||
options?.filterNode || filterCommentsAndDefaultIgnoreTagsTags, | ||
); | ||
@@ -18,0 +18,0 @@ |
@@ -11,3 +11,3 @@ import { prettyDOM, getConfig } from "@testing-library/dom"; | ||
new RegExp(`${findWhiteSpace}.*${findWhiteSpace}{2,}`, "g"), | ||
"" | ||
"", | ||
); | ||
@@ -23,3 +23,3 @@ return final; | ||
const plugin: NewPlugin = createDOMElementFilter( | ||
options?.filterNode || filterCommentsAndDefaultIgnoreTagsTags | ||
options?.filterNode || filterCommentsAndDefaultIgnoreTagsTags, | ||
); | ||
@@ -36,3 +36,3 @@ | ||
plugins: [plugin], | ||
}) | ||
}), | ||
); | ||
@@ -62,3 +62,3 @@ } | ||
refs: Refs, | ||
printer: Printer | ||
printer: Printer, | ||
): string => { | ||
@@ -110,3 +110,3 @@ const indentationNext = indentation + config.indent; | ||
refs: Refs, | ||
printer: Printer | ||
printer: Printer, | ||
): string => | ||
@@ -132,3 +132,3 @@ removeDuplicateNewLines( | ||
}) | ||
.join("") | ||
.join(""), | ||
); | ||
@@ -161,3 +161,3 @@ | ||
config: Config, | ||
indentation: string | ||
indentation: string, | ||
): string => { | ||
@@ -244,3 +244,3 @@ const tagColor = config.colors.tag; | ||
function nodeIsFragment( | ||
node: HandledType | ||
node: HandledType, | ||
): node is DocumentFragment | ShadowRoot { | ||
@@ -251,6 +251,6 @@ return node.nodeType === FRAGMENT_NODE; | ||
export function createDOMElementFilter( | ||
filterNode: (node: Node) => boolean | ||
filterNode: (node: Node) => boolean, | ||
): NewPlugin { | ||
function getChildren( | ||
node: Element | DocumentFragment | ShadowRoot | ||
node: Element | DocumentFragment | ShadowRoot, | ||
): (Node | Element | ShadowRoot)[] { | ||
@@ -279,3 +279,3 @@ const children: (Node | Element | ShadowRoot)[] = | ||
refs: Refs, | ||
printer: Printer | ||
printer: Printer, | ||
) => { | ||
@@ -317,3 +317,3 @@ if (nodeIsText(node)) { | ||
}, | ||
{} | ||
{}, | ||
), | ||
@@ -324,3 +324,3 @@ config, | ||
refs, | ||
printer | ||
printer, | ||
), | ||
@@ -333,6 +333,6 @@ printChildren( | ||
refs, | ||
printer | ||
printer, | ||
), | ||
config, | ||
indentation | ||
indentation, | ||
); | ||
@@ -339,0 +339,0 @@ }, |
@@ -13,2 +13,17 @@ import { | ||
queryAllByTestId, | ||
AllByRole, | ||
AllByText, | ||
AllByBoundAttribute, | ||
GetByRole, | ||
QueryByRole, | ||
FindByRole, | ||
FindAllByRole, | ||
QueryByText, | ||
GetByText, | ||
FindAllByText, | ||
FindByText, | ||
QueryByBoundAttribute, | ||
GetByBoundAttribute, | ||
FindAllByBoundAttribute, | ||
FindByBoundAttribute, | ||
} from "@testing-library/dom"; | ||
@@ -41,3 +56,3 @@ | ||
...args: ShadowRoleMatcherParams | ||
): T[] { | ||
): ReturnType<AllByRole<T>> { | ||
let [container, role, options] = args; | ||
@@ -56,4 +71,4 @@ | ||
.map((el) => queryAllByRole(el as HTMLElement, role, options)) | ||
.flat(Infinity) | ||
) | ||
.flat(Infinity), | ||
), | ||
), | ||
@@ -69,7 +84,7 @@ ] as T[]; | ||
const [ | ||
queryByShadowRole, | ||
getAllByShadowRole, | ||
getByShadowRole, | ||
findAllByShadowRole, | ||
findByShadowRole, | ||
_queryByShadowRole, | ||
_getAllByShadowRole, | ||
_getByShadowRole, | ||
_findAllByShadowRole, | ||
_findByShadowRole, | ||
] = toShadowQueries( | ||
@@ -79,10 +94,26 @@ buildQueries<ScreenShadowRoleMatcherParams>( | ||
getMultipleRoleError, | ||
getMissingRoleError | ||
) | ||
getMissingRoleError, | ||
), | ||
); | ||
const queryByShadowRole = <T extends HTMLElement>( | ||
...args: Parameters<typeof _queryByShadowRole> | ||
) => _queryByShadowRole(...args) as ReturnType<QueryByRole<T>>; | ||
const getAllByShadowRole = <T extends HTMLElement>( | ||
...args: Parameters<typeof _getAllByShadowRole> | ||
) => _getAllByShadowRole(...args) as Array<ReturnType<GetByRole<T>>>; | ||
const getByShadowRole = <T extends HTMLElement>( | ||
...args: Parameters<typeof _getByShadowRole> | ||
) => _getByShadowRole(...args) as ReturnType<GetByRole<T>>; | ||
const findAllByShadowRole = <T extends HTMLElement>( | ||
...args: Parameters<typeof _findAllByShadowRole> | ||
) => _findAllByShadowRole(...args) as ReturnType<FindAllByRole<T>>; | ||
const findByShadowRole = <T extends HTMLElement>( | ||
...args: Parameters<typeof _findByShadowRole> | ||
) => _findByShadowRole(...args) as ReturnType<FindByRole<T>>; | ||
// Label Text | ||
function queryAllByShadowLabelText<T extends HTMLElement = HTMLElement>( | ||
...args: ShadowSelectorMatcherParams | ||
): T[] { | ||
): ReturnType<AllByText<T>> { | ||
let [container, id, options] = args; | ||
@@ -101,4 +132,4 @@ | ||
.map((el) => queryAllByLabelText(el as HTMLElement, id, options)) | ||
.flat(Infinity) | ||
) | ||
.flat(Infinity), | ||
), | ||
), | ||
@@ -114,7 +145,7 @@ ] as T[]; | ||
const [ | ||
queryByShadowLabelText, | ||
getAllByShadowLabelText, | ||
getByShadowLabelText, | ||
findAllByShadowLabelText, | ||
findByShadowLabelText, | ||
_queryByShadowLabelText, | ||
_getAllByShadowLabelText, | ||
_getByShadowLabelText, | ||
_findAllByShadowLabelText, | ||
_findByShadowLabelText, | ||
] = toShadowQueries( | ||
@@ -124,10 +155,26 @@ buildQueries<ScreenShadowSelectorMatcherParams>( | ||
getMultipleLabelTextError, | ||
getMissingLabelTextError | ||
) | ||
getMissingLabelTextError, | ||
), | ||
); | ||
const queryByShadowLabelText = <T extends HTMLElement>( | ||
...args: Parameters<typeof _queryByShadowLabelText> | ||
) => _queryByShadowLabelText(...args) as ReturnType<QueryByText<T>>; | ||
const getAllByShadowLabelText = <T extends HTMLElement>( | ||
...args: Parameters<typeof _getAllByShadowLabelText> | ||
) => _getAllByShadowLabelText(...args) as Array<ReturnType<GetByText<T>>>; | ||
const getByShadowLabelText = <T extends HTMLElement>( | ||
...args: Parameters<typeof _getByShadowLabelText> | ||
) => _getByShadowLabelText(...args) as ReturnType<GetByText<T>>; | ||
const findAllByShadowLabelText = <T extends HTMLElement>( | ||
...args: Parameters<typeof _findAllByShadowLabelText> | ||
) => _findAllByShadowLabelText(...args) as ReturnType<FindAllByText<T>>; | ||
const findByShadowLabelText = <T extends HTMLElement>( | ||
...args: Parameters<typeof _findByShadowLabelText> | ||
) => _findByShadowLabelText(...args) as ReturnType<FindByText<T>>; | ||
// Placeholder Text | ||
function queryAllByShadowPlaceholderText<T extends HTMLElement = HTMLElement>( | ||
...args: ShadowMatcherParams | ||
): T[] { | ||
): ReturnType<AllByText<T>> { | ||
let [container, id, options] = args; | ||
@@ -146,6 +193,6 @@ | ||
.map((el) => | ||
queryAllByPlaceholderText(el as HTMLElement, id, options) | ||
queryAllByPlaceholderText(el as HTMLElement, id, options), | ||
) | ||
.flat(Infinity) | ||
) | ||
.flat(Infinity), | ||
), | ||
), | ||
@@ -161,7 +208,7 @@ ] as T[]; | ||
const [ | ||
queryByShadowPlaceholderText, | ||
getAllByShadowPlaceholderText, | ||
getByShadowPlaceholderText, | ||
findAllByShadowPlaceholderText, | ||
findByShadowPlaceholderText, | ||
_queryByShadowPlaceholderText, | ||
_getAllByShadowPlaceholderText, | ||
_getByShadowPlaceholderText, | ||
_findAllByShadowPlaceholderText, | ||
_findByShadowPlaceholderText, | ||
] = toShadowQueries( | ||
@@ -171,10 +218,26 @@ buildQueries<ScreenShadowSelectorMatcherParams>( | ||
getMultiplePlaceholderTextError, | ||
getMissingPlaceholderTextError | ||
) | ||
getMissingPlaceholderTextError, | ||
), | ||
); | ||
const queryByShadowPlaceholderText = <T extends HTMLElement>( | ||
...args: Parameters<typeof _queryByShadowPlaceholderText> | ||
) => _queryByShadowPlaceholderText(...args) as ReturnType<QueryByText<T>>; | ||
const getAllByShadowPlaceholderText = <T extends HTMLElement>( | ||
...args: Parameters<typeof _getAllByShadowPlaceholderText> | ||
) => _getAllByShadowPlaceholderText(...args) as Array<ReturnType<GetByText<T>>>; | ||
const getByShadowPlaceholderText = <T extends HTMLElement>( | ||
...args: Parameters<typeof _getByShadowPlaceholderText> | ||
) => _getByShadowPlaceholderText(...args) as ReturnType<GetByText<T>>; | ||
const findAllByShadowPlaceholderText = <T extends HTMLElement>( | ||
...args: Parameters<typeof _findAllByShadowPlaceholderText> | ||
) => _findAllByShadowPlaceholderText(...args) as ReturnType<FindAllByText<T>>; | ||
const findByShadowPlaceholderText = <T extends HTMLElement>( | ||
...args: Parameters<typeof _findByShadowPlaceholderText> | ||
) => _findByShadowPlaceholderText(...args) as ReturnType<FindByText<T>>; | ||
// Text | ||
function queryAllByShadowText<T extends HTMLElement = HTMLElement>( | ||
...args: ShadowSelectorMatcherParams | ||
): T[] { | ||
): ReturnType<AllByText<T>> { | ||
let [container, id, options] = args; | ||
@@ -193,4 +256,4 @@ | ||
.map((el) => queryAllByText(el as HTMLElement, id, options)) | ||
.flat(Infinity) | ||
) | ||
.flat(Infinity), | ||
), | ||
), | ||
@@ -206,7 +269,7 @@ ] as T[]; | ||
const [ | ||
queryByShadowText, | ||
getAllByShadowText, | ||
getByShadowText, | ||
findAllByShadowText, | ||
findByShadowText, | ||
_queryByShadowText, | ||
_getAllByShadowText, | ||
_getByShadowText, | ||
_findAllByShadowText, | ||
_findByShadowText, | ||
] = toShadowQueries( | ||
@@ -216,10 +279,26 @@ buildQueries<ScreenShadowSelectorMatcherParams>( | ||
getMultipleTextError, | ||
getMissingTextError | ||
) | ||
getMissingTextError, | ||
), | ||
); | ||
const queryByShadowText = <T extends HTMLElement>( | ||
...args: Parameters<typeof _queryByShadowText> | ||
) => _queryByShadowText(...args) as ReturnType<QueryByText<T>>; | ||
const getAllByShadowText = <T extends HTMLElement>( | ||
...args: Parameters<typeof _getAllByShadowText> | ||
) => _getAllByShadowText(...args) as Array<ReturnType<GetByText<T>>>; | ||
const getByShadowText = <T extends HTMLElement>( | ||
...args: Parameters<typeof _getByShadowText> | ||
) => _getByShadowText(...args) as ReturnType<GetByText<T>>; | ||
const findAllByShadowText = <T extends HTMLElement>( | ||
...args: Parameters<typeof _findAllByShadowText> | ||
) => _findAllByShadowText(...args) as ReturnType<FindAllByText<T>>; | ||
const findByShadowText = <T extends HTMLElement>( | ||
...args: Parameters<typeof _findByShadowText> | ||
) => _findByShadowText(...args) as ReturnType<FindByText<T>>; | ||
// Display Value | ||
function queryAllByShadowDisplayValue<T extends HTMLElement = HTMLElement>( | ||
...args: ShadowSelectorMatcherParams | ||
): T[] { | ||
): ReturnType<AllByBoundAttribute<T>> { | ||
let [container, id, options] = args; | ||
@@ -238,4 +317,4 @@ | ||
.map((el) => queryAllByDisplayValue(el as HTMLElement, id, options)) | ||
.flat(Infinity) | ||
) | ||
.flat(Infinity), | ||
), | ||
), | ||
@@ -251,7 +330,7 @@ ] as T[]; | ||
const [ | ||
queryByShadowDisplayValue, | ||
getAllByShadowDisplayValue, | ||
getByShadowDisplayValue, | ||
findAllByShadowDisplayValue, | ||
findByShadowDisplayValue, | ||
_queryByShadowDisplayValue, | ||
_getAllByShadowDisplayValue, | ||
_getByShadowDisplayValue, | ||
_findAllByShadowDisplayValue, | ||
_findByShadowDisplayValue, | ||
] = toShadowQueries( | ||
@@ -261,10 +340,33 @@ buildQueries<ScreenShadowSelectorMatcherParams>( | ||
getMultipleDisplayValueError, | ||
getMissingDisplayValueError | ||
) | ||
getMissingDisplayValueError, | ||
), | ||
); | ||
const queryByShadowDisplayValue = <T extends HTMLElement>( | ||
...args: Parameters<typeof _queryByShadowDisplayValue> | ||
) => | ||
_queryByShadowDisplayValue(...args) as ReturnType<QueryByBoundAttribute<T>>; | ||
const getAllByShadowDisplayValue = <T extends HTMLElement>( | ||
...args: Parameters<typeof _getAllByShadowDisplayValue> | ||
) => | ||
_getAllByShadowDisplayValue(...args) as Array< | ||
ReturnType<GetByBoundAttribute<T>> | ||
>; | ||
const getByShadowDisplayValue = <T extends HTMLElement>( | ||
...args: Parameters<typeof _getByShadowDisplayValue> | ||
) => _getByShadowDisplayValue(...args) as ReturnType<GetByBoundAttribute<T>>; | ||
const findAllByShadowDisplayValue = <T extends HTMLElement>( | ||
...args: Parameters<typeof _findAllByShadowDisplayValue> | ||
) => | ||
_findAllByShadowDisplayValue(...args) as ReturnType< | ||
FindAllByBoundAttribute<T> | ||
>; | ||
const findByShadowDisplayValue = <T extends HTMLElement>( | ||
...args: Parameters<typeof _findByShadowDisplayValue> | ||
) => _findByShadowDisplayValue(...args) as ReturnType<FindByBoundAttribute<T>>; | ||
// Alt Text | ||
function queryAllByShadowAltText<T extends HTMLElement = HTMLElement>( | ||
...args: ShadowMatcherParams | ||
): T[] { | ||
): ReturnType<AllByText<T>> { | ||
let [container, id, options] = args; | ||
@@ -283,4 +385,4 @@ | ||
.map((el) => queryAllByAltText(el as HTMLElement, id, options)) | ||
.flat(Infinity) | ||
) | ||
.flat(Infinity), | ||
), | ||
), | ||
@@ -296,7 +398,7 @@ ] as T[]; | ||
const [ | ||
queryByShadowAltText, | ||
getAllByShadowAltText, | ||
getByShadowAltText, | ||
findAllByShadowAltText, | ||
findByShadowAltText, | ||
_queryByShadowAltText, | ||
_getAllByShadowAltText, | ||
_getByShadowAltText, | ||
_findAllByShadowAltText, | ||
_findByShadowAltText, | ||
] = toShadowQueries( | ||
@@ -306,10 +408,26 @@ buildQueries<ScreenShadowMatcherParams>( | ||
getMultipleAltTextError, | ||
getMissingAltTextError | ||
) | ||
getMissingAltTextError, | ||
), | ||
); | ||
const queryByShadowAltText = <T extends HTMLElement>( | ||
...args: Parameters<typeof _queryByShadowAltText> | ||
) => _queryByShadowAltText(...args) as ReturnType<QueryByText<T>>; | ||
const getAllByShadowAltText = <T extends HTMLElement>( | ||
...args: Parameters<typeof _getAllByShadowAltText> | ||
) => _getAllByShadowAltText(...args) as Array<ReturnType<GetByText<T>>>; | ||
const getByShadowAltText = <T extends HTMLElement>( | ||
...args: Parameters<typeof _getByShadowAltText> | ||
) => _getByShadowAltText(...args) as ReturnType<GetByText<T>>; | ||
const findAllByShadowAltText = <T extends HTMLElement>( | ||
...args: Parameters<typeof _findAllByShadowAltText> | ||
) => _findAllByShadowAltText(...args) as ReturnType<FindAllByText<T>>; | ||
const findByShadowAltText = <T extends HTMLElement>( | ||
...args: Parameters<typeof _findByShadowAltText> | ||
) => _findByShadowAltText(...args) as ReturnType<FindByText<T>>; | ||
// Title | ||
function queryAllByShadowTitle<T extends HTMLElement = HTMLElement>( | ||
...args: ShadowMatcherParams | ||
): T[] { | ||
): ReturnType<AllByBoundAttribute<T>> { | ||
let [container, id, options] = args; | ||
@@ -328,4 +446,4 @@ | ||
.map((el) => queryAllByTitle(el as HTMLElement, id, options)) | ||
.flat(Infinity) | ||
) | ||
.flat(Infinity), | ||
), | ||
), | ||
@@ -341,7 +459,7 @@ ] as T[]; | ||
const [ | ||
queryByShadowTitle, | ||
getAllByShadowTitle, | ||
getByShadowTitle, | ||
findAllByShadowTitle, | ||
findByShadowTitle, | ||
_queryByShadowTitle, | ||
_getAllByShadowTitle, | ||
_getByShadowTitle, | ||
_findAllByShadowTitle, | ||
_findByShadowTitle, | ||
] = toShadowQueries( | ||
@@ -351,10 +469,26 @@ buildQueries<ScreenShadowMatcherParams>( | ||
getMultipleTitleError, | ||
getMissingTitleError | ||
) | ||
getMissingTitleError, | ||
), | ||
); | ||
const queryByShadowTitle = <T extends HTMLElement>( | ||
...args: Parameters<typeof _queryByShadowTitle> | ||
) => _queryByShadowTitle(...args) as ReturnType<QueryByBoundAttribute<T>>; | ||
const getAllByShadowTitle = <T extends HTMLElement>( | ||
...args: Parameters<typeof _getAllByShadowTitle> | ||
) => _getAllByShadowTitle(...args) as Array<ReturnType<GetByBoundAttribute<T>>>; | ||
const getByShadowTitle = <T extends HTMLElement>( | ||
...args: Parameters<typeof _getByShadowTitle> | ||
) => _getByShadowTitle(...args) as ReturnType<GetByBoundAttribute<T>>; | ||
const findAllByShadowTitle = <T extends HTMLElement>( | ||
...args: Parameters<typeof _findAllByShadowTitle> | ||
) => _findAllByShadowTitle(...args) as ReturnType<FindAllByBoundAttribute<T>>; | ||
const findByShadowTitle = <T extends HTMLElement>( | ||
...args: Parameters<typeof _findByShadowTitle> | ||
) => _findByShadowTitle(...args) as ReturnType<FindByBoundAttribute<T>>; | ||
// Test Id | ||
function queryAllByShadowTestId<T extends HTMLElement = HTMLElement>( | ||
...args: ShadowMatcherParams | ||
): T[] { | ||
): ReturnType<AllByBoundAttribute<T>> { | ||
let [container, id, options] = args; | ||
@@ -373,4 +507,4 @@ | ||
.map((el) => queryAllByTestId(el as HTMLElement, id, options)) | ||
.flat(Infinity) | ||
) | ||
.flat(Infinity), | ||
), | ||
), | ||
@@ -386,7 +520,7 @@ ] as T[]; | ||
const [ | ||
queryByShadowTestId, | ||
getAllByShadowTestId, | ||
getByShadowTestId, | ||
findAllByShadowTestId, | ||
findByShadowTestId, | ||
_queryByShadowTestId, | ||
_getAllByShadowTestId, | ||
_getByShadowTestId, | ||
_findAllByShadowTestId, | ||
_findByShadowTestId, | ||
] = toShadowQueries( | ||
@@ -396,6 +530,23 @@ buildQueries<ScreenShadowMatcherParams>( | ||
getMultipleTestIdError, | ||
getMissingTestIdError | ||
) | ||
getMissingTestIdError, | ||
), | ||
); | ||
const queryByShadowTestId = <T extends HTMLElement>( | ||
...args: Parameters<typeof _queryByShadowTestId> | ||
) => _queryByShadowTestId(...args) as ReturnType<QueryByBoundAttribute<T>>; | ||
const getAllByShadowTestId = <T extends HTMLElement>( | ||
...args: Parameters<typeof _getAllByShadowTestId> | ||
) => | ||
_getAllByShadowTestId(...args) as Array<ReturnType<GetByBoundAttribute<T>>>; | ||
const getByShadowTestId = <T extends HTMLElement>( | ||
...args: Parameters<typeof _getByShadowTestId> | ||
) => _getByShadowTestId(...args) as ReturnType<GetByBoundAttribute<T>>; | ||
const findAllByShadowTestId = <T extends HTMLElement>( | ||
...args: Parameters<typeof _findAllByShadowTestId> | ||
) => _findAllByShadowTestId(...args) as ReturnType<FindAllByBoundAttribute<T>>; | ||
const findByShadowTestId = <T extends HTMLElement>( | ||
...args: Parameters<typeof _findByShadowTestId> | ||
) => _findByShadowTestId(...args) as ReturnType<FindByBoundAttribute<T>>; | ||
export { | ||
@@ -402,0 +553,0 @@ // Role |
@@ -19,298 +19,418 @@ import { debug } from "./debug"; | ||
// Role | ||
queryAllByShadowRole: (...args: ScreenShadowRoleMatcherParams) => | ||
shadowQueries.queryAllByShadowRole( | ||
queryAllByShadowRole: <T extends HTMLElement>( | ||
...args: ScreenShadowRoleMatcherParams | ||
) => | ||
shadowQueries.queryAllByShadowRole<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
queryByShadowRole: (...args: ScreenShadowRoleMatcherParams) => | ||
shadowQueries.queryByShadowRole(document.documentElement, args[0], args[1]), | ||
getAllByShadowRole: (...args: ScreenShadowRoleMatcherParams) => | ||
shadowQueries.getAllByShadowRole( | ||
queryByShadowRole: <T extends HTMLElement>( | ||
...args: ScreenShadowRoleMatcherParams | ||
) => | ||
shadowQueries.queryByShadowRole<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
getByShadowRole: (...args: ScreenShadowRoleMatcherParams) => | ||
shadowQueries.getByShadowRole(document.documentElement, args[0], args[1]), | ||
findAllByShadowRole: (...args: AsyncScreenShadowRoleMatcherParams) => | ||
shadowQueries.findAllByShadowRole( | ||
getAllByShadowRole: <T extends HTMLElement>( | ||
...args: ScreenShadowRoleMatcherParams | ||
) => | ||
shadowQueries.getAllByShadowRole<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1], | ||
args[2] | ||
), | ||
findByShadowRole: (...args: AsyncScreenShadowRoleMatcherParams) => | ||
shadowQueries.findByShadowRole( | ||
getByShadowRole: <T extends HTMLElement>( | ||
...args: ScreenShadowRoleMatcherParams | ||
) => | ||
shadowQueries.getByShadowRole<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1], | ||
args[2] | ||
), | ||
findAllByShadowRole: <T extends HTMLElement>( | ||
...args: AsyncScreenShadowRoleMatcherParams | ||
) => | ||
shadowQueries.findAllByShadowRole<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1], | ||
args[2], | ||
), | ||
findByShadowRole: <T extends HTMLElement>( | ||
...args: AsyncScreenShadowRoleMatcherParams | ||
) => | ||
shadowQueries.findByShadowRole<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1], | ||
args[2], | ||
), | ||
// Label Text | ||
queryAllByShadowLabelText: (...args: ScreenShadowSelectorMatcherParams) => | ||
shadowQueries.queryAllByShadowLabelText( | ||
queryAllByShadowLabelText: <T extends HTMLElement>( | ||
...args: ScreenShadowSelectorMatcherParams | ||
) => | ||
shadowQueries.queryAllByShadowLabelText<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
queryByShadowLabelText: (...args: ScreenShadowSelectorMatcherParams) => | ||
shadowQueries.queryByShadowLabelText( | ||
queryByShadowLabelText: <T extends HTMLElement>( | ||
...args: ScreenShadowSelectorMatcherParams | ||
) => | ||
shadowQueries.queryByShadowLabelText<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
getAllByShadowLabelText: (...args: ScreenShadowSelectorMatcherParams) => | ||
shadowQueries.getAllByShadowLabelText( | ||
getAllByShadowLabelText: <T extends HTMLElement>( | ||
...args: ScreenShadowSelectorMatcherParams | ||
) => | ||
shadowQueries.getAllByShadowLabelText<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
getByShadowLabelText: (...args: ScreenShadowSelectorMatcherParams) => | ||
shadowQueries.getByShadowLabelText( | ||
getByShadowLabelText: <T extends HTMLElement>( | ||
...args: ScreenShadowSelectorMatcherParams | ||
) => | ||
shadowQueries.getByShadowLabelText<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
findAllByShadowLabelText: (...args: AsyncScreenShadowSelectorMatcherParams) => | ||
shadowQueries.findAllByShadowLabelText( | ||
findAllByShadowLabelText: <T extends HTMLElement>( | ||
...args: AsyncScreenShadowSelectorMatcherParams | ||
) => | ||
shadowQueries.findAllByShadowLabelText<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1], | ||
args[2] | ||
args[2], | ||
), | ||
findByShadowLabelText: (...args: AsyncScreenShadowSelectorMatcherParams) => | ||
shadowQueries.findByShadowLabelText( | ||
findByShadowLabelText: <T extends HTMLElement>( | ||
...args: AsyncScreenShadowSelectorMatcherParams | ||
) => | ||
shadowQueries.findByShadowLabelText<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1], | ||
args[2] | ||
args[2], | ||
), | ||
// Placeholder Text | ||
queryAllByShadowPlaceholderText: (...args: ScreenShadowMatcherParams) => | ||
shadowQueries.queryAllByShadowPlaceholderText( | ||
queryAllByShadowPlaceholderText: <T extends HTMLElement>( | ||
...args: ScreenShadowMatcherParams | ||
) => | ||
shadowQueries.queryAllByShadowPlaceholderText<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
queryByShadowPlaceholderText: (...args: ScreenShadowMatcherParams) => | ||
shadowQueries.queryByShadowPlaceholderText( | ||
queryByShadowPlaceholderText: <T extends HTMLElement>( | ||
...args: ScreenShadowMatcherParams | ||
) => | ||
shadowQueries.queryByShadowPlaceholderText<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
getAllByShadowPlaceholderText: (...args: ScreenShadowMatcherParams) => | ||
shadowQueries.getAllByShadowPlaceholderText( | ||
getAllByShadowPlaceholderText: <T extends HTMLElement>( | ||
...args: ScreenShadowMatcherParams | ||
) => | ||
shadowQueries.getAllByShadowPlaceholderText<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
getByShadowPlaceholderText: (...args: ScreenShadowMatcherParams) => | ||
shadowQueries.getByShadowPlaceholderText( | ||
getByShadowPlaceholderText: <T extends HTMLElement>( | ||
...args: ScreenShadowMatcherParams | ||
) => | ||
shadowQueries.getByShadowPlaceholderText<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
findAllByShadowPlaceholderText: (...args: AsyncScreenShadowMatcherParams) => | ||
shadowQueries.findAllByShadowPlaceholderText( | ||
findAllByShadowPlaceholderText: <T extends HTMLElement>( | ||
...args: AsyncScreenShadowMatcherParams | ||
) => | ||
shadowQueries.findAllByShadowPlaceholderText<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1], | ||
args[2] | ||
args[2], | ||
), | ||
findByShadowPlaceholderText: (...args: AsyncScreenShadowMatcherParams) => | ||
shadowQueries.findByShadowPlaceholderText( | ||
findByShadowPlaceholderText: <T extends HTMLElement>( | ||
...args: AsyncScreenShadowMatcherParams | ||
) => | ||
shadowQueries.findByShadowPlaceholderText<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1], | ||
args[2] | ||
args[2], | ||
), | ||
// Text | ||
queryAllByShadowText: (...args: ScreenShadowSelectorMatcherParams) => | ||
shadowQueries.queryAllByShadowText( | ||
queryAllByShadowText: <T extends HTMLElement>( | ||
...args: ScreenShadowSelectorMatcherParams | ||
) => | ||
shadowQueries.queryAllByShadowText<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
queryByShadowText: (...args: ScreenShadowSelectorMatcherParams) => | ||
shadowQueries.queryByShadowText(document.documentElement, args[0], args[1]), | ||
getAllByShadowText: (...args: ScreenShadowSelectorMatcherParams) => | ||
shadowQueries.getAllByShadowText( | ||
queryByShadowText: <T extends HTMLElement>( | ||
...args: ScreenShadowSelectorMatcherParams | ||
) => | ||
shadowQueries.queryByShadowText<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
getByShadowText: (...args: ScreenShadowSelectorMatcherParams) => | ||
shadowQueries.getByShadowText(document.documentElement, args[0], args[1]), | ||
findAllByShadowText: (...args: AsyncScreenShadowSelectorMatcherParams) => | ||
shadowQueries.findAllByShadowText( | ||
getAllByShadowText: <T extends HTMLElement>( | ||
...args: ScreenShadowSelectorMatcherParams | ||
) => | ||
shadowQueries.getAllByShadowText<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1], | ||
args[2] | ||
), | ||
findByShadowText: (...args: AsyncScreenShadowSelectorMatcherParams) => | ||
shadowQueries.findByShadowText( | ||
getByShadowText: <T extends HTMLElement>( | ||
...args: ScreenShadowSelectorMatcherParams | ||
) => | ||
shadowQueries.getByShadowText<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1], | ||
args[2] | ||
), | ||
findAllByShadowText: <T extends HTMLElement>( | ||
...args: AsyncScreenShadowSelectorMatcherParams | ||
) => | ||
shadowQueries.findAllByShadowText<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1], | ||
args[2], | ||
), | ||
findByShadowText: <T extends HTMLElement>( | ||
...args: AsyncScreenShadowSelectorMatcherParams | ||
) => | ||
shadowQueries.findByShadowText<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1], | ||
args[2], | ||
), | ||
// Display Value | ||
queryAllByShadowDisplayValue: (...args: ScreenShadowMatcherParams) => | ||
shadowQueries.queryAllByShadowDisplayValue( | ||
queryAllByShadowDisplayValue: <T extends HTMLElement>( | ||
...args: ScreenShadowMatcherParams | ||
) => | ||
shadowQueries.queryAllByShadowDisplayValue<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
queryByShadowDisplayValue: (...args: ScreenShadowMatcherParams) => | ||
shadowQueries.queryByShadowDisplayValue( | ||
queryByShadowDisplayValue: <T extends HTMLElement>( | ||
...args: ScreenShadowMatcherParams | ||
) => | ||
shadowQueries.queryByShadowDisplayValue<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
getAllByShadowDisplayValue: (...args: ScreenShadowMatcherParams) => | ||
shadowQueries.getAllByShadowDisplayValue( | ||
getAllByShadowDisplayValue: <T extends HTMLElement>( | ||
...args: ScreenShadowMatcherParams | ||
) => | ||
shadowQueries.getAllByShadowDisplayValue<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
getByShadowDisplayValue: (...args: ScreenShadowMatcherParams) => | ||
shadowQueries.getByShadowDisplayValue( | ||
getByShadowDisplayValue: <T extends HTMLElement>( | ||
...args: ScreenShadowMatcherParams | ||
) => | ||
shadowQueries.getByShadowDisplayValue<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
findAllByShadowDisplayValue: (...args: AsyncScreenShadowMatcherParams) => | ||
shadowQueries.findAllByShadowDisplayValue( | ||
findAllByShadowDisplayValue: <T extends HTMLElement>( | ||
...args: AsyncScreenShadowMatcherParams | ||
) => | ||
shadowQueries.findAllByShadowDisplayValue<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1], | ||
args[2] | ||
args[2], | ||
), | ||
findByShadowDisplayValue: (...args: AsyncScreenShadowMatcherParams) => | ||
shadowQueries.findByShadowDisplayValue( | ||
findByShadowDisplayValue: <T extends HTMLElement>( | ||
...args: AsyncScreenShadowMatcherParams | ||
) => | ||
shadowQueries.findByShadowDisplayValue<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1], | ||
args[2] | ||
args[2], | ||
), | ||
// Alt Text | ||
queryAllByShadowAltText: (...args: ScreenShadowMatcherParams) => | ||
shadowQueries.queryAllByShadowAltText( | ||
queryAllByShadowAltText: <T extends HTMLElement>( | ||
...args: ScreenShadowMatcherParams | ||
) => | ||
shadowQueries.queryAllByShadowAltText<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
queryByShadowAltText: (...args: ScreenShadowMatcherParams) => | ||
shadowQueries.queryByShadowAltText( | ||
queryByShadowAltText: <T extends HTMLElement>( | ||
...args: ScreenShadowMatcherParams | ||
) => | ||
shadowQueries.queryByShadowAltText<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
getAllByShadowAltText: (...args: ScreenShadowMatcherParams) => | ||
shadowQueries.getAllByShadowAltText( | ||
getAllByShadowAltText: <T extends HTMLElement>( | ||
...args: ScreenShadowMatcherParams | ||
) => | ||
shadowQueries.getAllByShadowAltText<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
getByShadowAltText: (...args: ScreenShadowMatcherParams) => | ||
shadowQueries.getByShadowAltText( | ||
getByShadowAltText: <T extends HTMLElement>( | ||
...args: ScreenShadowMatcherParams | ||
) => | ||
shadowQueries.getByShadowAltText<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
findAllByShadowAltText: (...args: AsyncScreenShadowMatcherParams) => | ||
shadowQueries.findAllByShadowAltText( | ||
findAllByShadowAltText: <T extends HTMLElement>( | ||
...args: AsyncScreenShadowMatcherParams | ||
) => | ||
shadowQueries.findAllByShadowAltText<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1], | ||
args[2] | ||
args[2], | ||
), | ||
findByShadowAltText: (...args: AsyncScreenShadowMatcherParams) => | ||
shadowQueries.findByShadowAltText( | ||
findByShadowAltText: <T extends HTMLElement>( | ||
...args: AsyncScreenShadowMatcherParams | ||
) => | ||
shadowQueries.findByShadowAltText<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1], | ||
args[2] | ||
args[2], | ||
), | ||
// Title | ||
queryAllByShadowTitle: (...args: ScreenShadowMatcherParams) => | ||
shadowQueries.queryAllByShadowTitle( | ||
queryAllByShadowTitle: <T extends HTMLElement>( | ||
...args: ScreenShadowMatcherParams | ||
) => | ||
shadowQueries.queryAllByShadowTitle<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
queryByShadowTitle: (...args: ScreenShadowMatcherParams) => | ||
shadowQueries.queryByShadowTitle( | ||
queryByShadowTitle: <T extends HTMLElement>( | ||
...args: ScreenShadowMatcherParams | ||
) => | ||
shadowQueries.queryByShadowTitle<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
getAllByShadowTitle: (...args: ScreenShadowMatcherParams) => | ||
shadowQueries.getAllByShadowTitle( | ||
getAllByShadowTitle: <T extends HTMLElement>( | ||
...args: ScreenShadowMatcherParams | ||
) => | ||
shadowQueries.getAllByShadowTitle<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
getByShadowTitle: (...args: ScreenShadowMatcherParams) => | ||
shadowQueries.getByShadowTitle(document.documentElement, args[0], args[1]), | ||
findAllByShadowTitle: (...args: AsyncScreenShadowMatcherParams) => | ||
shadowQueries.findAllByShadowTitle( | ||
getByShadowTitle: <T extends HTMLElement>( | ||
...args: ScreenShadowMatcherParams | ||
) => | ||
shadowQueries.getByShadowTitle<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1], | ||
args[2] | ||
), | ||
findByShadowTitle: (...args: AsyncScreenShadowMatcherParams) => | ||
shadowQueries.findByShadowTitle( | ||
findAllByShadowTitle: <T extends HTMLElement>( | ||
...args: AsyncScreenShadowMatcherParams | ||
) => | ||
shadowQueries.findAllByShadowTitle<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1], | ||
args[2] | ||
args[2], | ||
), | ||
findByShadowTitle: <T extends HTMLElement>( | ||
...args: AsyncScreenShadowMatcherParams | ||
) => | ||
shadowQueries.findByShadowTitle<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1], | ||
args[2], | ||
), | ||
// Test Id | ||
queryAllByShadowTestId: (...args: ScreenShadowMatcherParams) => | ||
shadowQueries.queryAllByShadowTestId( | ||
queryAllByShadowTestId: <T extends HTMLElement>( | ||
...args: ScreenShadowMatcherParams | ||
) => | ||
shadowQueries.queryAllByShadowTestId<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
queryByShadowTestId: (...args: ScreenShadowMatcherParams) => | ||
shadowQueries.queryByShadowTestId( | ||
queryByShadowTestId: <T extends HTMLElement>( | ||
...args: ScreenShadowMatcherParams | ||
) => | ||
shadowQueries.queryByShadowTestId<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
getAllByShadowTestId: (...args: ScreenShadowMatcherParams) => | ||
shadowQueries.getAllByShadowTestId( | ||
getAllByShadowTestId: <T extends HTMLElement>( | ||
...args: ScreenShadowMatcherParams | ||
) => | ||
shadowQueries.getAllByShadowTestId<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1] | ||
args[1], | ||
), | ||
getByShadowTestId: (...args: ScreenShadowMatcherParams) => | ||
shadowQueries.getByShadowTestId(document.documentElement, args[0], args[1]), | ||
findAllByShadowTestId: (...args: AsyncScreenShadowMatcherParams) => | ||
shadowQueries.findAllByShadowTestId( | ||
getByShadowTestId: <T extends HTMLElement>( | ||
...args: ScreenShadowMatcherParams | ||
) => | ||
shadowQueries.getByShadowTestId<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1], | ||
args[2] | ||
), | ||
findByShadowTestId: (...args: AsyncScreenShadowMatcherParams) => | ||
shadowQueries.findByShadowTestId( | ||
findAllByShadowTestId: <T extends HTMLElement>( | ||
...args: AsyncScreenShadowMatcherParams | ||
) => | ||
shadowQueries.findAllByShadowTestId<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1], | ||
args[2] | ||
args[2], | ||
), | ||
findByShadowTestId: <T extends HTMLElement>( | ||
...args: AsyncScreenShadowMatcherParams | ||
) => | ||
shadowQueries.findByShadowTestId<T>( | ||
document.documentElement, | ||
args[0], | ||
args[1], | ||
args[2], | ||
), | ||
}; | ||
export { shadowScreen }; |
@@ -30,3 +30,3 @@ declare global { | ||
export function patchWrap<T extends (...args: any) => any>( | ||
callback: T | ||
callback: T, | ||
): ReturnType<T> { | ||
@@ -33,0 +33,0 @@ patchDOM(); |
@@ -25,11 +25,11 @@ import { | ||
container: HTMLElement, | ||
...args: ScreenShadowRoleMatcherParams | ||
...args: ScreenShadowRoleMatcherParams, | ||
]; | ||
export type ShadowSelectorMatcherParams = [ | ||
container: HTMLElement, | ||
...args: ScreenShadowSelectorMatcherParams | ||
...args: ScreenShadowSelectorMatcherParams, | ||
]; | ||
export type ShadowMatcherParams = [ | ||
container: HTMLElement, | ||
...args: ScreenShadowMatcherParams | ||
...args: ScreenShadowMatcherParams, | ||
]; | ||
@@ -39,11 +39,11 @@ | ||
role: ByRoleMatcher, | ||
options?: ShadowByRoleOptions | undefined | ||
options?: ShadowByRoleOptions | undefined, | ||
]; | ||
export type ScreenShadowSelectorMatcherParams = [ | ||
id: Matcher, | ||
options?: ShadowSelectorMatcherOptions | undefined | ||
options?: ShadowSelectorMatcherOptions | undefined, | ||
]; | ||
export type ScreenShadowMatcherParams = [ | ||
id: Matcher, | ||
options?: ShadowMatcherOptions | undefined | ||
options?: ShadowMatcherOptions | undefined, | ||
]; | ||
@@ -54,11 +54,11 @@ | ||
container: HTMLElement, | ||
...args: AsyncScreenShadowRoleMatcherParams | ||
...args: AsyncScreenShadowRoleMatcherParams, | ||
]; | ||
export type AsyncShadowSelectorMatcherParams = [ | ||
container: HTMLElement, | ||
...args: AsyncScreenShadowSelectorMatcherParams | ||
...args: AsyncScreenShadowSelectorMatcherParams, | ||
]; | ||
export type AsyncShadowMatcherParams = [ | ||
container: HTMLElement, | ||
...args: AsyncScreenShadowMatcherParams | ||
...args: AsyncScreenShadowMatcherParams, | ||
]; | ||
@@ -69,3 +69,3 @@ | ||
options?: ShadowByRoleOptions | undefined, | ||
waitForOptions?: waitForOptions | undefined | ||
waitForOptions?: waitForOptions | undefined, | ||
]; | ||
@@ -75,3 +75,3 @@ export type AsyncScreenShadowSelectorMatcherParams = [ | ||
options?: ShadowSelectorMatcherOptions | undefined, | ||
waitForOptions?: waitForOptions | undefined | ||
waitForOptions?: waitForOptions | undefined, | ||
]; | ||
@@ -81,3 +81,3 @@ export type AsyncScreenShadowMatcherParams = [ | ||
options?: ShadowMatcherOptions | undefined, | ||
waitForOptions?: waitForOptions | undefined | ||
waitForOptions?: waitForOptions | undefined, | ||
]; |
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 too big to display
Sorry, the diff of this file is not supported yet
315599
2228
292
24