Charlie Tran 843a6c5bbb
feat(frontend): update datahub-web client UI code (#1806)
* 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
2020-08-26 15:44:50 -07:00

42 lines
1.8 KiB
TypeScript

import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
import { getRenderedComponent } from '@datahub/utils/test-helpers/register-component';
import TopConsumersModalContainer from '@datahub/shared/components/top-consumers/containers/top-consumers-modal';
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
import { MirageTestContext } from '@datahub/utils/types/vendor/ember-cli-mirage/mirage-tests';
module('Integration | Component | top-consumers/containers/top-consumers', function(hooks): void {
setupRenderingTest(hooks);
setupMirage(hooks);
test('Container correctly instantiates the proper entities for top consumers', async function(this: MirageTestContext, assert): Promise<
void
> {
const topUserUrns = ['urn:li:corpuser:pikachu', 'urn:li:corpuser:ashketchum'];
const topGroupUrns = ['testGroupUrn1', 'testGroupUrn2'];
this.setProperties({
topUserUrns,
topGroupUrns
});
const topConsumersModalContainer = await getRenderedComponent({
ComponentToRender: TopConsumersModalContainer,
testContext: this,
template: hbs`<TopConsumers::Containers::TopConsumersModal @topUserUrns={{this.topUserUrns}} @topGroupUrns={{this.topGroupUrns}} />`,
componentName: 'top-consumers/containers/top-consumers-modal'
});
assert.equal(
topConsumersModalContainer.topUsers.length,
topUserUrns.length,
'Expects container to instantiate the correct amount of person instances as the people urns provided'
);
assert.equal(
topConsumersModalContainer.topGroups.length,
topGroupUrns.length,
'Expects container to instantiate the correct amount of group instances as the group urns provided'
);
});
});