elwayman02/ember-interactivity

View on GitHub
addon-test-support/mock-interactivity-tracking-service.js

Summary

Maintainability
A
0 mins
Test Coverage
import InteractivityTrackingService from 'ember-interactivity/services/interactivity-tracking';

export default InteractivityTrackingService.extend({
  _trackedComponentCalls: null,
  _trackedRouteCalls: null,

  init() {
    this._super(...arguments);
    this.resetInvocations();
  },

  trackComponent(data) {
    this._trackedComponentCalls.push(data);
  },

  trackRoute(data) {
    this._trackedRouteCalls.push(data);
  },

  resetInvocations() {
    this._trackedComponentCalls = [];
    this._trackedRouteCalls = [];
  }
});