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
46 lines
1.6 KiB
TypeScript
46 lines
1.6 KiB
TypeScript
import { module, test } from 'qunit';
|
|
import { setupRenderingTest } from 'ember-qunit';
|
|
import { render, findAll, triggerEvent } from '@ember/test-helpers';
|
|
import hbs from 'htmlbars-inline-precompile';
|
|
|
|
module('Integration | Component | radio-button-composer', function(hooks): void {
|
|
setupRenderingTest(hooks);
|
|
|
|
const disabledClass = 'paralyzed-pikachu';
|
|
|
|
test('decorated properties behave as expected', async function(assert): Promise<void> {
|
|
this.setProperties({
|
|
disabledClass,
|
|
value: 'electrify',
|
|
mouseEnter() {
|
|
assert.ok(true, 'Function got called on mouseEnter');
|
|
}
|
|
});
|
|
await render(hbs`{{#radio-button-composer
|
|
disabledClass=disabledClass
|
|
name="testA"
|
|
groupValue="groupA"
|
|
value=value
|
|
onMouseEnter=mouseEnter}}
|
|
{{value}}
|
|
{{/radio-button-composer}}`);
|
|
|
|
// Ensures the function assert was called.
|
|
assert.expect(4);
|
|
assert.equal(this.element.textContent?.trim(), 'electrify', 'renders expected value');
|
|
assert.equal(findAll(`.${disabledClass}`).length, 0, 'Does not disable when not supposed to');
|
|
|
|
await triggerEvent('span', 'mouseover');
|
|
|
|
await render(hbs`{{radio-button-composer
|
|
disabledClass=disabledClass
|
|
name="testB"
|
|
groupValue="groupB"
|
|
value=value
|
|
onMouseEnter=mouseEnter
|
|
disabled=true}}`);
|
|
|
|
assert.equal(findAll(`.${disabledClass}`).length, 1, 'Renders the disabled class');
|
|
});
|
|
});
|