fixing tests. (#10)
This commit is contained in:
parent
032946100c
commit
99af2846b9
|
@ -12,7 +12,12 @@ export class HeaderComponent implements OnInit {
|
||||||
constructor(private authService: AuthService, private router: Router) { }
|
constructor(private authService: AuthService, private router: Router) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
try {
|
||||||
this.current_user = this.authService.GetCurrentUser()
|
this.current_user = this.authService.GetCurrentUser()
|
||||||
|
} catch(e){
|
||||||
|
this.current_user = "unknown"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
closeMenu(e) {
|
closeMenu(e) {
|
||||||
|
|
|
@ -13,7 +13,7 @@ describe('AuthSigninComponent', () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [ AuthSigninComponent ],
|
declarations: [ AuthSigninComponent ],
|
||||||
imports: [HttpClientTestingModule, FormsModule],
|
imports: [HttpClientTestingModule, FormsModule, RouterTestingModule],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
|
|
|
@ -68,10 +68,10 @@ describe('FHIR401Client', () => {
|
||||||
let repository: IDatabaseRepository;
|
let repository: IDatabaseRepository;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
let current_user = uuidv4()
|
let current_user = uuidv4() as string
|
||||||
let cryptoConfig = await PouchdbCrypto.CryptConfig(current_user, current_user)
|
let cryptoConfig = await PouchdbCrypto.CryptConfig(current_user, current_user)
|
||||||
await PouchdbCrypto.StoreCryptConfig(cryptoConfig)
|
await PouchdbCrypto.StoreCryptConfig(cryptoConfig)
|
||||||
repository = NewPouchdbRepositoryWebWorker(current_user, '/database', new PouchDB("FHIR401Client-"+ current_user));
|
repository = NewPouchdbRepositoryWebWorker({current_user: current_user, auth_token:""}, '/database', new PouchDB("FHIR401Client-"+ current_user));
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(async () => {
|
afterEach(async () => {
|
||||||
|
|
|
@ -11,10 +11,10 @@ describe('PouchdbRepository', () => {
|
||||||
let repository: IDatabaseRepository;
|
let repository: IDatabaseRepository;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
let current_user = uuidv4()
|
let current_user = uuidv4() as string
|
||||||
let cryptoConfig = await PouchdbCrypto.CryptConfig(current_user, current_user)
|
let cryptoConfig = await PouchdbCrypto.CryptConfig(current_user, current_user)
|
||||||
await PouchdbCrypto.StoreCryptConfig(cryptoConfig)
|
await PouchdbCrypto.StoreCryptConfig(cryptoConfig)
|
||||||
repository = NewPouchdbRepositoryWebWorker(current_user, '/database', new PouchDB("PouchdbRepository" + current_user));
|
repository = NewPouchdbRepositoryWebWorker({current_user: current_user, auth_token: ""}, '/database', new PouchDB("PouchdbRepository" + current_user));
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(async () => {
|
afterEach(async () => {
|
||||||
|
|
Loading…
Reference in New Issue