mirror of
https://github.com/qlik-oss/nebula.js.git
synced 2025-12-19 09:48:18 -05:00
* chore: convert rendering tests to es6 * chore: fix cjs config usage * chore: fix cjs config usage * chore: fix verify translations * chore: babel and jest es6 * chore: aw cjs * chore: aw cjs * chore: aw cjs * chore: fix path
52 lines
1.5 KiB
JavaScript
52 lines
1.5 KiB
JavaScript
const path = require('path');
|
|
const serve = require('@nebula.js/cli-serve'); // eslint-disable-line
|
|
const puppeteerUtil = require('../../utils/puppeteer-util');
|
|
|
|
describe('Table visualization', () => {
|
|
const content = '.simple-table';
|
|
let s;
|
|
|
|
before(async () => {
|
|
s = await serve({
|
|
entry: path.resolve(__dirname, 'sn-table'),
|
|
open: false,
|
|
fixturePath: 'test/integration/table',
|
|
});
|
|
puppeteerUtil.addListeners(page);
|
|
});
|
|
|
|
after(() => {
|
|
s.close();
|
|
puppeteerUtil.removeListeners(page);
|
|
});
|
|
|
|
describe('basic', () => {
|
|
before(async () => {
|
|
const url = `${s.url}/render?fixture=table.fix.js`;
|
|
await page.goto(url);
|
|
|
|
await page.waitForSelector(content, { visible: true });
|
|
});
|
|
|
|
it('should render a div', async () => {
|
|
const text = await page.$eval('.hello', (el) => el.textContent);
|
|
expect(text).to.equal('A simple table');
|
|
});
|
|
|
|
it('should be able to load json file', async () => {
|
|
const text = await page.$eval('.json-value', (el) => el.textContent);
|
|
expect(text).to.equal('Hi json!');
|
|
});
|
|
|
|
it('should be able to load css', async () => {
|
|
const bg = await page.$eval('.hello', (el) => window.getComputedStyle(el).backgroundColor);
|
|
expect(bg).to.equal('rgb(144, 41, 140)');
|
|
});
|
|
|
|
it('should have some data', async () => {
|
|
const text = await page.$eval('.table table tbody td', (el) => el.textContent);
|
|
expect(text).to.equal('A');
|
|
});
|
|
});
|
|
});
|