(expected)
| 4952 | ); |
| 4953 | }; |
| 4954 | const waitForLabels = async (expected) => { |
| 4955 | await page.waitForFunction( |
| 4956 | (wanted) => { |
| 4957 | const boxes = globalThis.__atlasGalaxy?.labelBoxes; |
| 4958 | const count = Array.isArray(boxes) ? boxes.length : Number(boxes ?? 0); |
| 4959 | return wanted === 'positive' ? count > 0 : count === wanted; |
| 4960 | }, |
| 4961 | expected, |
| 4962 | { timeout: 5000 }, |
| 4963 | ); |
| 4964 | }; |
| 4965 | let establishedBefore; |
| 4966 | if (filter.name === 'Effektschalter labels') { |
| 4967 | await waitForLabels('positive'); |