@@ -10,7 +10,6 @@ import {
1010 createTrailingBreak ,
1111 findAllParagraphs ,
1212 findElement ,
13- findElements ,
1413 getLogicalDirection ,
1514 getTokenType ,
1615 hasOnlyTrailingBR ,
@@ -97,42 +96,6 @@ describe('createTrailingBreak', () => {
9796 } ) ;
9897} ) ;
9998
100- describe ( 'findElements' , ( ) => {
101- test ( 'finds elements by tokenType' , ( ) => {
102- const container = document . createElement ( 'div' ) ;
103- const ref1 = document . createElement ( 'span' ) ;
104- ref1 . setAttribute ( 'data-type' , 'reference' ) ;
105- const ref2 = document . createElement ( 'span' ) ;
106- ref2 . setAttribute ( 'data-type' , 'reference' ) ;
107- const other = document . createElement ( 'span' ) ;
108- other . setAttribute ( 'data-type' , 'text' ) ;
109- container . appendChild ( ref1 ) ;
110- container . appendChild ( ref2 ) ;
111- container . appendChild ( other ) ;
112-
113- const results = findElements ( container , { tokenType : 'reference' } ) ;
114- expect ( results ) . toHaveLength ( 2 ) ;
115- } ) ;
116-
117- test ( 'finds elements by array of tokenTypes' , ( ) => {
118- const container = document . createElement ( 'div' ) ;
119- const refEl = document . createElement ( 'span' ) ;
120- refEl . setAttribute ( 'data-type' , 'reference' ) ;
121- const pinned = document . createElement ( 'span' ) ;
122- pinned . setAttribute ( 'data-type' , 'pinned' ) ;
123- container . appendChild ( refEl ) ;
124- container . appendChild ( pinned ) ;
125-
126- const results = findElements ( container , { tokenType : [ 'reference' , 'pinned' ] } ) ;
127- expect ( results ) . toHaveLength ( 2 ) ;
128- } ) ;
129-
130- test ( 'returns empty array when no options provided' , ( ) => {
131- const container = document . createElement ( 'div' ) ;
132- expect ( findElements ( container , { } ) ) . toEqual ( [ ] ) ;
133- } ) ;
134- } ) ;
135-
13699describe ( 'findElement' , ( ) => {
137100 test ( 'finds first matching element' , ( ) => {
138101 const container = document . createElement ( 'div' ) ;
@@ -318,32 +281,6 @@ describe('setEmptyState', () => {
318281 } ) ;
319282} ) ;
320283
321- describe ( 'findElements with tokenId' , ( ) => {
322- test ( 'finds element by data-id for non-trigger types' , ( ) => {
323- const container = document . createElement ( 'div' ) ;
324- const el = document . createElement ( 'span' ) ;
325- el . setAttribute ( 'data-type' , 'reference' ) ;
326- el . setAttribute ( 'data-id' , 'ref-123' ) ;
327- container . appendChild ( el ) ;
328-
329- const results = findElements ( container , { tokenType : 'reference' , tokenId : 'ref-123' } ) ;
330- expect ( results ) . toHaveLength ( 1 ) ;
331- expect ( results [ 0 ] ) . toBe ( el ) ;
332- } ) ;
333-
334- test ( 'finds trigger element by data-id attribute' , ( ) => {
335- const container = document . createElement ( 'div' ) ;
336- const el = document . createElement ( 'span' ) ;
337- el . setAttribute ( 'data-type' , ElementType . Trigger ) ;
338- el . setAttribute ( 'data-id' , 'trigger-123' ) ;
339- container . appendChild ( el ) ;
340-
341- const results = findElements ( container , { tokenType : ElementType . Trigger , tokenId : 'trigger-123' } ) ;
342- expect ( results ) . toHaveLength ( 1 ) ;
343- expect ( results [ 0 ] ) . toBe ( el ) ;
344- } ) ;
345- } ) ;
346-
347284describe ( 'getLogicalDirection' , ( ) => {
348285 let el : HTMLDivElement ;
349286
0 commit comments