@cdmx/wappler_ag_grid 2.1.7 → 2.1.9
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/CHANGELOG.md +17 -0
- package/README.md +73 -10
- package/app_connect/components.hjson +1 -1
- package/dmx-ag-grid.js +25 -4
- package/package.json +1 -1
- package/tests/01-basic-render.html +1 -1
- package/tests/02-themes-locale.html +1 -1
- package/tests/03-editing.html +1 -1
- package/tests/04-selection.html +1 -1
- package/tests/05-action-buttons.html +1 -1
- package/tests/06-export.html +1 -1
- package/tests/07-import.html +1 -1
- package/tests/08-formatting.html +1 -1
- package/tests/09-grouping.html +1 -1
- package/tests/10-state-persistence.html +1 -1
- package/tests/11-layout.html +1 -1
- package/tests/12-methods.html +1 -1
- package/tests/13-flags-styles.html +71 -7
- package/tests/14-compact-view.html +1 -1
- package/tests/15-csp.html +98 -0
- package/tests/FINDINGS.md +229 -0
- package/tests/README.md +6 -0
- package/tests/VERSIONS.json +29 -0
- package/tests/csp-hashes.cjs +191 -0
- package/tests/data/sample-data.js +12 -1
- package/tests/findings.json +928 -0
- package/tests/lib/common-head.html +1 -1
- package/tests/lib/test-helpers.js +3 -1
- package/tests/lib/version-banner.js +46 -0
- package/tests/run-all-puppeteer.cjs +8 -3
- package/tests/run-all.cjs +3 -2
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<script src="./lib/test-helpers.js" defer></script>
|
|
18
18
|
<script src="./lib/page-template.js" defer></script>
|
|
19
19
|
|
|
20
|
-
<script src="../node_modules/ag-grid-community/dist/ag-grid-community.min.js" defer></script>
|
|
20
|
+
<script src="../node_modules/ag-grid-community/dist/ag-grid-community.min.noStyle.js" defer></script>
|
|
21
21
|
<script src="../node_modules/@ag-grid-community/locale/dist/umd/@ag-grid-community/locale.min.js" defer></script>
|
|
22
22
|
<script src="../ru.js" defer></script>
|
|
23
23
|
<script src="../node_modules/papaparse/papaparse.min.js" defer></script>
|
|
@@ -131,7 +131,9 @@
|
|
|
131
131
|
console.error('[TestKit] no method', method, 'on', id);
|
|
132
132
|
return null;
|
|
133
133
|
}
|
|
134
|
-
|
|
134
|
+
// AppConnect's __method wrapper drops its first argument (Wappler passes the event there),
|
|
135
|
+
// so prepend a placeholder or methods like applyFilters(model) receive undefined.
|
|
136
|
+
return g[key].apply(g, [null].concat(args));
|
|
135
137
|
},
|
|
136
138
|
list: function () {
|
|
137
139
|
// Find dmx-ag-grid elements in the DOM and return their dmx ids — more reliable
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Detects the running AppConnect build and exposes it for the page header + console.
|
|
2
|
+
// Logs a warning if it drifts from the version pinned in VERSIONS.json.
|
|
3
|
+
window.__AG_GRID_TEST_SUITE__ = window.__AG_GRID_TEST_SUITE__ || {};
|
|
4
|
+
|
|
5
|
+
(function () {
|
|
6
|
+
const EXPECTED_APP_CONNECT = '2.2.4';
|
|
7
|
+
const MODULE_VERSION = '2.1.3';
|
|
8
|
+
|
|
9
|
+
const detect = () => {
|
|
10
|
+
if (!window.dmx) return null;
|
|
11
|
+
return {
|
|
12
|
+
version: dmx.version || null,
|
|
13
|
+
hasComponentApi: typeof dmx.Component === 'function',
|
|
14
|
+
hasAppContext: !!(dmx.app && typeof dmx.app.get === 'function')
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const log = (level, msg) => {
|
|
19
|
+
const fn = console[level] || console.log;
|
|
20
|
+
fn('[ag-grid-test-suite] ' + msg);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const apply = () => {
|
|
24
|
+
const info = detect();
|
|
25
|
+
if (!info) {
|
|
26
|
+
setTimeout(apply, 50);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
window.__AG_GRID_TEST_SUITE__.appConnect = info.version;
|
|
30
|
+
window.__AG_GRID_TEST_SUITE__.module = MODULE_VERSION;
|
|
31
|
+
window.__AG_GRID_TEST_SUITE__.expectedAppConnect = EXPECTED_APP_CONNECT;
|
|
32
|
+
window.__AG_GRID_TEST_SUITE__.driftFromExpected = info.version !== EXPECTED_APP_CONNECT;
|
|
33
|
+
|
|
34
|
+
if (info.version !== EXPECTED_APP_CONNECT) {
|
|
35
|
+
log('warn',
|
|
36
|
+
'AppConnect version drift: expected ' + EXPECTED_APP_CONNECT +
|
|
37
|
+
', running ' + info.version + '. Update tests/VERSIONS.json if intentional.');
|
|
38
|
+
} else {
|
|
39
|
+
log('log', 'AppConnect ' + info.version + ' matches pinned version.');
|
|
40
|
+
}
|
|
41
|
+
if (!info.hasComponentApi) {
|
|
42
|
+
log('error', 'dmx.Component API missing — grid will not register.');
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
apply();
|
|
46
|
+
})();
|
|
@@ -22,8 +22,9 @@ const PAGES = [
|
|
|
22
22
|
{ file: '10-state-persistence.html',grids: ['stateGrid'] },
|
|
23
23
|
{ file: '11-layout.html', grids: ['autoH','fixedH','scrollH'] },
|
|
24
24
|
{ file: '12-methods.html', grids: ['m'] },
|
|
25
|
-
{ file: '13-flags-styles.html', grids: ['flagsGrid','rsFn','rsOp','rsCompound','rsShort','rsFirst','rsLegacy','csCell','transformGrid','tipGrid'], pageAssertion: '__rsCheck' },
|
|
26
|
-
{ file: '14-compact-view.html', grids: ['compactGrid','extButtons','cellEvtGrid'] }
|
|
25
|
+
{ file: '13-flags-styles.html', grids: ['flagsGrid','rsFn','rsOp','rsCompound','rsShort','rsFirst','rsLegacy','csCell','transformGrid','tipGrid','jsFilterGrid'], pageAssertion: '__rsCheck' },
|
|
26
|
+
{ file: '14-compact-view.html', grids: ['compactGrid','extButtons','cellEvtGrid'] },
|
|
27
|
+
{ file: '15-csp.html', grids: ['cspGrid','statusGrid'], pageAssertion: '__cspCheck' }
|
|
27
28
|
];
|
|
28
29
|
|
|
29
30
|
function findChrome() {
|
|
@@ -131,8 +132,11 @@ function findChrome() {
|
|
|
131
132
|
let assertion = null;
|
|
132
133
|
if (spec.pageAssertion) {
|
|
133
134
|
try {
|
|
135
|
+
// Page checks poll until their grids settle; wait for them to publish instead of
|
|
136
|
+
// reading too early (a missing assertion must fail, not pass silently).
|
|
137
|
+
await page.waitForFunction((key) => !!window[key], { timeout: 10000 }, spec.pageAssertion);
|
|
134
138
|
assertion = await page.evaluate((key) => window[key] || null, spec.pageAssertion);
|
|
135
|
-
} catch (e) { assertion = { error: e.message }; }
|
|
139
|
+
} catch (e) { assertion = { ok: false, error: e.message }; }
|
|
136
140
|
}
|
|
137
141
|
const assertionFailed = assertion && assertion.ok === false;
|
|
138
142
|
|
|
@@ -159,6 +163,7 @@ function findChrome() {
|
|
|
159
163
|
if (assertion) {
|
|
160
164
|
if (assertionFailed) {
|
|
161
165
|
console.log(' assertion FAILED — checks that did not match:');
|
|
166
|
+
if (assertion.error) console.log(' error: ' + assertion.error);
|
|
162
167
|
(assertion.failed || []).forEach(k => {
|
|
163
168
|
const c = assertion.checks && assertion.checks[k];
|
|
164
169
|
console.log(' ' + k + ' expected ' + (c && c.expect) + ' got ' + (c && c.actual));
|
package/tests/run-all.cjs
CHANGED
|
@@ -25,8 +25,9 @@ const PAGES = [
|
|
|
25
25
|
{ file: '10-state-persistence.html',grids: ['stateGrid'] },
|
|
26
26
|
{ file: '11-layout.html', grids: ['autoH','fixedH','scrollH'] },
|
|
27
27
|
{ file: '12-methods.html', grids: ['m'] },
|
|
28
|
-
{ file: '13-flags-styles.html', grids: ['flagsGrid','stylesGrid','transformGrid','tipGrid'] },
|
|
29
|
-
{ file: '14-compact-view.html', grids: ['compactGrid','extButtons','cellEvtGrid'] }
|
|
28
|
+
{ file: '13-flags-styles.html', grids: ['flagsGrid','stylesGrid','transformGrid','tipGrid','jsFilterGrid'] },
|
|
29
|
+
{ file: '14-compact-view.html', grids: ['compactGrid','extButtons','cellEvtGrid'] },
|
|
30
|
+
{ file: '15-csp.html', grids: ['cspGrid','statusGrid'] }
|
|
30
31
|
];
|
|
31
32
|
|
|
32
33
|
function ab(args, { allowFail = false, timeout = 60000 } = {}) {
|