src/app/routes/layout-app/employees/edit/account-details/account-details.spec.js
/**
* @author Martin Micunda {@link http://martinmicunda.com}
* @copyright Copyright (c) 2015, Martin Micunda
* @license GPL-3.0
*/
'use strict';
import 'angular-mocks';
import './account-details.js';
describe('EmployeeEditAccountDetails', () => {
beforeEach(angular.mock.module('ngDecorator'));
describe('Route', () => {
let id = '1',
url = `/employees/${id}/edit/account-details`,
state = 'app.employees.edit.account-details',
component = '<employee-account-details></employee-account-details>',
currentState, $state;
beforeEach(inject((_$state_) => {
$state = _$state_;
$state.go(state, {id: id});
currentState = $state.get(state);
}));
it(`should respond to '${url}' URL`, () => {
expect($state.href(state, {id: id})).toEqual(url);
});
it('should have component named `employee-account-details`', () => {
expect(currentState.views['modal@'].template).toEqual(component);
});
});
});