test(dashboard): align mobile .agent-error-modal CSS assertions with calc()
The mobile rule for .agent-error-modal now uses height: calc(100% - var(--mobile-nav-height) - env(safe-area-inset-bottom) - var(--standalone-bottom-gap)) (same for max-height) to avoid clipping under the bottom toolbar. Both the agent-modals-mobile and core-modals-mobile tests still asserted on the simpler `height: 100%` / `max-height: 100%` form and failed. Loosen the matchers to allow the calc() expression. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -400,8 +400,10 @@ describe("agent modal mobile CSS structure", () => {
|
||||
expect(modalRuleMatch).toBeTruthy();
|
||||
const modalRule = modalRuleMatch![0];
|
||||
|
||||
expect(modalRule).toContain("height: 100%");
|
||||
expect(modalRule).toContain("max-height: 100%");
|
||||
// height/max-height now subtract mobile-nav-height + safe-area-inset
|
||||
// to avoid clipping under the bottom toolbar.
|
||||
expect(modalRule).toMatch(/height:\s*calc\(100%/);
|
||||
expect(modalRule).toMatch(/max-height:\s*calc\(100%/);
|
||||
expect(modalRule).toContain("min-height: 0");
|
||||
expect(modalRule).toContain("width: 100%");
|
||||
expect(modalRule).toContain("max-width: 100%");
|
||||
|
||||
@@ -332,8 +332,11 @@ describe("core modals mobile css coverage", () => {
|
||||
|
||||
const modalRuleMatch = mobileBlock.match(/\.agent-error-modal\s*\{[^}]+\}/s);
|
||||
expect(modalRuleMatch).not.toBeNull();
|
||||
expect(modalRuleMatch![0]).toContain("height: 100%");
|
||||
expect(modalRuleMatch![0]).toContain("max-height: 100%");
|
||||
// The mobile rule now subtracts mobile-nav-height and safe-area-inset-bottom
|
||||
// from the parent container; assert both height and max-height are
|
||||
// calc(100% - ...) rather than the simpler `100%`.
|
||||
expect(modalRuleMatch![0]).toMatch(/height:\s*calc\(100%/);
|
||||
expect(modalRuleMatch![0]).toMatch(/max-height:\s*calc\(100%/);
|
||||
expect(modalRuleMatch![0]).toContain("min-height: 0");
|
||||
|
||||
const contentRuleMatch = css.match(/\.agent-error-modal__content\s*\{[^}]+\}/s);
|
||||
|
||||
Reference in New Issue
Block a user