UNPKG

@crossed/ui

Version:

A universal & performant styling library for React Native, Next.js & React

55 lines (54 loc) 2.86 kB
var import_jsx_runtime = require("react/jsx-runtime"); var import_test = require("@crossed/test"); var import_Layout = require("../Layout"); describe("Layout", () => { test("rend les enfants pass\xE9s en prop", () => { const { getByText } = (0, import_test.render)( /* @__PURE__ */ (0, import_jsx_runtime.jsx)( import_Layout.Layout, { footer: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "Footer" }), showFooter: false, stickyFooter: false, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "Contenu de Layout" }) } ) ); expect(getByText("Contenu de Layout")).toBeInTheDocument(); }); test("rend le footer lorsque showFooter est true et stickyFooter est true", () => { const { getByText } = (0, import_test.render)( /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Layout.Layout, { footer: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "Footer" }), showFooter: true, stickyFooter: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "Contenu de Layout" }) }) ); expect(getByText("Footer")).toBeInTheDocument(); }); test("ne rend pas le footer lorsque showFooter est false", () => { const { queryByText } = (0, import_test.render)( /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Layout.Layout, { footer: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "Footer" }), showFooter: false, stickyFooter: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "Contenu de Layout" }) }) ); expect(queryByText("Footer")).toBeNull(); }); test("ne rend pas le footer lorsque stickyFooter est false", () => { const { queryByText } = (0, import_test.render)( /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Layout.Layout, { footer: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "Footer" }), showFooter: true, stickyFooter: false, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "Contenu de Layout" }) }) ); expect(queryByText("Footer")).toBeNull(); }); test("applique le style dynamique de paddingRight", () => { const { getByTestId } = (0, import_test.render)( /* @__PURE__ */ (0, import_jsx_runtime.jsx)( import_Layout.Layout, { footer: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "Footer" }), showFooter: true, stickyFooter: true, paddingRight: 20, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "Contenu de Layout" }) } ) ); const footerElement = getByTestId("stickyFooter"); expect(footerElement).toHaveStyle("padding-right: 20px"); }); }); //# sourceMappingURL=Layout.spec.js.map