mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-23 08:38:02 +00:00

* Releases updated version of datahub-web client UI code * Fix typo in yarn lock * Change yarn lock to match yarn registry directories * Previous commit missed some paths * Even more changes to yarnlock missing in previous commit * Include codegen file for typings * Add files to get parity for datahub-web and current OS datahub-midtier * Add in typo fix from previous commit - change to proper license * Implement proper OS fix for person entity picture url * Workarounds for open source DH issues * Fixes institutional memory api and removes unopensourced tabs for datasets * Fixes search dataset deprecation and user search issue as a result of changes * Remove internal only options in the avatar menu
25 lines
1.1 KiB
TypeScript
25 lines
1.1 KiB
TypeScript
import HealthProxy from '@datahub/shared/utils/health/health-proxy';
|
|
import { module, test } from 'qunit';
|
|
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
|
|
import { MirageTestContext } from '@datahub/utils/types/vendor/ember-cli-mirage/mirage-tests';
|
|
import { getSerializedMirageModel } from '@datahub/utils/test-helpers/serialize-mirage-model';
|
|
import { setupTest } from 'ember-qunit';
|
|
|
|
module('Unit | Utility | health/health', function(hooks): void {
|
|
setupTest(hooks);
|
|
setupMirage(hooks);
|
|
|
|
test('it works', function(this: MirageTestContext, assert): void {
|
|
const { server } = this;
|
|
let healthProxy = new HealthProxy(null);
|
|
assert.ok(Array.isArray(healthProxy.validations), 'Expected validations to be an array on the Health Proxy');
|
|
assert.ok(healthProxy.score === null, 'Expected score to be null when proxy is instantiated with null');
|
|
|
|
server.createList('entityHealth', 1);
|
|
const [healthObject] = getSerializedMirageModel('entityHealths', server);
|
|
healthProxy = new HealthProxy({ score: Math.random(), validations: healthObject.validations });
|
|
|
|
assert.ok(String(healthProxy.score).match(/\d{1,3}/));
|
|
});
|
|
});
|