new to Angular and testing.
In this method in the main code
private isReIndexActive(view: ViewShortDto): boolean {
return view.dataFlowTaskName && this.isViewCompleted(view);
}
I created a test case in the
it('should check if Re-Run Index is not active', () => {
const isActionEnabled = service.itemActions[4].isActive(SHORT_VIEWS[3]);
expect(isActionEnabled).toBeFalse();
});
and the mock data is
{
systemName: 'xxx-xxx-xxx',
name: 'Demo',
step: 6,
indexStatus: 'Completed',
dataFlowTaskName: null,
}
when I run the unit test, the the output result is
expected null to be false.
however the return type in the main code is boolean. why is this error being shown?
Changed the code to
tobeFalsy()
however, the code review told it is not best practise.