Files
nebula.js/test/rendering/sheet/sheet.js
Tobias Åström 3dacac587b feat: sheet embed support (#1013)
* feat: add basic sheet rendering support

* chore: add missing file

* fix: correct bg colors for none support

* chore: fix test that relied on dark bg

* chore: fix ref

* chore: api spec update

* chore: add todo comments

* chore: use memo

* chore: a bit less verbose

* chore: list

* chore: cleaning

* chore: add rendering test

* chore: enable rendering test

* chore: settings

* chore: settings

* chore: disable rendering tests

* chore: revert test tests
2022-12-12 13:54:04 +01:00

47 lines
972 B
JavaScript

/* global configured */
/* eslint no-underscore-dangle: 0 */
(() => {
async function getMocks(EnigmaMocker) {
const { getSheetLayout, getBarLayout, getPieLayout } = window.getFuncs();
const obj = [
{
id: `sheet`,
type: 'sheet',
getLayout: () => getSheetLayout(),
},
{
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 element = document.querySelector('#object');
const { app } = await getMocks(window.stardust.EnigmaMocker);
const nebbie = configured(app);
const inst = await nebbie.render({ id: 'sheet', element });
return () => {
inst?.unmount(element);
};
};
return init();
})();