Files
nebula.js/test/rendering/sheet/sheet.js
Tobias Åström 12de8693ae chore: fix sheet rendering without bounds (#1411)
* chore: support old sheets without bounds

* chore: add rendering test

* chore: sheet fixture fix

* chore: adjust columns

* chore: add baseline
2023-11-23 09:01:38 +01:00

54 lines
1.2 KiB
JavaScript

/* global configured */
/* eslint no-underscore-dangle: 0 */
(() => {
async function getMocks(EnigmaMocker) {
const { getSheetLayout, getSheetLayout2, getBarLayout, getPieLayout } = window.getFuncs();
const obj = [
{
id: `sheet`,
type: 'sheet',
getLayout: () => getSheetLayout(),
},
{
id: `boundLessSheet`,
type: 'sheet',
getLayout: () => getSheetLayout2(),
},
{
id: `bar`,
type: 'barchart',
getLayout: () => getBarLayout(),
},
{
id: `pie`,
type: 'piechart',
getLayout: () => getPieLayout(),
},
];
const app = await EnigmaMocker.fromGenericObjects(obj);
return {
obj,
app,
};
}
const init = async () => {
const urlParams = new URLSearchParams(window.location.search);
const target = urlParams.get('target');
const element = document.querySelector('#object');
const { app } = await getMocks(window.stardust.EnigmaMocker);
const nebbie = configured(app);
const inst = await nebbie.render({ id: target, element });
return () => {
inst?.unmount(element);
};
};
return init();
})();