extractValue(exemptionLevel: string, exemptionValue: any): string {
switch(exemptionLevel) {
case "C": return exemptionValue.isoCountryCode.toString();
case "R": return exemptionValue.districtNumber.toString();
case "D": return exemptionValue.divisionCode.toString();
case "T": return exemptionValue.terminalNumber.toString();
}
}
i tried below
it('expected value extractValue() c', () => {
component.extractValue('C','isoCountry');
expect('C').toEqual('isoCountry')
// expect(component.extractValue(expectedLevel[0], exemptionValue.isoCountryCode)).toHaveBeenCalled();
});
it showing error TypeError: Cannot read property 'toString' of undefined