Files
fusion/packages/dashboard/app/components/__tests__/mobile-dropdown-positioning.test.tsx
gsxdsm 586d9b33b1 feat(FN-1137): improve mobile dropdown and file browser interactions
- Add viewport-aware positioning/clamping for Quick Scripts and Quick Entry dropdown menus
- Implement long-press context menu behavior in FileBrowser with iOS momentum scrolling support
- Expand dashboard CSS and component logic to stabilize mobile overlay behavior and remove unused inline WebKit style
- Add focused tests for FileBrowser, QuickScriptsDropdown, and mobile dropdown positioning plus README notes
2026-04-08 05:59:12 -07:00

38 lines
1.5 KiB
TypeScript

import fs from "node:fs";
import path from "node:path";
import { describe, expect, it } from "vitest";
const stylesPath = path.resolve(__dirname, "../../styles.css");
describe("mobile dropdown positioning and momentum scrolling css", () => {
it("includes iOS momentum scrolling for dep-dropdown", () => {
const css = fs.readFileSync(stylesPath, "utf-8");
expect(css).toMatch(/\.dep-dropdown[\s\S]*-webkit-overflow-scrolling:\s*touch;/);
});
it("includes iOS momentum scrolling for file-browser-list", () => {
const css = fs.readFileSync(stylesPath, "utf-8");
expect(css).toMatch(/\.file-browser-list[\s\S]*-webkit-overflow-scrolling:\s*touch;/);
});
it("includes modal momentum scrolling selectors inside the 768px mobile media query", () => {
const css = fs.readFileSync(stylesPath, "utf-8");
const momentumBlockMatch = css.match(/@media \(max-width: 768px\)\s*\{[\s\S]*\/\* iOS momentum scrolling for all modal content areas \*\/[\s\S]*?\}/);
expect(momentumBlockMatch).toBeTruthy();
const block = momentumBlockMatch?.[0] ?? "";
expect(block).toContain(".modal-content");
expect(block).toContain(".modal-body");
expect(block).toContain(".modal-scroll");
expect(block).toContain(".task-detail-content");
expect(block).toContain(".agent-log-content");
expect(block).toContain(".file-browser-list");
expect(block).toContain(".settings-content");
expect(block).toContain(".activity-log-content");
expect(block).toContain("-webkit-overflow-scrolling: touch;");
});
});