refactor: define hydrogen BI metric semantics
This commit is contained in:
@@ -7,11 +7,21 @@ test('returns the published mileage metric contract', async () => {
|
||||
const payload = await response.json();
|
||||
|
||||
assert.equal(response.status, 200);
|
||||
assert.equal(payload.catalogVersion, 1);
|
||||
assert.equal(payload.catalogVersion, 2);
|
||||
assert.deepEqual(payload.domains, ['mileage']);
|
||||
assert.ok(payload.metrics.some((metric: { id: string }) => metric.id === 'mileage.assessment_completion_rate'));
|
||||
});
|
||||
|
||||
test('returns the published hydrogen metric contract', async () => {
|
||||
const response = await app.request('/metrics?domain=hydrogen');
|
||||
const payload = await response.json();
|
||||
|
||||
assert.equal(response.status, 200);
|
||||
assert.deepEqual(payload.domains, ['hydrogen']);
|
||||
assert.ok(payload.metrics.some((metric: { id: string }) => metric.id === 'hydrogen.customer_revenue'));
|
||||
assert.ok(payload.metrics.some((metric: { id: string }) => metric.id === 'hydrogen.customer_order_gross_profit'));
|
||||
});
|
||||
|
||||
test('rejects unpublished metric domains', async () => {
|
||||
const response = await app.request('/metrics?domain=energy');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user