@elliemae/ds-hooks-on-overflow-change 3.53.1-rc.0 → 3.54.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -9
- package/dist/cjs/tests/overflow/DSHooksIsOverflowing.overflow.test.playwright.js +0 -66
- package/dist/cjs/tests/overflow/DSHooksIsOverflowing.overflow.test.playwright.js.map +0 -7
- package/dist/cjs/tests/overflow/DSHooksIsOverflowingTestRenderer.js +0 -66
- package/dist/cjs/tests/overflow/DSHooksIsOverflowingTestRenderer.js.map +0 -7
- package/dist/esm/tests/overflow/DSHooksIsOverflowing.overflow.test.playwright.js +0 -43
- package/dist/esm/tests/overflow/DSHooksIsOverflowing.overflow.test.playwright.js.map +0 -7
- package/dist/esm/tests/overflow/DSHooksIsOverflowingTestRenderer.js +0 -36
- package/dist/esm/tests/overflow/DSHooksIsOverflowingTestRenderer.js.map +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-hooks-on-overflow-change",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.54.0-next.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Hooks Is Overflowing",
|
|
6
6
|
"files": [
|
|
@@ -37,18 +37,19 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@xstyled/styled-components": "~3.7.3",
|
|
40
|
-
"@elliemae/ds-grid": "3.
|
|
41
|
-
"@elliemae/ds-hooks-on-blur-out": "3.
|
|
42
|
-
"@elliemae/ds-props-helpers": "3.
|
|
43
|
-
"@elliemae/ds-system": "3.
|
|
40
|
+
"@elliemae/ds-grid": "3.54.0-next.2",
|
|
41
|
+
"@elliemae/ds-hooks-on-blur-out": "3.54.0-next.2",
|
|
42
|
+
"@elliemae/ds-props-helpers": "3.54.0-next.2",
|
|
43
|
+
"@elliemae/ds-system": "3.54.0-next.2"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@elliemae/pui-cli": "9.0.0-next.
|
|
46
|
+
"@elliemae/pui-cli": "9.0.0-next.65",
|
|
47
47
|
"@playwright/experimental-ct-react": "^1.51.1",
|
|
48
48
|
"jest": "~29.7.0",
|
|
49
49
|
"styled-components": "~5.3.9",
|
|
50
|
-
"@elliemae/ds-monorepo-devops": "3.
|
|
51
|
-
"@elliemae/ds-typescript-helpers": "3.
|
|
50
|
+
"@elliemae/ds-monorepo-devops": "3.54.0-next.2",
|
|
51
|
+
"@elliemae/ds-typescript-helpers": "3.54.0-next.2",
|
|
52
|
+
"@elliemae/ds-test-utils": "3.54.0-next.2"
|
|
52
53
|
},
|
|
53
54
|
"peerDependencies": {
|
|
54
55
|
"@testing-library/jest-dom": "^6.6.3",
|
|
@@ -64,7 +65,7 @@
|
|
|
64
65
|
},
|
|
65
66
|
"scripts": {
|
|
66
67
|
"dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
|
|
67
|
-
"test": "
|
|
68
|
+
"test": "[ -n \"$CI\" ] || playwright test -c ./playwright.config.mjs && pui-cli test --passWithNoTests --coverage=\"false\"",
|
|
68
69
|
"lint": "node ../../../scripts/lint.mjs --fix",
|
|
69
70
|
"lint:strict": "node ../../../scripts/lint-strict.mjs",
|
|
70
71
|
"dts": "node ../../../scripts/dts.mjs",
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
-
mod
|
|
23
|
-
));
|
|
24
|
-
var React = __toESM(require("react"));
|
|
25
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
-
var import_experimental_ct_react = require("@playwright/experimental-ct-react");
|
|
27
|
-
var import_DSHooksIsOverflowingTestRenderer = require("./DSHooksIsOverflowingTestRenderer");
|
|
28
|
-
const containerSelector = '[data-testid="container"]';
|
|
29
|
-
const overflowStateSelector = '[data-testid="overflow-state"]';
|
|
30
|
-
import_experimental_ct_react.test.describe("DSHooksIsOverflowingTestRenderer - Overflow Behavior", () => {
|
|
31
|
-
(0, import_experimental_ct_react.test)("Should detect overflow when content exceeds container width", async ({ mount, page }) => {
|
|
32
|
-
import_experimental_ct_react.test.setTimeout(2e4);
|
|
33
|
-
await mount(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DSHooksIsOverflowingTestRenderer.DSHooksIsOverflowingTestRenderer, {}));
|
|
34
|
-
const container = page.locator(containerSelector);
|
|
35
|
-
await container.waitFor({ state: "attached" });
|
|
36
|
-
await container.evaluate((node) => {
|
|
37
|
-
node.style.width = "100px";
|
|
38
|
-
});
|
|
39
|
-
await (0, import_experimental_ct_react.expect)(page.locator(overflowStateSelector)).toContainText("Overflowing: true");
|
|
40
|
-
});
|
|
41
|
-
(0, import_experimental_ct_react.test)("Should detect no overflow when content fits within container", async ({ mount, page }) => {
|
|
42
|
-
import_experimental_ct_react.test.setTimeout(2e4);
|
|
43
|
-
await mount(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DSHooksIsOverflowingTestRenderer.DSHooksIsOverflowingTestRenderer, {}));
|
|
44
|
-
const container = page.locator(containerSelector);
|
|
45
|
-
await container.waitFor({ state: "attached" });
|
|
46
|
-
await container.evaluate((node) => {
|
|
47
|
-
node.style.width = "500px";
|
|
48
|
-
});
|
|
49
|
-
await (0, import_experimental_ct_react.expect)(page.locator(overflowStateSelector)).toContainText("Overflowing: false");
|
|
50
|
-
});
|
|
51
|
-
(0, import_experimental_ct_react.test)("Should update overflow state dynamically when container size changes", async ({ mount, page }) => {
|
|
52
|
-
import_experimental_ct_react.test.setTimeout(2e4);
|
|
53
|
-
await mount(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DSHooksIsOverflowingTestRenderer.DSHooksIsOverflowingTestRenderer, {}));
|
|
54
|
-
const container = page.locator(containerSelector);
|
|
55
|
-
await container.waitFor({ state: "attached" });
|
|
56
|
-
await container.evaluate((node) => {
|
|
57
|
-
node.style.width = "500px";
|
|
58
|
-
});
|
|
59
|
-
await (0, import_experimental_ct_react.expect)(page.locator(overflowStateSelector)).toContainText("Overflowing: false");
|
|
60
|
-
await container.evaluate((node) => {
|
|
61
|
-
node.style.width = "100px";
|
|
62
|
-
});
|
|
63
|
-
await (0, import_experimental_ct_react.expect)(page.locator(overflowStateSelector)).toContainText("Overflowing: true");
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
//# sourceMappingURL=DSHooksIsOverflowing.overflow.test.playwright.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/tests/overflow/DSHooksIsOverflowing.overflow.test.playwright.jsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { expect, test } from '@playwright/experimental-ct-react';\nimport { DSHooksIsOverflowingTestRenderer } from './DSHooksIsOverflowingTestRenderer';\n\nconst containerSelector = '[data-testid=\"container\"]';\nconst overflowStateSelector = '[data-testid=\"overflow-state\"]';\n\ntest.describe('DSHooksIsOverflowingTestRenderer - Overflow Behavior', () => {\n test('Should detect overflow when content exceeds container width', async ({ mount, page }) => {\n test.setTimeout(20000);\n await mount(<DSHooksIsOverflowingTestRenderer />);\n const container = page.locator(containerSelector);\n await container.waitFor({ state: 'attached' });\n\n await container.evaluate((node) => {\n node.style.width = '100px';\n });\n\n await expect(page.locator(overflowStateSelector)).toContainText('Overflowing: true');\n });\n\n test('Should detect no overflow when content fits within container', async ({ mount, page }) => {\n test.setTimeout(20000);\n await mount(<DSHooksIsOverflowingTestRenderer />);\n const container = page.locator(containerSelector);\n await container.waitFor({ state: 'attached' });\n\n await container.evaluate((node) => {\n node.style.width = '500px';\n });\n\n await expect(page.locator(overflowStateSelector)).toContainText('Overflowing: false');\n });\n\n test('Should update overflow state dynamically when container size changes', async ({ mount, page }) => {\n test.setTimeout(20000);\n await mount(<DSHooksIsOverflowingTestRenderer />);\n const container = page.locator(containerSelector);\n await container.waitFor({ state: 'attached' });\n\n await container.evaluate((node) => {\n node.style.width = '500px';\n });\n await expect(page.locator(overflowStateSelector)).toContainText('Overflowing: false');\n\n await container.evaluate((node) => {\n node.style.width = '100px';\n });\n await expect(page.locator(overflowStateSelector)).toContainText('Overflowing: true');\n });\n});\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACSP;AAThB,mCAA6B;AAC7B,8CAAiD;AAEjD,MAAM,oBAAoB;AAC1B,MAAM,wBAAwB;AAE9B,kCAAK,SAAS,wDAAwD,MAAM;AAC1E,yCAAK,+DAA+D,OAAO,EAAE,OAAO,KAAK,MAAM;AAC7F,sCAAK,WAAW,GAAK;AACrB,UAAM,MAAM,4CAAC,4EAAiC,CAAE;AAChD,UAAM,YAAY,KAAK,QAAQ,iBAAiB;AAChD,UAAM,UAAU,QAAQ,EAAE,OAAO,WAAW,CAAC;AAE7C,UAAM,UAAU,SAAS,CAAC,SAAS;AACjC,WAAK,MAAM,QAAQ;AAAA,IACrB,CAAC;AAED,cAAM,qCAAO,KAAK,QAAQ,qBAAqB,CAAC,EAAE,cAAc,mBAAmB;AAAA,EACrF,CAAC;AAED,yCAAK,gEAAgE,OAAO,EAAE,OAAO,KAAK,MAAM;AAC9F,sCAAK,WAAW,GAAK;AACrB,UAAM,MAAM,4CAAC,4EAAiC,CAAE;AAChD,UAAM,YAAY,KAAK,QAAQ,iBAAiB;AAChD,UAAM,UAAU,QAAQ,EAAE,OAAO,WAAW,CAAC;AAE7C,UAAM,UAAU,SAAS,CAAC,SAAS;AACjC,WAAK,MAAM,QAAQ;AAAA,IACrB,CAAC;AAED,cAAM,qCAAO,KAAK,QAAQ,qBAAqB,CAAC,EAAE,cAAc,oBAAoB;AAAA,EACtF,CAAC;AAED,yCAAK,wEAAwE,OAAO,EAAE,OAAO,KAAK,MAAM;AACtG,sCAAK,WAAW,GAAK;AACrB,UAAM,MAAM,4CAAC,4EAAiC,CAAE;AAChD,UAAM,YAAY,KAAK,QAAQ,iBAAiB;AAChD,UAAM,UAAU,QAAQ,EAAE,OAAO,WAAW,CAAC;AAE7C,UAAM,UAAU,SAAS,CAAC,SAAS;AACjC,WAAK,MAAM,QAAQ;AAAA,IACrB,CAAC;AACD,cAAM,qCAAO,KAAK,QAAQ,qBAAqB,CAAC,EAAE,cAAc,oBAAoB;AAEpF,UAAM,UAAU,SAAS,CAAC,SAAS;AACjC,WAAK,MAAM,QAAQ;AAAA,IACrB,CAAC;AACD,cAAM,qCAAO,KAAK,QAAQ,qBAAqB,CAAC,EAAE,cAAc,mBAAmB;AAAA,EACrF,CAAC;AACH,CAAC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var DSHooksIsOverflowingTestRenderer_exports = {};
|
|
30
|
-
__export(DSHooksIsOverflowingTestRenderer_exports, {
|
|
31
|
-
DSHooksIsOverflowingTestRenderer: () => DSHooksIsOverflowingTestRenderer
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(DSHooksIsOverflowingTestRenderer_exports);
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
var import_react = __toESM(require("react"));
|
|
37
|
-
var import_ds_hooks_on_overflow_change = require("@elliemae/ds-hooks-on-overflow-change");
|
|
38
|
-
var import_ds_system = require("@elliemae/ds-system");
|
|
39
|
-
const DSHooksIsOverflowingTestRenderer = (0, import_ds_system.themeProviderHOC)(() => {
|
|
40
|
-
const [isOverflowing, setIsOverflowing] = (0, import_react.useState)(false);
|
|
41
|
-
const { handleRef } = (0, import_ds_hooks_on_overflow_change.useOnOverflowChange)({
|
|
42
|
-
onOverflowStateChange: setIsOverflowing
|
|
43
|
-
});
|
|
44
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
45
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { "data-testid": "overflow-state", children: [
|
|
46
|
-
"Overflowing: ",
|
|
47
|
-
isOverflowing ? "true" : "false"
|
|
48
|
-
] }),
|
|
49
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
50
|
-
"div",
|
|
51
|
-
{
|
|
52
|
-
"data-testid": "container",
|
|
53
|
-
ref: handleRef,
|
|
54
|
-
style: {
|
|
55
|
-
whiteSpace: "nowrap",
|
|
56
|
-
overflow: "hidden",
|
|
57
|
-
textOverflow: "ellipsis",
|
|
58
|
-
background: "rgba(30, 121, 194, 0.2)",
|
|
59
|
-
padding: "10px"
|
|
60
|
-
},
|
|
61
|
-
children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod."
|
|
62
|
-
}
|
|
63
|
-
)
|
|
64
|
-
] });
|
|
65
|
-
});
|
|
66
|
-
//# sourceMappingURL=DSHooksIsOverflowingTestRenderer.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/tests/overflow/DSHooksIsOverflowingTestRenderer.jsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useState } from 'react';\nimport { useOnOverflowChange } from '@elliemae/ds-hooks-on-overflow-change';\nimport { themeProviderHOC } from '@elliemae/ds-system';\n\nexport const DSHooksIsOverflowingTestRenderer = themeProviderHOC(() => {\n const [isOverflowing, setIsOverflowing] = useState(false);\n\n const { handleRef } = useOnOverflowChange({\n onOverflowStateChange: setIsOverflowing,\n });\n\n return (\n <div>\n <div data-testid=\"overflow-state\">Overflowing: {isOverflowing ? 'true' : 'false'}</div>\n <div\n data-testid=\"container\"\n ref={handleRef}\n style={{\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n background: 'rgba(30, 121, 194, 0.2)',\n padding: '10px',\n }}\n >\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod.\n </div>\n </div>\n );\n});\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADajB;AAbN,mBAAgC;AAChC,yCAAoC;AACpC,uBAAiC;AAE1B,MAAM,uCAAmC,mCAAiB,MAAM;AACrE,QAAM,CAAC,eAAe,gBAAgB,QAAI,uBAAS,KAAK;AAExD,QAAM,EAAE,UAAU,QAAI,wDAAoB;AAAA,IACxC,uBAAuB;AAAA,EACzB,CAAC;AAED,SACE,6CAAC,SACC;AAAA,iDAAC,SAAI,eAAY,kBAAiB;AAAA;AAAA,MAAc,gBAAgB,SAAS;AAAA,OAAQ;AAAA,IACjF;AAAA,MAAC;AAAA;AAAA,QACC,eAAY;AAAA,QACZ,KAAK;AAAA,QACL,OAAO;AAAA,UACL,YAAY;AAAA,UACZ,UAAU;AAAA,UACV,cAAc;AAAA,UACd,YAAY;AAAA,UACZ,SAAS;AAAA,QACX;AAAA,QACD;AAAA;AAAA,IAED;AAAA,KACF;AAEJ,CAAC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { expect, test } from "@playwright/experimental-ct-react";
|
|
4
|
-
import { DSHooksIsOverflowingTestRenderer } from "./DSHooksIsOverflowingTestRenderer";
|
|
5
|
-
const containerSelector = '[data-testid="container"]';
|
|
6
|
-
const overflowStateSelector = '[data-testid="overflow-state"]';
|
|
7
|
-
test.describe("DSHooksIsOverflowingTestRenderer - Overflow Behavior", () => {
|
|
8
|
-
test("Should detect overflow when content exceeds container width", async ({ mount, page }) => {
|
|
9
|
-
test.setTimeout(2e4);
|
|
10
|
-
await mount(/* @__PURE__ */ jsx(DSHooksIsOverflowingTestRenderer, {}));
|
|
11
|
-
const container = page.locator(containerSelector);
|
|
12
|
-
await container.waitFor({ state: "attached" });
|
|
13
|
-
await container.evaluate((node) => {
|
|
14
|
-
node.style.width = "100px";
|
|
15
|
-
});
|
|
16
|
-
await expect(page.locator(overflowStateSelector)).toContainText("Overflowing: true");
|
|
17
|
-
});
|
|
18
|
-
test("Should detect no overflow when content fits within container", async ({ mount, page }) => {
|
|
19
|
-
test.setTimeout(2e4);
|
|
20
|
-
await mount(/* @__PURE__ */ jsx(DSHooksIsOverflowingTestRenderer, {}));
|
|
21
|
-
const container = page.locator(containerSelector);
|
|
22
|
-
await container.waitFor({ state: "attached" });
|
|
23
|
-
await container.evaluate((node) => {
|
|
24
|
-
node.style.width = "500px";
|
|
25
|
-
});
|
|
26
|
-
await expect(page.locator(overflowStateSelector)).toContainText("Overflowing: false");
|
|
27
|
-
});
|
|
28
|
-
test("Should update overflow state dynamically when container size changes", async ({ mount, page }) => {
|
|
29
|
-
test.setTimeout(2e4);
|
|
30
|
-
await mount(/* @__PURE__ */ jsx(DSHooksIsOverflowingTestRenderer, {}));
|
|
31
|
-
const container = page.locator(containerSelector);
|
|
32
|
-
await container.waitFor({ state: "attached" });
|
|
33
|
-
await container.evaluate((node) => {
|
|
34
|
-
node.style.width = "500px";
|
|
35
|
-
});
|
|
36
|
-
await expect(page.locator(overflowStateSelector)).toContainText("Overflowing: false");
|
|
37
|
-
await container.evaluate((node) => {
|
|
38
|
-
node.style.width = "100px";
|
|
39
|
-
});
|
|
40
|
-
await expect(page.locator(overflowStateSelector)).toContainText("Overflowing: true");
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
//# sourceMappingURL=DSHooksIsOverflowing.overflow.test.playwright.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/tests/overflow/DSHooksIsOverflowing.overflow.test.playwright.jsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { expect, test } from '@playwright/experimental-ct-react';\nimport { DSHooksIsOverflowingTestRenderer } from './DSHooksIsOverflowingTestRenderer';\n\nconst containerSelector = '[data-testid=\"container\"]';\nconst overflowStateSelector = '[data-testid=\"overflow-state\"]';\n\ntest.describe('DSHooksIsOverflowingTestRenderer - Overflow Behavior', () => {\n test('Should detect overflow when content exceeds container width', async ({ mount, page }) => {\n test.setTimeout(20000);\n await mount(<DSHooksIsOverflowingTestRenderer />);\n const container = page.locator(containerSelector);\n await container.waitFor({ state: 'attached' });\n\n await container.evaluate((node) => {\n node.style.width = '100px';\n });\n\n await expect(page.locator(overflowStateSelector)).toContainText('Overflowing: true');\n });\n\n test('Should detect no overflow when content fits within container', async ({ mount, page }) => {\n test.setTimeout(20000);\n await mount(<DSHooksIsOverflowingTestRenderer />);\n const container = page.locator(containerSelector);\n await container.waitFor({ state: 'attached' });\n\n await container.evaluate((node) => {\n node.style.width = '500px';\n });\n\n await expect(page.locator(overflowStateSelector)).toContainText('Overflowing: false');\n });\n\n test('Should update overflow state dynamically when container size changes', async ({ mount, page }) => {\n test.setTimeout(20000);\n await mount(<DSHooksIsOverflowingTestRenderer />);\n const container = page.locator(containerSelector);\n await container.waitFor({ state: 'attached' });\n\n await container.evaluate((node) => {\n node.style.width = '500px';\n });\n await expect(page.locator(overflowStateSelector)).toContainText('Overflowing: false');\n\n await container.evaluate((node) => {\n node.style.width = '100px';\n });\n await expect(page.locator(overflowStateSelector)).toContainText('Overflowing: true');\n });\n});\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACSP;AAThB,SAAS,QAAQ,YAAY;AAC7B,SAAS,wCAAwC;AAEjD,MAAM,oBAAoB;AAC1B,MAAM,wBAAwB;AAE9B,KAAK,SAAS,wDAAwD,MAAM;AAC1E,OAAK,+DAA+D,OAAO,EAAE,OAAO,KAAK,MAAM;AAC7F,SAAK,WAAW,GAAK;AACrB,UAAM,MAAM,oBAAC,oCAAiC,CAAE;AAChD,UAAM,YAAY,KAAK,QAAQ,iBAAiB;AAChD,UAAM,UAAU,QAAQ,EAAE,OAAO,WAAW,CAAC;AAE7C,UAAM,UAAU,SAAS,CAAC,SAAS;AACjC,WAAK,MAAM,QAAQ;AAAA,IACrB,CAAC;AAED,UAAM,OAAO,KAAK,QAAQ,qBAAqB,CAAC,EAAE,cAAc,mBAAmB;AAAA,EACrF,CAAC;AAED,OAAK,gEAAgE,OAAO,EAAE,OAAO,KAAK,MAAM;AAC9F,SAAK,WAAW,GAAK;AACrB,UAAM,MAAM,oBAAC,oCAAiC,CAAE;AAChD,UAAM,YAAY,KAAK,QAAQ,iBAAiB;AAChD,UAAM,UAAU,QAAQ,EAAE,OAAO,WAAW,CAAC;AAE7C,UAAM,UAAU,SAAS,CAAC,SAAS;AACjC,WAAK,MAAM,QAAQ;AAAA,IACrB,CAAC;AAED,UAAM,OAAO,KAAK,QAAQ,qBAAqB,CAAC,EAAE,cAAc,oBAAoB;AAAA,EACtF,CAAC;AAED,OAAK,wEAAwE,OAAO,EAAE,OAAO,KAAK,MAAM;AACtG,SAAK,WAAW,GAAK;AACrB,UAAM,MAAM,oBAAC,oCAAiC,CAAE;AAChD,UAAM,YAAY,KAAK,QAAQ,iBAAiB;AAChD,UAAM,UAAU,QAAQ,EAAE,OAAO,WAAW,CAAC;AAE7C,UAAM,UAAU,SAAS,CAAC,SAAS;AACjC,WAAK,MAAM,QAAQ;AAAA,IACrB,CAAC;AACD,UAAM,OAAO,KAAK,QAAQ,qBAAqB,CAAC,EAAE,cAAc,oBAAoB;AAEpF,UAAM,UAAU,SAAS,CAAC,SAAS;AACjC,WAAK,MAAM,QAAQ;AAAA,IACrB,CAAC;AACD,UAAM,OAAO,KAAK,QAAQ,qBAAqB,CAAC,EAAE,cAAc,mBAAmB;AAAA,EACrF,CAAC;AACH,CAAC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import React2, { useState } from "react";
|
|
4
|
-
import { useOnOverflowChange } from "@elliemae/ds-hooks-on-overflow-change";
|
|
5
|
-
import { themeProviderHOC } from "@elliemae/ds-system";
|
|
6
|
-
const DSHooksIsOverflowingTestRenderer = themeProviderHOC(() => {
|
|
7
|
-
const [isOverflowing, setIsOverflowing] = useState(false);
|
|
8
|
-
const { handleRef } = useOnOverflowChange({
|
|
9
|
-
onOverflowStateChange: setIsOverflowing
|
|
10
|
-
});
|
|
11
|
-
return /* @__PURE__ */ jsxs("div", { children: [
|
|
12
|
-
/* @__PURE__ */ jsxs("div", { "data-testid": "overflow-state", children: [
|
|
13
|
-
"Overflowing: ",
|
|
14
|
-
isOverflowing ? "true" : "false"
|
|
15
|
-
] }),
|
|
16
|
-
/* @__PURE__ */ jsx(
|
|
17
|
-
"div",
|
|
18
|
-
{
|
|
19
|
-
"data-testid": "container",
|
|
20
|
-
ref: handleRef,
|
|
21
|
-
style: {
|
|
22
|
-
whiteSpace: "nowrap",
|
|
23
|
-
overflow: "hidden",
|
|
24
|
-
textOverflow: "ellipsis",
|
|
25
|
-
background: "rgba(30, 121, 194, 0.2)",
|
|
26
|
-
padding: "10px"
|
|
27
|
-
},
|
|
28
|
-
children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod."
|
|
29
|
-
}
|
|
30
|
-
)
|
|
31
|
-
] });
|
|
32
|
-
});
|
|
33
|
-
export {
|
|
34
|
-
DSHooksIsOverflowingTestRenderer
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=DSHooksIsOverflowingTestRenderer.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/tests/overflow/DSHooksIsOverflowingTestRenderer.jsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useState } from 'react';\nimport { useOnOverflowChange } from '@elliemae/ds-hooks-on-overflow-change';\nimport { themeProviderHOC } from '@elliemae/ds-system';\n\nexport const DSHooksIsOverflowingTestRenderer = themeProviderHOC(() => {\n const [isOverflowing, setIsOverflowing] = useState(false);\n\n const { handleRef } = useOnOverflowChange({\n onOverflowStateChange: setIsOverflowing,\n });\n\n return (\n <div>\n <div data-testid=\"overflow-state\">Overflowing: {isOverflowing ? 'true' : 'false'}</div>\n <div\n data-testid=\"container\"\n ref={handleRef}\n style={{\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n background: 'rgba(30, 121, 194, 0.2)',\n padding: '10px',\n }}\n >\n Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod.\n </div>\n </div>\n );\n});\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACajB,SACA,KADA;AAbN,OAAOA,UAAS,gBAAgB;AAChC,SAAS,2BAA2B;AACpC,SAAS,wBAAwB;AAE1B,MAAM,mCAAmC,iBAAiB,MAAM;AACrE,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAS,KAAK;AAExD,QAAM,EAAE,UAAU,IAAI,oBAAoB;AAAA,IACxC,uBAAuB;AAAA,EACzB,CAAC;AAED,SACE,qBAAC,SACC;AAAA,yBAAC,SAAI,eAAY,kBAAiB;AAAA;AAAA,MAAc,gBAAgB,SAAS;AAAA,OAAQ;AAAA,IACjF;AAAA,MAAC;AAAA;AAAA,QACC,eAAY;AAAA,QACZ,KAAK;AAAA,QACL,OAAO;AAAA,UACL,YAAY;AAAA,UACZ,UAAU;AAAA,UACV,cAAc;AAAA,UACd,YAAY;AAAA,UACZ,SAAS;AAAA,QACX;AAAA,QACD;AAAA;AAAA,IAED;AAAA,KACF;AAEJ,CAAC;",
|
|
6
|
-
"names": ["React"]
|
|
7
|
-
}
|