mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
#17 Moved login component in login folder
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import {Component} from 'angular2/core';
|
||||
import {Router, RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router';
|
||||
import {Login} from './components/login';
|
||||
import {Login} from './components/login/login';
|
||||
import {Authentication} from './services/authentication';
|
||||
import {AuthRouterOutlet} from './components/AuthRouterOutlet';
|
||||
import {HomeView} from './components/home.view';
|
||||
|
@@ -1,11 +1,11 @@
|
||||
import {Component} from 'angular2/core';
|
||||
import {Router, ROUTER_DIRECTIVES} from 'angular2/router';
|
||||
import {FORM_DIRECTIVES, ControlGroup, FormBuilder, Validators} from 'angular2/common';
|
||||
import {Authentication} from '../services/authentication';
|
||||
import {Authentication} from '../../services/authentication';
|
||||
|
||||
@Component({
|
||||
selector: 'login',
|
||||
moduleId: 'app/components/login',
|
||||
moduleId: 'app/components/login/login',
|
||||
directives: [ROUTER_DIRECTIVES, FORM_DIRECTIVES],
|
||||
templateUrl: 'login.component.html',
|
||||
styleUrls: ['login.component.css'],
|
@@ -1,17 +1,8 @@
|
||||
import {
|
||||
it,
|
||||
inject,
|
||||
injectAsync,
|
||||
describe,
|
||||
beforeEachProviders,
|
||||
TestComponentBuilder
|
||||
} from 'angular2/testing';
|
||||
|
||||
import {it, inject, injectAsync, describe, beforeEachProviders, TestComponentBuilder} from 'angular2/testing';
|
||||
import {provide, Injector} from 'angular2/core';
|
||||
import {Http, HTTP_PROVIDERS, XHRBackend, Response, ResponseOptions} from 'angular2/http';
|
||||
import {MockBackend} from 'angular2/http/testing';
|
||||
|
||||
import {Authentication} from "app/services/authentication";
|
||||
import {Authentication} from 'app/services/authentication';
|
||||
|
||||
describe('Authentication', () => {
|
||||
let injector,
|
||||
@@ -23,16 +14,12 @@ describe('Authentication', () => {
|
||||
beforeEach(() => {
|
||||
injector = Injector.resolveAndCreate([
|
||||
HTTP_PROVIDERS,
|
||||
// this next value should NOT be provided, but when it is,
|
||||
// we lose the ability to correlate the backend calls
|
||||
// to the test Is there a way to detect this has been
|
||||
// done and reject it out-of-hand?
|
||||
MockBackend, // this is clearly wrong...
|
||||
MockBackend,
|
||||
provide(XHRBackend, {useClass: MockBackend}),
|
||||
Authentication
|
||||
]);
|
||||
|
||||
var store = {};
|
||||
let store = {};
|
||||
|
||||
spyOn(localStorage, 'getItem').and.callFake(function (key) {
|
||||
return store[key];
|
||||
@@ -47,7 +34,7 @@ describe('Authentication', () => {
|
||||
delete store[key];
|
||||
});
|
||||
spyOn(localStorage, 'key').and.callFake(function (i) {
|
||||
var keys = Object.keys(store);
|
||||
let keys = Object.keys(store);
|
||||
return keys[i] || null;
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user