(element, className = '')
| 310 | } |
| 311 | |
| 312 | function getStep9ErrorVisualSignals(element, className = '') { |
| 313 | const signals = []; |
| 314 | const normalizedClassName = String(className || '').replace(/\s+/g, ' ').trim(); |
| 315 | if (/(?:error|danger|fail|destructive|text-red|text-danger|alert)/i.test(normalizedClassName)) { |
| 316 | signals.push(`class=${getInlineTextSnippet(normalizedClassName, 80)}`); |
| 317 | } |
| 318 | |
| 319 | if (!element) { |
| 320 | return signals; |
| 321 | } |
| 322 | |
| 323 | const style = window.getComputedStyle(element); |
| 324 | if (isReddishColor(style.color)) { |
| 325 | signals.push(`color=${style.color}`); |
| 326 | } |
| 327 | if (isReddishColor(style.borderColor)) { |
| 328 | signals.push(`border=${style.borderColor}`); |
| 329 | } |
| 330 | if (isReddishColor(style.backgroundColor)) { |
| 331 | signals.push(`background=${style.backgroundColor}`); |
| 332 | } |
| 333 | |
| 334 | return signals; |
| 335 | } |
| 336 | |
| 337 | function createStep9Entry(candidate, selector) { |
| 338 | const className = String(candidate?.className || '').replace(/\s+/g, ' ').trim(); |
no test coverage detected