feat(FN-1648): merge fusion/fn-1648
This commit is contained in:
@@ -5,7 +5,22 @@ import { resolve } from "path";
|
||||
const css = readFileSync(resolve(__dirname, "../styles.css"), "utf-8");
|
||||
|
||||
describe("detail-body mobile overflow (FN-1331)", () => {
|
||||
it("adds overflow-x: hidden to .detail-body in the main mobile media query", () => {
|
||||
it("base .detail-body includes overflow-x: hidden to prevent horizontal scrolling", () => {
|
||||
// Find base .detail-body (before mobile section)
|
||||
const mobileSectionStart = css.indexOf("/* === Mobile Responsive Overrides ===");
|
||||
expect(mobileSectionStart).toBeGreaterThan(-1);
|
||||
|
||||
const baseCss = css.slice(0, mobileSectionStart);
|
||||
|
||||
// Extract base .detail-body block using non-greedy pattern
|
||||
const detailBodyMatch = baseCss.match(/\.detail-body\s*\{[^}]*\}/);
|
||||
expect(detailBodyMatch).toBeTruthy();
|
||||
const rule = detailBodyMatch![0];
|
||||
expect(rule).toContain("overflow-x: hidden");
|
||||
expect(rule).toContain("overflow-y: auto");
|
||||
});
|
||||
|
||||
it("mobile .detail-body includes overflow-x: hidden and preserves overflow-y: auto", () => {
|
||||
// Find the main mobile responsive overrides section
|
||||
const sectionStart = css.indexOf("/* === Mobile Responsive Overrides ===");
|
||||
const sectionEnd = css.indexOf("/* === Tablet Responsive Tier", sectionStart);
|
||||
@@ -14,13 +29,15 @@ describe("detail-body mobile overflow (FN-1331)", () => {
|
||||
|
||||
const mobileSection = css.slice(sectionStart, sectionEnd);
|
||||
|
||||
// Extract .detail-body block within the mobile section
|
||||
// Extract .detail-body block within the mobile section using non-greedy pattern
|
||||
const detailBodyMatch = mobileSection.match(/\.detail-body\s*\{[^}]*\}/s);
|
||||
expect(detailBodyMatch).toBeTruthy();
|
||||
expect(detailBodyMatch![0]).toContain("overflow-x: hidden");
|
||||
const rule = detailBodyMatch![0];
|
||||
expect(rule).toContain("overflow-x: hidden");
|
||||
expect(rule).toContain("overflow-y: auto");
|
||||
});
|
||||
|
||||
it("preserves the padding: 14px in the mobile .detail-body rule", () => {
|
||||
it("mobile .detail-body rule preserves padding: 14px", () => {
|
||||
const sectionStart = css.indexOf("/* === Mobile Responsive Overrides ===");
|
||||
const sectionEnd = css.indexOf("/* === Tablet Responsive Tier", sectionStart);
|
||||
const mobileSection = css.slice(sectionStart, sectionEnd);
|
||||
|
||||
@@ -3817,6 +3817,7 @@ body {
|
||||
|
||||
.detail-body {
|
||||
padding: 20px;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
flex: 1;
|
||||
}
|
||||
@@ -6656,6 +6657,7 @@ body {
|
||||
.detail-body {
|
||||
padding: 14px;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.detail-title {
|
||||
|
||||
Reference in New Issue
Block a user