I'm trying to write unit test cases for the the below function:
selected (event:any) {
let selectedValue = event.target.value.substring(0,3);
this.seletedBatch = selectedValue;
this.enableSubmitButton = true
}
The test cases which I have written:
let selectedValue= fixture.debugElement.nativeElement.querySelector('selectedValue')
fixture.detectChanges();
expect(component.selectedBatch).toEqual(selectedValue)
expect (component.enableSubmitButton).toBe(true)
But I'm getting the following errors and not sure if I'm writing it correctly for this event:
1. Expected undefined to equal null.
2. Expected false to be true
P.S - I'm new in writing test cases.
Thanks in advance. Any help is appreciated