mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-12 03:07:05 +00:00
25 lines
809 B
TypeScript
25 lines
809 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';
|
||
|
import sinon from 'sinon';
|
||
|
|
||
|
module('Integration | Component | health/health-insight-recalculation-button', function(hooks): void {
|
||
|
setupRenderingTest(hooks);
|
||
|
|
||
|
test('rendering and interactivity', async function(assert): Promise<void> {
|
||
|
const action = sinon.fake();
|
||
|
this.setProperties({
|
||
|
action
|
||
|
});
|
||
|
|
||
|
await render(hbs`<Health::HealthInsightRecalculationButton @onRecalculateHealthScore={{this.action}} />`);
|
||
|
|
||
|
assert.dom().hasText('Recalculate Score');
|
||
|
|
||
|
await click('button');
|
||
|
|
||
|
assert.ok(action.calledOnce, "Expected action to be called when the component's button is clicked");
|
||
|
});
|
||
|
});
|