(wrapper: any, index: number = 0)
| 33 | } |
| 34 | |
| 35 | export function findSelection(wrapper: any, index: number = 0) { |
| 36 | if (wrapper instanceof HTMLElement) { |
| 37 | const itemNode = wrapper.querySelectorAll('.rc-select-selection-item')[index]; |
| 38 | const contentNode = itemNode.querySelector('.rc-select-selection-item-content'); |
| 39 | |
| 40 | if (contentNode) { |
| 41 | return contentNode; |
| 42 | } |
| 43 | |
| 44 | return itemNode; |
| 45 | } else { |
| 46 | const itemNode = wrapper.find('.rc-select-selection-item').at(index); |
| 47 | const contentNode = itemNode.find('.rc-select-selection-item-content'); |
| 48 | |
| 49 | if (contentNode.length) { |
| 50 | return contentNode; |
| 51 | } |
| 52 | |
| 53 | return itemNode; |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | export function removeSelection(wrapper: any, index: number = 0) { |
| 58 | const preventDefault = jest.fn(); |
no outgoing calls
no test coverage detected
searching dependent graphs…