chart module: re-pin to the canonical revision that adds the definition layer
Same byte-identical module as the panel; the dashboard's own port to the shared definitions is the next commit. check-page-js.sh's DOM stub now supports setAttribute/insertAdjacentHTML, which the shared metric-button builder needs.
This commit is contained in:
1 parent
8c469c1242
commit
c5d4677ec3
3 files changed
+176
-8
No files matched your search
+14
-6
@@ -62,12 +62,20 @@ if [ -n "$HARNESS" ]; then
|
||||
// Minimal browser stubs, loaded BEFORE the page JS: these pages call
|
||||
// load()/loadModels() at the end of the script, which need document + fetch.
|
||||
const els = {};
|
||||
const mkEl = (id) => ({
|
||||
id, style: {}, textContent: "", innerHTML: "", className: "",
|
||||
offsetWidth: 120, offsetHeight: 48,
|
||||
getAttribute: () => null,
|
||||
appendChild: () => {},
|
||||
});
|
||||
const mkEl = (id) => {
|
||||
const el = {
|
||||
id, style: {}, textContent: "", innerHTML: "", className: "",
|
||||
offsetWidth: 120, offsetHeight: 48,
|
||||
getAttribute: () => null,
|
||||
setAttribute: () => {},
|
||||
appendChild: () => {},
|
||||
};
|
||||
// The pages build some markup by inserting HTML into a container
|
||||
// (buildMetricButtons inserts the SHARED metric list), so the stub has to
|
||||
// support it or the harness cannot exercise that path at all.
|
||||
el.insertAdjacentHTML = (pos, html) => { el.innerHTML += html; };
|
||||
return el;
|
||||
};
|
||||
globalThis.document = {
|
||||
getElementById: (id) => (els[id] = els[id] || mkEl(id)),
|
||||
querySelectorAll: () => [],
|
||||
|
||||
Reference in new issue
Block a user