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) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.current_user = this.authService.GetCurrentUser()
|
||||
try {
|
||||
this.current_user = this.authService.GetCurrentUser()
|
||||
} catch(e){
|
||||
this.current_user = "unknown"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
closeMenu(e) {
|
||||
|
|
|
@ -13,7 +13,7 @@ describe('AuthSigninComponent', () => {
|
|||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ AuthSigninComponent ],
|
||||
imports: [HttpClientTestingModule, FormsModule],
|
||||
imports: [HttpClientTestingModule, FormsModule, RouterTestingModule],
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
|
|
@ -68,10 +68,10 @@ describe('FHIR401Client', () => {
|
|||
let repository: IDatabaseRepository;
|
||||
|
||||
beforeEach(async () => {
|
||||
let current_user = uuidv4()
|
||||
let current_user = uuidv4() as string
|
||||
let cryptoConfig = await PouchdbCrypto.CryptConfig(current_user, current_user)
|
||||
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 () => {
|
||||
|
|
|
@ -11,10 +11,10 @@ describe('PouchdbRepository', () => {
|
|||
let repository: IDatabaseRepository;
|
||||
|
||||
beforeEach(async () => {
|
||||
let current_user = uuidv4()
|
||||
let current_user = uuidv4() as string
|
||||
let cryptoConfig = await PouchdbCrypto.CryptConfig(current_user, current_user)
|
||||
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 () => {
|
||||
|
|
Loading…
Reference in New Issue