Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: TT-264 I divided each unit testing with line breaks
  • Loading branch information
kevinjlope committed Jun 28, 2021
commit 0800fa841ebc076fb55a9ef6fc7fefbd3fc600e7
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,19 @@ describe('ProjectListComponent', () => {
it('should destroy the projectTypesSubscription', () => {
component.projectTypesSubscription = new Subscription();
const subscriptionProjectTypes = spyOn(component.projectTypesSubscription, 'unsubscribe');

component.ngOnDestroy();

expect(subscriptionProjectTypes).toHaveBeenCalledTimes(1);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete this line white

});

it('updateProject, should dispatch SetProjectToEdit action', () => {
spyOn(store, 'dispatch');
component.projectsSubscription = new Subscription();
const subscription = spyOn(component.projectsSubscription, 'unsubscribe');

component.updateProject(project);

component.ngOnDestroy();

expect(subscription).toHaveBeenCalledTimes(1);
Expand Down Expand Up @@ -178,6 +180,7 @@ describe('ProjectListComponent', () => {
};

component.openModal(itemData);

expect(component.idToDelete).toEqual(itemData.id);
expect(component.showModal).toBeTrue();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ describe('AzureAdB2CService', () => {

it('should get userId from UserAgentApplication', () => {
spyOn(UserAgentApplication.prototype, 'getAccount').and.returnValues(account);

service.getUserId();

expect(UserAgentApplication.prototype.getAccount).toHaveBeenCalled();
Expand Down
2 changes: 2 additions & 0 deletions src/app/modules/user/services/user-info.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ describe('UserInfoService', () => {

it('should return true if is Admin', () => {
const isMemberOf = spyOn(service, 'isMemberOf').and.returnValue(of(true));

service.isAdmin().subscribe((value) => {
expect(value).toBeTrue();
});
Expand All @@ -68,6 +69,7 @@ describe('UserInfoService', () => {

it('should return true if is Tester', () => {
const isMemberOf = spyOn(service, 'isMemberOf').and.returnValue(of(true));

service.isTester().subscribe((value) => {
expect(value).toBeTrue();
});
Expand Down
1 change: 1 addition & 0 deletions src/app/modules/user/services/user.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ describe('UserService', () => {
it('load a user to idUser using GET', () => {
service.baseUrl = '/users';
service.loadUser('xyz').subscribe();

const loadUserRequest = httpMock.expectOne(`${service.baseUrl}/xyz`);
expect(loadUserRequest.request.method).toBe('GET');
});
Expand Down