* Helper function to create a mock element with specified styles * @param {string} selector - CSS selector/class name * @param {object} styles - Style properties to apply * @returns {HTMLElement} Created element
(selector, styles = {})
| 114 | * @returns {HTMLElement} Created element |
| 115 | */ |
| 116 | function createMockElement(selector, styles = {}) { |
| 117 | const element = document.createElement('button'); |
| 118 | element.className = selector.replace('.', ''); |
| 119 | |
| 120 | // Apply default touch target styles |
| 121 | element.style.minWidth = `${MIN_TOUCH_TARGET_SIZE}px`; |
| 122 | element.style.minHeight = `${MIN_TOUCH_TARGET_SIZE}px`; |
| 123 | |
| 124 | // Apply custom styles |
| 125 | Object.entries(styles).forEach(([prop, value]) => { |
| 126 | element.style[prop] = value; |
| 127 | }); |
| 128 | |
| 129 | return element; |
| 130 | } |
| 131 | |
| 132 | /** |
| 133 | * Setup DOM environment before each test |
no outgoing calls
no test coverage detected