test(FN-4352): add chat secondary-control mobile regression guards

Fusion-Task-Id: FN-4352
Fusion-Task-Lineage: 429612a4-fe44-4ac0-8d9b-d0d6c1743b36
This commit is contained in:
Fusion
2026-05-13 12:37:40 -07:00
committed by gsxdsm
parent bc9ab53063
commit 0244861fa0

View File

@@ -2654,22 +2654,21 @@ describe("Chat Session Delete Button CSS", () => {
expect(match![1]).toContain("opacity: 1"); expect(match![1]).toContain("opacity: 1");
}); });
it("mobile override makes delete button always visible", () => { it("FN-4352: mobile delete button stays visible without min-size inflation", () => {
// Find all mobile media query blocks and check if any has chat-session-delete-btn with opacity: 1
const mobileRegex = /@media\s*\(max-width:\s*768px\)\s*\{([\s\S]*?)\n\}/g; const mobileRegex = /@media\s*\(max-width:\s*768px\)\s*\{([\s\S]*?)\n\}/g;
let match; let match;
let foundMobileDeleteBtn = false; let deleteRule = "";
while ((match = mobileRegex.exec(css)) !== null) { while ((match = mobileRegex.exec(css)) !== null) {
const mediaContent = match[1]; const mediaContent = match[1];
if (mediaContent.includes(".chat-session-delete-btn")) { if (mediaContent.includes(".chat-session-delete-btn")) {
const deleteBtnMatch = mediaContent.match(/\.chat-session-delete-btn\s*\{([^}]*)\}/); deleteRule = mediaContent.match(/\.chat-session-delete-btn\s*\{([^}]*)\}/)?.[1] ?? "";
if (deleteBtnMatch && deleteBtnMatch[1].includes("opacity: 1")) { if (deleteRule) break;
foundMobileDeleteBtn = true;
break;
}
} }
} }
expect(foundMobileDeleteBtn).toBe(true);
expect(deleteRule).toContain("opacity: 1");
expect(deleteRule).not.toContain("min-width:");
expect(deleteRule).not.toContain("min-height:");
}); });
}); });