-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1107 from ORCID/clean-up-tests
Clean up tests
- Loading branch information
Showing
11 changed files
with
69 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 22 additions & 22 deletions
44
ui/src/app/account/password/password-reset-finish.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { ComponentFixture, TestBed } from '@angular/core/testing' | ||
|
||
import { PasswordResetFinishComponent } from './password-reset-finish.component'; | ||
import { AppModule } from 'src/app/app.module'; | ||
import { PasswordService } from '../service/password.service'; | ||
import { of, throwError } from 'rxjs'; | ||
import { PasswordResetFinishComponent } from './password-reset-finish.component' | ||
import { AppModule } from 'src/app/app.module' | ||
import { PasswordService } from '../service/password.service' | ||
import { of, throwError } from 'rxjs' | ||
|
||
describe('PasswordResetFinishComponent', () => { | ||
let component: PasswordResetFinishComponent; | ||
let fixture: ComponentFixture<PasswordResetFinishComponent>; | ||
let service: PasswordService; | ||
let component: PasswordResetFinishComponent | ||
let fixture: ComponentFixture<PasswordResetFinishComponent> | ||
let service: PasswordService | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [AppModule], | ||
declarations: [PasswordResetFinishComponent] | ||
}); | ||
fixture = TestBed.createComponent(PasswordResetFinishComponent); | ||
declarations: [PasswordResetFinishComponent], | ||
}) | ||
fixture = TestBed.createComponent(PasswordResetFinishComponent) | ||
service = fixture.debugElement.injector.get(PasswordService) | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
component = fixture.componentInstance | ||
fixture.detectChanges() | ||
}) | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
expect(component).toBeTruthy() | ||
}) | ||
|
||
it('password should save successfully', () => { | ||
spyOn(service, 'savePassword').and.returnValue(of(true)) | ||
component.finishReset(); | ||
component.finishReset() | ||
expect(component.success).toEqual('OK') | ||
}); | ||
}) | ||
|
||
it('password save should fail', () => { | ||
spyOn(service, 'savePassword').and.returnValue(throwError(() => new Error('error'))) | ||
component.finishReset(); | ||
component.finishReset() | ||
expect(component.error).toEqual('ERROR') | ||
expect(component.success).toBeFalsy(); | ||
}); | ||
}); | ||
expect(component.success).toBeFalsy() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters