datahub/datahub-web/@datahub/utils/tests/integration/components/dynamic-link-with-action-test.ts
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

25 lines
970 B
TypeScript

import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, click } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('Integration | Component | dynamic-link-with-action', function(hooks): void {
setupRenderingTest(hooks);
// Since the dynamic link component comes from an addon, we only care about the part we extended
test('extended functionality works as intended', async function(assert): Promise<void> {
await render(hbs`<DynamicLinkWithAction />`);
assert.ok(this.element, 'Initial render is without errors');
let functionCalled = 0;
this.set('myAction', () => {
functionCalled += 1;
});
await render(hbs`<DynamicLinkWithAction @onClickAction={{myAction}} class="testLink" />`);
assert.dom('.testLink').exists();
await click('.testLink');
assert.equal(functionCalled, 1, 'Function is expected to have only been called once');
});
});