mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-22 16:18:10 +00:00
19 lines
867 B
TypeScript
19 lines
867 B
TypeScript
![]() |
import { MockEntity } from '@datahub/data-models/entity/mock/mock-entity';
|
||
|
import { module, test } from 'qunit';
|
||
|
import { IEntityLinkAttrs } from '@datahub/data-models/types/entity/shared';
|
||
|
|
||
|
module('Unit | Utility | entity/mock/mock-entity', function(): void {
|
||
|
test('entityTabLink', function(assert): void {
|
||
|
const expectedTab = 'tabName';
|
||
|
const expectedUrn = 'mock-urn';
|
||
|
const tabLinkParams = new MockEntity('mock-urn').entityTabLink(expectedTab) as IEntityLinkAttrs;
|
||
|
|
||
|
assert.ok(tabLinkParams, 'Expected tabLinkParams to be generated when supplied with required attributes');
|
||
|
|
||
|
const [, urn, tabName] = tabLinkParams.link.model as Array<string>;
|
||
|
|
||
|
assert.equal(expectedTab, tabName, 'Expected the supplied tab name to be in the model array');
|
||
|
assert.equal(expectedUrn, urn, 'Expected the supplied urn to be in the model array');
|
||
|
});
|
||
|
});
|