'use strict';
var path = require('path');
var assert = require('yeoman-assert');
var helpers = require('yeoman-test');
// Var TestHelper = require('./test-helper');

describe('Testing module with camelCase module', () => {
  beforeAll(() => {
    return helpers.run(path.join(__dirname, '../generators/module'))
      .withArguments(['userAuth']);
  });

  const fileDir = 'app/user-auth/user-auth.module.js';

  it('creates files', () => {
    assert.file([fileDir]);
  });

  it('define name', () =>
    assert.fileContent(
      fileDir,
      'export const UserAuthModule = angular'
    )
  );
});

describe('Testing module with route', () => {
  beforeAll(() => {
    return helpers.run(path.join(__dirname, '../generators/module'))
      .withArguments(['userAuth'])
      .withOptions({r: true});
  });

  const fileDir = 'app/user-auth/user-auth.module.js';

  it('import uiRouter', () =>
    assert.fileContent(
      fileDir,
      'import uiRouter from \'@uirouter/angularjs\';'
    )
  );

  it('declare config', () =>
    assert.fileContent(
      fileDir,
      '.config($stateProvider => {'
    )
  );

  it('declare $stateProvider', () =>
    assert.fileContent(
      fileDir,
      '$stateProvider'
    )
  );
});


@@ -1210,24 +1210,1348 @@
 ovider'%0A    )%0A  );%0A%7D);%0A%0A
+describe('Testing module with component', () =%3E %7B%0A  beforeAll(() =%3E %7B%0A    return helpers.run(path.join(__dirname, '../generators/module'))%0A      .withArguments(%5B'userAuth'%5D)%0A      .withOptions(%7Bc: true%7D);%0A  %7D);%0A%0A  const fileDir = 'app/user-auth/user-auth.component.js';%0A%0A  it('creates files', () =%3E %7B%0A    assert.file(%5BfileDir%5D);%0A  %7D);%0A%0A  it('define name', () =%3E%0A    assert.fileContent(%0A      fileDir,%0A      'export const UserAuthComponent = %7B'%0A    )%0A  );%0A%0A  it('define template', () =%3E%0A    assert.fileContent(%0A      fileDir,%0A      'template: '%0A    )%0A  );%0A%0A  it('not define templateUrl', () =%3E%0A    assert.noFileContent(%0A      fileDir,%0A      'templateUrl'%0A    )%0A  );%0A%7D);%0A%0Adescribe('Testing module with components and template', () =%3E %7B%0A  beforeAll(() =%3E %7B%0A    return helpers.run(path.join(__dirname, '../generators/module'))%0A      .withArguments(%5B'userAuth'%5D)%0A      .withOptions(%7Bc: true, t: true%7D);%0A  %7D);%0A%0A  const fileDir = 'app/user-auth/user-auth.component.js';%0A%0A  it('creates files', () =%3E %7B%0A    assert.file(%5B%0A      fileDir,%0A      fileDir.replace('component.js', 'component.html') // Html file%0A    %5D);%0A  %7D);%0A%0A  it('not define template', () =%3E%0A    assert.noFileContent(%0A      fileDir,%0A      'template: '%0A    )%0A  );%0A%0A  it('define templateUrl', () =%3E%0A    assert.fileContent(%0A      fileDir,%0A      'templateUrl'%0A    )%0A  );%0A%7D);%0A

Add component by param