import Onboard2Module from './onboard2'
import Onboard2Controller from './onboard2.controller';
import Onboard2Component from './onboard2.component';
import Onboard2Template from './onboard2.html';

describe('Onboard2', () => {
  let $rootScope, makeController;

  beforeEach(window.module(Onboard2Module));
  beforeEach(inject((_$rootScope_) => {
    $rootScope = _$rootScope_;
    makeController = () => {
      return new Onboard2Controller();
    };
  }));

  describe('Module', () => {
    // top-level specs: i.e., routes, injection, naming
  });

  describe('Controller', () => {
    // controller specs
    it('has a name property [REMOVE]', () => { // erase if removing this.name from the controller
      let controller = makeController();
      expect(controller).to.have.property('name');
    });
  });

  describe('Template', () => {
    // template specs
    // tip: use regex to ensure correct bindings are used e.g., {{  }}
    it('has name in template [REMOVE]', () => {
      expect(Onboard2Template).to.match(/{{\s?\$ctrl\.name\s?}}/g);
    });
  });

  describe('Component', () => {
      // component/directive specs
      let component = Onboard2Component;

      it('includes the intended template',() => {
        expect(component.template).to.equal(Onboard2Template);
      });

      it('invokes the right controller', () => {
        expect(component.controller).to.equal(Onboard2Controller);
      });
  });
});
