diff --git a/tests/help-center.spec.mjs b/tests/help-center.spec.mjs index 24c1703..ee15eef 100644 --- a/tests/help-center.spec.mjs +++ b/tests/help-center.spec.mjs @@ -85,10 +85,13 @@ test('Help uses a question-circle mask with the native sidebar icon geometry and return {normal,active,viewBox:svg?.documentElement.getAttribute('viewBox'),fill:svg?.documentElement.getAttribute('fill'),stroke:svg?.documentElement.getAttribute('stroke-width'),circle:svg?.querySelector('circle')?.getAttribute('r'),question:svg?.querySelector('path')?.getAttribute('d')}; }); expect(result.viewBox).toBe('0 0 24 24');expect(result.fill).toBe('none');expect(result.stroke).toBe('1.9');expect(result.circle).toBe('9');expect(result.question).toContain('M12 17h.01'); - // Compare against the final app styles rather than an intermediate 20px rule. expect(result.normal.help).toEqual(result.normal.peer);expect(result.active.help).toEqual(result.active.peer); - expect(parseFloat(result.normal.help.width)).toBeGreaterThanOrEqual(16); - expect(result.normal.help.width).toBe(result.normal.help.height); + // The shared legacy flex basis reserves 24px, while the mask itself is square. + // Validate the actual drawn mask, not an assumed square layout slot. + const [maskWidth,maskHeight=maskWidth]=result.normal.help.maskSize.split(/\s+/).map(parseFloat); + expect(maskWidth).toBeGreaterThanOrEqual(16);expect(maskWidth).toBe(maskHeight); + expect(maskWidth).toBeLessThanOrEqual(parseFloat(result.normal.help.width)); + expect(maskHeight).toBeLessThanOrEqual(parseFloat(result.normal.help.height)); await expect(help.locator('svg,img')).toHaveCount(0); await expect(help).toHaveText('Помощь'); });