mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-11 18:56:41 +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
65 lines
2.0 KiB
TypeScript
65 lines
2.0 KiB
TypeScript
import { module, test } from 'qunit';
|
|
import { setupRenderingTest } from 'ember-qunit';
|
|
import { render } from '@ember/test-helpers';
|
|
import hbs from 'htmlbars-inline-precompile';
|
|
import HealthEntityDetail, { baseClass } from '@datahub/shared/components/health/entity-detail';
|
|
import { getRenderedComponent } from '@datahub/utils/test-helpers/register-component';
|
|
import { stubService } from '@datahub/utils/test-helpers/stub-service';
|
|
|
|
module('Integration | Component | health/entity-detail', function(hooks): void {
|
|
setupRenderingTest(hooks);
|
|
|
|
hooks.beforeEach(function() {
|
|
stubService('configurator', {
|
|
getConfig(): object {
|
|
return {
|
|
wikiLinks: {
|
|
metadataHealth: 'http://www.example.com'
|
|
}
|
|
};
|
|
}
|
|
});
|
|
});
|
|
|
|
test('base rendering', async function(assert): Promise<void> {
|
|
await render(hbs`<Health::EntityDetail />`);
|
|
|
|
assert
|
|
.dom()
|
|
.hasText(
|
|
'Health Factors How is the health score computed? Overall Health: N/A Recalculate Score Factor Score Impact on Health Score Description'
|
|
);
|
|
});
|
|
|
|
test('component attributes and wiki render', async function(assert): Promise<void> {
|
|
const wiki = {
|
|
metadataHealth: 'http://www.example.com'
|
|
};
|
|
|
|
stubService('configurator', {
|
|
getConfig(): object {
|
|
return wiki;
|
|
}
|
|
});
|
|
const headerSelector = `.${baseClass}__header`;
|
|
|
|
this.set('wiki', wiki);
|
|
|
|
const component = await getRenderedComponent({
|
|
template: hbs`<Health::EntityDetail @wikiLinks={{this.wiki}} />`,
|
|
ComponentToRender: HealthEntityDetail,
|
|
testContext: this,
|
|
componentName: 'health/entity-detail'
|
|
});
|
|
|
|
assert.equal(
|
|
component.healthFactorsWiki,
|
|
wiki.metadataHealth,
|
|
'Expected the component to have a reference to Health Factors'
|
|
);
|
|
|
|
assert.dom(`${headerSelector} .more-info`).exists('Expected the tooltip for health wiki to be present');
|
|
assert.dom(`${headerSelector} a`).hasAttribute('href', wiki.metadataHealth);
|
|
});
|
|
});
|