mirror of
https://github.com/qlik-oss/nebula.js.git
synced 2025-12-19 09:48:18 -05:00
test: add hypercube error test (#466)
This commit is contained in:
@@ -31,7 +31,7 @@ const useEngine = ({ ACCEPT_EULA = false, cwd = path.resolve(__dirname, '../'),
|
||||
if (ACCEPT_EULA !== true) {
|
||||
throw new Error('Need to accept EULA in order to start engine container');
|
||||
}
|
||||
console.error('Starting engine container...', cwd);
|
||||
console.error('Starting engine container...');
|
||||
const f = (files || []).reduce((acc, curr) => [...acc, '-f', curr], []);
|
||||
process.env.ACCEPT_EULA = 'yes';
|
||||
const stopEngine = async () => {
|
||||
|
||||
@@ -65,7 +65,7 @@ if (engine) {
|
||||
});
|
||||
},
|
||||
stop: async () => {
|
||||
await e();
|
||||
e && (await e());
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -75,7 +75,7 @@ function cleanup() {
|
||||
return;
|
||||
}
|
||||
hasCleanedUp = true;
|
||||
console.log('Stopping services');
|
||||
console.log('> Stopping services');
|
||||
services.forEach(async (service) => {
|
||||
console.log(`${service.name}`);
|
||||
await service.stop();
|
||||
@@ -83,16 +83,16 @@ function cleanup() {
|
||||
}
|
||||
|
||||
async function run() {
|
||||
console.log('Starting services');
|
||||
console.log('> Starting services');
|
||||
|
||||
try {
|
||||
services.forEach(async (service) => {
|
||||
for await (const service of services) {
|
||||
console.log(`${service.name}`);
|
||||
await service.start();
|
||||
});
|
||||
console.log('All up and running');
|
||||
}
|
||||
console.log('> All up and running');
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
console.error(`\x1b[31m${JSON.stringify(err)}\x1b[0m`);
|
||||
cleanup();
|
||||
throw err;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,11 @@ describe('object lifecycle', () => {
|
||||
await waitForTextStatus('[data-tid="error-title"]', 'The calculation condition is not fulfilled');
|
||||
});
|
||||
|
||||
it('should render error when a hypercube contains a qError', async () => {
|
||||
await page.click('button[data-phase="hypercube-error"]');
|
||||
await waitForTextStatus('[data-tid="error-title"]', 'Error');
|
||||
});
|
||||
|
||||
it('should render when requirements are fulfilled', async () => {
|
||||
await page.click('button[data-phase="fulfill-requirements"]');
|
||||
await waitForTextStatus('.rendered', 'Success!');
|
||||
|
||||
@@ -22,6 +22,15 @@ const calcCond = {
|
||||
},
|
||||
};
|
||||
|
||||
const cubeError = {
|
||||
...baseProps,
|
||||
qHyperCubeDef: {
|
||||
qMode: 'S',
|
||||
qMeasures: [{}],
|
||||
qInterColumnSortOrder: [-2],
|
||||
},
|
||||
};
|
||||
|
||||
const fulfilled = {
|
||||
...baseProps,
|
||||
qHyperCubeDef: {
|
||||
@@ -112,6 +121,12 @@ export default function phases({ app }) {
|
||||
obj.setProperties(calcCond);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Hypercube error',
|
||||
action: () => {
|
||||
obj.setProperties(cubeError);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Fulfill requirements',
|
||||
action: () => {
|
||||
|
||||
Reference in New Issue
Block a user