fixing tests. (#10)

This commit is contained in:
Jason Kulatunga 2022-11-02 00:26:54 -07:00 committed by GitHub
parent 032946100c
commit 99af2846b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 6 deletions

View File

@ -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) {

View File

@ -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();

View File

@ -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 () => {

View File

@ -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 () => {