@@ -3,8 +3,6 @@ interface StyleDeclaration extends Record<string, string> {
33 value : string ;
44}
55
6- const COMMENT_NODE_TYPE = 8 ;
7-
86function normalizeStyles ( css : Partial < CSSStyleDeclaration > ) : StyleDeclaration {
97 const normalizer = document . createElement ( "div" ) ;
108 document . body . appendChild ( normalizer ) ;
@@ -75,39 +73,3 @@ export function getExpectedAndReceivedStyles
7573 elementProcessedStyle ,
7674 ] ;
7775}
78-
79- export function isElementEmpty ( element : Element ) : boolean {
80- const nonCommentChildNodes = [ ...element . childNodes ] . filter ( child => child . nodeType !== COMMENT_NODE_TYPE ) ;
81- return nonCommentChildNodes . length === 0 ;
82- }
83-
84- function normalizeText ( text : string ) : string {
85- return text . replace ( / \s + / g, " " ) . trim ( ) ;
86- }
87-
88- export function getAccessibleDescription ( actual : Element ) : string {
89- const ariaDescribedBy = actual . getAttribute ( "aria-describedby" ) ;
90-
91- if ( ! ariaDescribedBy ) {
92- return "" ;
93- }
94-
95- const descriptionIds = ariaDescribedBy . split ( / \s + / ) . filter ( Boolean ) ;
96-
97- const getElementText = ( id : string ) : string | null => {
98- const element = actual . ownerDocument . getElementById ( id ) ;
99-
100- if ( ! element || ! element . textContent ) {
101- return null ;
102- }
103-
104- return element . textContent ;
105- } ;
106-
107- const combinedText = descriptionIds
108- . map ( getElementText )
109- . filter ( ( text ) : text is string => text !== null )
110- . join ( " " ) ;
111-
112- return normalizeText ( combinedText ) ;
113- }
0 commit comments