shadow-dom-testing-library
Advanced tools
Comparing version 1.10.0 to 1.11.0
@@ -1,3 +0,6 @@ | ||
var Pe=Object.defineProperty;var Re=(e,o)=>{for(var n in o)Pe(e,n,{get:o[n],enumerable:!0})};import{queries as Tt,within as Mt}from"@testing-library/dom";var x={};Re(x,{findAllByShadowAltText:()=>ee,findAllByShadowDisplayValue:()=>Y,findAllByShadowLabelText:()=>I,findAllByShadowPlaceholderText:()=>_,findAllByShadowRole:()=>q,findAllByShadowTestId:()=>se,findAllByShadowText:()=>j,findAllByShadowTitle:()=>le,findByShadowAltText:()=>te,findByShadowDisplayValue:()=>J,findByShadowLabelText:()=>N,findByShadowPlaceholderText:()=>$,findByShadowRole:()=>Q,findByShadowTestId:()=>ue,findByShadowText:()=>k,findByShadowTitle:()=>re,getAllByShadowAltText:()=>Z,getAllByShadowDisplayValue:()=>X,getAllByShadowLabelText:()=>b,getAllByShadowPlaceholderText:()=>C,getAllByShadowRole:()=>R,getAllByShadowTestId:()=>ce,getAllByShadowText:()=>U,getAllByShadowTitle:()=>ne,getByShadowAltText:()=>v,getByShadowDisplayValue:()=>z,getByShadowLabelText:()=>H,getByShadowPlaceholderText:()=>V,getByShadowRole:()=>L,getByShadowTestId:()=>he,getByShadowText:()=>W,getByShadowTitle:()=>ae,queryAllByShadowAltText:()=>E,queryAllByShadowDisplayValue:()=>M,queryAllByShadowLabelText:()=>f,queryAllByShadowPlaceholderText:()=>p,queryAllByShadowRole:()=>y,queryAllByShadowTestId:()=>B,queryAllByShadowText:()=>T,queryAllByShadowTitle:()=>A,queryByShadowAltText:()=>K,queryByShadowDisplayValue:()=>G,queryByShadowLabelText:()=>D,queryByShadowPlaceholderText:()=>O,queryByShadowRole:()=>P,queryByShadowTestId:()=>de,queryByShadowText:()=>F,queryByShadowTitle:()=>oe});import{buildQueries as u,queryAllByRole as be,queryAllByLabelText as He,queryAllByPlaceholderText as Ie,queryAllByText as Ne,queryAllByDisplayValue as Oe,queryAllByAltText as Ce,queryAllByTitle as Ve,queryAllByTestId as _e}from"@testing-library/dom";qe();function Le(){Qe()}function ye(){HTMLSlotElement.prototype.querySelectorAll=HTMLElement.prototype.querySelectorAll}function d(e){Le();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 Qe(){HTMLSlotElement.prototype.querySelectorAll=function(e){let o=HTMLElement.prototype.querySelectorAll,n=[];return this.assignedElements({flatten:!0}).forEach(t=>{let a=t,l=document.createElement("div");l.appendChild(a.cloneNode(!1)),l.querySelector(e)&&n.push(a),n=n.concat(Array.from(a.querySelectorAll(e)))}),n.length==0&&(n=Array.from(o.call(this,e))),[...new Set(n)]}}function De(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 a=h(e,n).map(l=>Array.from(l.querySelectorAll(o))).flat(1/0);return[...new Set(a)]})}function h(e,o={shallow:!1}){return pe(e,"*",o)}function pe(e,o,n={shallow:!1},t=[],a=[]){return e instanceof Document&&(e=document.documentElement),t=[e],a.push(e),e instanceof HTMLElement&&e.shadowRoot!=null&&e.shadowRoot.mode!=="closed"&&(a.push(e.shadowRoot),t.push(e.shadowRoot)),t.forEach(l=>{l.querySelectorAll(o).forEach(r=>{if(r.shadowRoot==null||r.shadowRoot.mode==="closed"){a.push(r);return}if(a.push(r.shadowRoot),n.shallow===!0){r.shadowRoot.querySelectorAll(o).forEach(c=>{a.push(c)});return}r.shadowRoot.querySelectorAll(o).forEach(c=>{a.push(c),t.push(c)}),pe(r.shadowRoot,o,n,t,a)})}),[...new Set(a)]}function i(e){return e.map(o=>(...n)=>{let[t,a,l,...r]=n;return l==null&&(l={}),l.suggest=!1,o(t,a,l,...r)})}function y(...e){let[o,n,t]=e;return t==null&&(t={}),t.suggest=!1,[...new Set(d(()=>h(o,t).map(a=>be(a,n,t)).flat(1/0)))]}var $e=(e,o)=>`Found multiple elements with the role of: ${o}`,Fe=(e,o)=>`Unable to find an element with the role of: ${o}`,[P,R,L,q,Q]=i(u(y,$e,Fe));function f(...e){let[o,n,t]=e;return t==null&&(t={}),t.suggest=!1,[...new Set(d(()=>h(o,t).map(a=>He(a,n,t)).flat(1/0)))]}var Ue=(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}`,[D,b,H,I,N]=i(u(f,Ue,We));function p(...e){let[o,n,t]=e;return t==null&&(t={}),t.suggest=!1,[...new Set(d(()=>h(o,t).map(a=>Ie(a,n,t)).flat(1/0)))]}var je=(e,o)=>`Found multiple elements with the placeholder text of: ${o}`,ke=(e,o)=>`Unable to find an element with the placeholder text of: ${o}`,[O,C,V,_,$]=i(u(p,je,ke));function T(...e){let[o,n,t]=e;return t==null&&(t={}),t.suggest=!1,[...new Set(d(()=>h(o,t).map(a=>Ne(a,n,t)).flat(1/0)))]}var Ge=(e,o)=>`Found multiple elements with the text of: ${o}`,Xe=(e,o)=>`Unable to find an element with the text of: ${o}`,[F,U,W,j,k]=i(u(T,Ge,Xe));function M(...e){let[o,n,t]=e;return t==null&&(t={}),t.suggest=!1,[...new Set(d(()=>h(o,t).map(a=>Oe(a,n,t)).flat(1/0)))]}var ze=(e,o)=>`Found multiple elements with the display value of: ${o}`,Ye=(e,o)=>`Unable to find an element with the display value of: ${o}`,[G,X,z,Y,J]=i(u(M,ze,Ye));function E(...e){let[o,n,t]=e;return t==null&&(t={}),t.suggest=!1,[...new Set(d(()=>h(o,t).map(a=>Ce(a,n,t)).flat(1/0)))]}var Je=(e,o)=>`Found multiple elements with the alt text of: ${o}`,Ke=(e,o)=>`Unable to find an element with the alt text of: ${o}`,[K,Z,v,ee,te]=i(u(E,Je,Ke));function A(...e){let[o,n,t]=e;return t==null&&(t={}),t.suggest=!1,[...new Set(d(()=>h(o,t).map(a=>Ve(a,n,t)).flat(1/0)))]}var Ze=(e,o)=>`Found multiple elements with the title of: ${o}`,ve=(e,o)=>`Unable to find an element with the title of: ${o}`,[oe,ne,ae,le,re]=i(u(A,Ze,ve));function B(...e){let[o,n,t]=e;return t==null&&(t={}),t.suggest=!1,[...new Set(d(()=>h(o,t).map(a=>_e(a,n,t)).flat(1/0)))]}var et=(e,o)=>`Found multiple elements with the test id of: ${o}`,tt=(e,o)=>`Unable to find an element with the test id of: ${o}`,[de,ce,he,se,ue]=i(u(B,et,tt));import{logDOM as yt}from"@testing-library/dom";import{prettyDOM as ot,getConfig as nt}from"@testing-library/dom";var Te=/([^\S\r\n]*[\f\n\r\t\v]+)/.source;function at(e){return e.replace(new RegExp(`${Te}.*${Te}{2,}`,"g"),"")}function lt(...e){let[o,n,t]=e,a=Se((t==null?void 0:t.filterNode)||ie);return t==null&&(t={}),t.plugins==null&&(t.plugins=[]),t.plugins.push(a),d(()=>ot(o,n,{...t,plugins:[a]}))}function Ee(e){return e.replace(/</g,"<").replace(/>/g,">")}function ie(e){return e.nodeType!==me&&(e.nodeType!==Be||!e.matches(nt().defaultIgnore))}var rt=(e,o,n,t,a,l,r)=>{let c=t+n.indent,s=n.colors;return e.map(m=>{let w=o[m],S=r(w,n,c,a,l);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,a,l)=>at(e.map(r=>{let c=typeof r=="string"?Ae(r,o):l(r,o,n,t,a);return c===""&&typeof r=="object"&&r!=null&&r.nodeType!==dt?"":o.spacingOuter+n+c}).join("")),Ae=(e,o)=>{let n=o.colors.content;return n.open+Ee(e)+n.close},ht=(e,o)=>{let n=o.colors.comment;return n.open+"<!--"+Ee(e)+"-->"+n.close},st=(e,o,n,t,a)=>{let l=t.colors.tag;return l.open+"<"+e+(o&&l.close+o+t.spacingOuter+a+l.open)+(n?">"+l.close+n+t.spacingOuter+a+l.open+"</"+e:(o&&!t.min?"":" ")+"/")+">"+l.close},ut=(e,o)=>{let n=o.colors.tag;return n.open+"<"+e+n.close+" \u2026"+n.open+" />"+n.close},Be=1,xe=3,me=8,ge=11,it=/^((HTML|SVG)\w*)?Element$/,mt=e=>{var l;let o=((l=e==null?void 0:e.constructor)==null?void 0:l.name)||"",{nodeType:n,tagName:t}=e,a=typeof t=="string"&&t.includes("-")||typeof e.hasAttribute=="function"&&e.hasAttribute("is")||e instanceof HTMLElement;return n===Be&&(it.test(o)||a)||n===xe&&o==="Text"||n===me&&o==="Comment"||n===ge};function St(e){return e.nodeType===xe}function wt(e){return e.nodeType===me}function Me(e){return e.nodeType===ge}function Se(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,a,l,r,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"),++l>t.maxDepth?ut(s,t):st(s,rt(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,a+t.indent,l,r,c),ct(o(n),t,a+t.indent,l,r,c),t,a)}}}function g(...e){let[o,n,t]=e,a=Se((t==null?void 0:t.filterNode)||ie);t==null&&(t={}),t.plugins==null&&(t.plugins=[]),t.plugins.push(a),d(()=>yt(o,n,t))}function we(...e){let[o,n,t]=e;Array.isArray(o)?o.forEach(a=>g(a,n,t)):g(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)=>P(document.documentElement,e[0],e[1]),getAllByShadowRole:(...e)=>R(document.documentElement,e[0],e[1]),getByShadowRole:(...e)=>L(document.documentElement,e[0],e[1]),findAllByShadowRole:(...e)=>q(document.documentElement,e[0],e[1],e[2]),findByShadowRole:(...e)=>Q(document.documentElement,e[0],e[1],e[2]),queryAllByShadowLabelText:(...e)=>f(document.documentElement,e[0],e[1]),queryByShadowLabelText:(...e)=>D(document.documentElement,e[0],e[1]),getAllByShadowLabelText:(...e)=>b(document.documentElement,e[0],e[1]),getByShadowLabelText:(...e)=>H(document.documentElement,e[0],e[1]),findAllByShadowLabelText:(...e)=>I(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)=>O(document.documentElement,e[0],e[1]),getAllByShadowPlaceholderText:(...e)=>C(document.documentElement,e[0],e[1]),getByShadowPlaceholderText:(...e)=>V(document.documentElement,e[0],e[1]),findAllByShadowPlaceholderText:(...e)=>_(document.documentElement,e[0],e[1],e[2]),findByShadowPlaceholderText:(...e)=>$(document.documentElement,e[0],e[1],e[2]),queryAllByShadowText:(...e)=>T(document.documentElement,e[0],e[1]),queryByShadowText:(...e)=>F(document.documentElement,e[0],e[1]),getAllByShadowText:(...e)=>U(document.documentElement,e[0],e[1]),getByShadowText:(...e)=>W(document.documentElement,e[0],e[1]),findAllByShadowText:(...e)=>j(document.documentElement,e[0],e[1],e[2]),findByShadowText:(...e)=>k(document.documentElement,e[0],e[1],e[2]),queryAllByShadowDisplayValue:(...e)=>M(document.documentElement,e[0],e[1]),queryByShadowDisplayValue:(...e)=>G(document.documentElement,e[0],e[1]),getAllByShadowDisplayValue:(...e)=>X(document.documentElement,e[0],e[1]),getByShadowDisplayValue:(...e)=>z(document.documentElement,e[0],e[1]),findAllByShadowDisplayValue:(...e)=>Y(document.documentElement,e[0],e[1],e[2]),findByShadowDisplayValue:(...e)=>J(document.documentElement,e[0],e[1],e[2]),queryAllByShadowAltText:(...e)=>E(document.documentElement,e[0],e[1]),queryByShadowAltText:(...e)=>K(document.documentElement,e[0],e[1]),getAllByShadowAltText:(...e)=>Z(document.documentElement,e[0],e[1]),getByShadowAltText:(...e)=>v(document.documentElement,e[0],e[1]),findAllByShadowAltText:(...e)=>ee(document.documentElement,e[0],e[1],e[2]),findByShadowAltText:(...e)=>te(document.documentElement,e[0],e[1],e[2]),queryAllByShadowTitle:(...e)=>A(document.documentElement,e[0],e[1]),queryByShadowTitle:(...e)=>oe(document.documentElement,e[0],e[1]),getAllByShadowTitle:(...e)=>ne(document.documentElement,e[0],e[1]),getByShadowTitle:(...e)=>ae(document.documentElement,e[0],e[1]),findAllByShadowTitle:(...e)=>le(document.documentElement,e[0],e[1],e[2]),findByShadowTitle:(...e)=>re(document.documentElement,e[0],e[1],e[2]),queryAllByShadowTestId:(...e)=>B(document.documentElement,e[0],e[1]),queryByShadowTestId:(...e)=>de(document.documentElement,e[0],e[1]),getAllByShadowTestId:(...e)=>ce(document.documentElement,e[0],e[1]),getByShadowTestId:(...e)=>he(document.documentElement,e[0],e[1]),findAllByShadowTestId:(...e)=>se(document.documentElement,e[0],e[1],e[2]),findByShadowTestId:(...e)=>ue(document.documentElement,e[0],e[1],e[2])};var Et={...Tt,...x};function zt(e){return Mt(e,Et)}export{we as debug,De as deepQuerySelector,fe as deepQuerySelectorAll,ee as findAllByShadowAltText,Y as findAllByShadowDisplayValue,I as findAllByShadowLabelText,_ as findAllByShadowPlaceholderText,q as findAllByShadowRole,se as findAllByShadowTestId,j as findAllByShadowText,le as findAllByShadowTitle,te as findByShadowAltText,J as findByShadowDisplayValue,N as findByShadowLabelText,$ as findByShadowPlaceholderText,Q as findByShadowRole,ue as findByShadowTestId,k as findByShadowText,re as findByShadowTitle,Z as getAllByShadowAltText,X as getAllByShadowDisplayValue,b as getAllByShadowLabelText,C as getAllByShadowPlaceholderText,R as getAllByShadowRole,ce as getAllByShadowTestId,U as getAllByShadowText,ne as getAllByShadowTitle,h as getAllElementsAndShadowRoots,v as getByShadowAltText,z as getByShadowDisplayValue,H as getByShadowLabelText,V as getByShadowPlaceholderText,L as getByShadowRole,he as getByShadowTestId,W as getByShadowText,ae as getByShadowTitle,g as logShadowDOM,lt as prettyShadowDOM,E as queryAllByShadowAltText,M as queryAllByShadowDisplayValue,f as queryAllByShadowLabelText,p as queryAllByShadowPlaceholderText,y as queryAllByShadowRole,B as queryAllByShadowTestId,T as queryAllByShadowText,A as queryAllByShadowTitle,K as queryByShadowAltText,G as queryByShadowDisplayValue,D as queryByShadowLabelText,O as queryByShadowPlaceholderText,P as queryByShadowRole,de as queryByShadowTestId,F as queryByShadowText,oe as queryByShadowTitle,pt as screen,x as shadowQueries,zt as within}; | ||
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(` | ||
`));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}; | ||
//# 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":802,"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/deep-query-selectors.ts","kind":"import-statement"}]}},"outputs":{"dist/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":61714},"dist/index.cjs":{"imports":[],"exports":[],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":1708},"src/shadow-queries.ts":{"bytesInOutput":4100},"src/trick-dom-testing-library.ts":{"bytesInOutput":1043},"src/deep-query-selectors.ts":{"bytesInOutput":848},"src/log-shadow-dom.ts":{"bytesInOutput":203},"src/pretty-shadow-dom.ts":{"bytesInOutput":2533},"src/debug.ts":{"bytesInOutput":80},"src/shadow-screen.ts":{"bytesInOutput":3438}},"bytes":15614}}} | ||
{"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}}} |
@@ -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":802,"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/deep-query-selectors.ts","kind":"import-statement"}]}},"outputs":{"dist/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":60168},"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","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":112},"src/shadow-queries.ts":{"bytesInOutput":4002},"src/trick-dom-testing-library.ts":{"bytesInOutput":1043},"src/deep-query-selectors.ts":{"bytesInOutput":848},"src/log-shadow-dom.ts":{"bytesInOutput":200},"src/pretty-shadow-dom.ts":{"bytesInOutput":2532},"src/debug.ts":{"bytesInOutput":80},"src/shadow-screen.ts":{"bytesInOutput":3439}},"bytes":13860}}} | ||
{"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}}} |
{ | ||
"name": "shadow-dom-testing-library", | ||
"version": "1.10.0", | ||
"version": "1.11.0", | ||
"description": "An extension of DOM-testing-library to provide hooks into the shadow dom", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -1,2 +0,2 @@ | ||
import { queries, within } from "@testing-library/dom"; | ||
import { queries, within, configure, getConfig } from "@testing-library/dom"; | ||
@@ -8,4 +8,22 @@ import * as shadowQueries from "./shadow-queries"; | ||
import { shadowScreen } from "./shadow-screen"; | ||
import { patchWrap } from "./trick-dom-testing-library"; | ||
configure({ | ||
// https://github.com/testing-library/dom-testing-library/blob/39a64d4b862f706d09f0cd225ce9eda892f1e8d8/src/config.ts#L36-L51 | ||
getElementError(message, container) { | ||
const prettifiedDOM = prettyShadowDOM(container); | ||
const error = new Error( | ||
[ | ||
message, | ||
`Ignored nodes: comments, ${ | ||
getConfig().defaultIgnore | ||
}\n${prettifiedDOM}`, | ||
] | ||
.filter(Boolean) | ||
.join("\n\n") | ||
); | ||
error.name = "ShadowDOMTestingLibraryElementError"; | ||
return error; | ||
}, | ||
}); | ||
const allQueries = { | ||
@@ -23,2 +41,4 @@ ...queries, | ||
export { createDOMElementFilter } from "./pretty-shadow-dom"; | ||
export { | ||
@@ -25,0 +45,0 @@ deepQuerySelector, |
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
274064
1958