I'm struggling to figure out how to access the remaining line of code in order to achieve full code coverage. I am specifically looking to check if the function has been called using "toHaveBeenCalled()".
Below are the TypeScript file and my Spec file along with the current code coverage report:
TOTAL: 2 FAILED, 3 SUCCESS
================== Coverage summary ==================
Statements : 30.34% (27/89)
Branches : 0% (0/22)
Functions : 26.92% (7/26)
Lines : 29.07% (25/86)
=====================================================
update-notification.component.ts
import { Component, OnInit } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms';
import * as ClassicEditor from '@ckeditor/ckeditor5-build-classic';
import { NotificationService } from '../notification.service';
import { ActivatedRoute, Router } from '@angular/router';
import { ToastrService } from 'ngx-toastr';
// Component code...
My test cases..
update-notificatoin.component.spec.ts
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { NotificationService } from '../notification.service';
import { ActivatedRoute } from '@angular/router';
import { Router } from '@angular/router';
import { ToastrService } from 'ngx-toastr';
import { ClassicEditor } from '@ckeditor/ckeditor5-build-classic';
import { UpdateNotificationComponent } from './update-notification.component';
// Test cases...