Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
refactor: TTA-115 increase test coverage in status network service
  • Loading branch information
Abigail Cabascango committed Oct 6, 2022
commit 5f65148a67358dc62fa2ae39d7b469c909853ff9
13 changes: 10 additions & 3 deletions src/app/modules/shared/services/status-network.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,21 @@ describe('StatusNetworkService', () => {
});

it('checkTypeError is error', () => {
const errorType: ErrorType = {error: catchError, message: 'javascript', isError: true};
const errorType: ErrorType = {error: catchError, message: 'The server is disconnected', isError: true};
spyOn(toastrServiceStub, 'error');
service.checkTypeError(errorType);
expect(toastrServiceStub.error).toHaveBeenCalled();
});

it('checkTypeError is warning', () => {
const errorType: ErrorType = {error: catchError, message: 'javascript', isError: false};
it('checkTypeError is warning with message', () => {
const errorType: ErrorType = {error: catchError, message: 'The server is disconnected', isError: false};
spyOn(toastrServiceStub, 'warning');
service.checkTypeError(errorType);
expect(toastrServiceStub.warning).toHaveBeenCalled();
});

it('checkTypeError is warning without message', () => {
const errorType: ErrorType = {error: catchError, isError: false};
spyOn(toastrServiceStub, 'warning');
service.checkTypeError(errorType);
expect(toastrServiceStub.warning).toHaveBeenCalled();
Expand Down