import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render, click, triggerEvent } from '@ember/test-helpers'; import hbs from 'htmlbars-inline-precompile'; import sinonTest from 'ember-sinon-qunit/test-support/test'; import UnifiedTracking from '@datahub/shared/services/unified-tracking'; import { ControlInteractionType } from '@datahub/shared/constants/tracking/event-tracking/control-interaction-events'; import { stubService } from '@datahub/utils/test-helpers/stub-service'; import { TrackingEventCategory } from '@datahub/shared/constants/tracking/event-tracking'; module('Integration | Modifier | track-control-interaction', function(hooks): void { setupRenderingTest(hooks); sinonTest('It calls the track event action when triggered', async function( this: SinonTestContext, assert ): Promise { const service: UnifiedTracking = this.owner.lookup('service:unified-tracking'); const stubbedTrackEvent = this.stub(service, 'trackEvent'); this.setProperties({ type: ControlInteractionType.click, name: 'pika-test' }); await render(hbs`