test(FN-4812): assert mobile FileMentionPopup anchoring rule
Fusion-Task-Id: FN-4812 Fusion-Task-Lineage: 9877a784-5320-410c-82fa-3f6a6d9b5358
This commit is contained in:
committed by
gsxdsm
parent
02713ee45e
commit
ec8d1f5246
@@ -2,6 +2,7 @@ import { describe, it, expect, vi, beforeEach } from "vitest";
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import { FileMentionPopup } from "../FileMentionPopup";
|
||||
import type { FileSearchItem } from "../../hooks/useFileMention";
|
||||
import { loadAllAppCss } from "../../test/cssFixture";
|
||||
|
||||
// Mock lucide-react
|
||||
vi.mock("lucide-react", () => ({
|
||||
@@ -142,4 +143,13 @@ describe("FileMentionPopup", () => {
|
||||
const items = screen.getAllByRole("option");
|
||||
expect(items).toHaveLength(3);
|
||||
});
|
||||
});
|
||||
});
|
||||
describe("FN-4812 mobile anchoring", () => {
|
||||
it("anchors file mention popup above the input inside mobile media query", async () => {
|
||||
const css = await loadAllAppCss();
|
||||
|
||||
expect(css).toMatch(
|
||||
/@media\s*\(max-width:\s*768px\)\s*\{[^{}]*\.file-mention-popup\s*\{[^}]*top:\s*auto\s*!important;[^}]*bottom:\s*calc\(100%\s*\+\s*var\(--space-xs\)\);[^}]*left:\s*var\(--space-md\)\s*!important;[^}]*right:\s*var\(--space-md\);/m,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user