Obteniendo este error al ejecutar ng test.
TypeError: no se pueden leer las propiedades de undefined (leyendo 'id')
this.slotSvc.getFiscalWeek(startDate, 1) .then(function (data) { const inductionYear = (data[0].id).split('-')[1]; const shopId = slot.shop.id; const ohLines = []; this.slotSvc.getOlLinesForShop(shopId, inductionYear) .subscribe(function (d) { _.each(d, function (dataOL) { let slotLineType; if (slot.linetype) { slotLineType = slot.linetype; } else { slotLineType = slot.assignedAssetInfo.lineTypes[0]; } if (dataOL.lineTypes[0] === slotLineType && dataOL.name.includes(slot.assetType)) { const olJson = { 'id': dataOL.id, 'displayName': dataOL.displayName }; ohLines.push(olJson); } }.bind(this));Parece que está accediendo a accesorios de identificación de datos que no existen. Intente monitorear los parámetros de datos y registrar datos si contienen id prop o no.
puedes hacer esto const inductionYear = (data[0]?.id).split('-')[1];
después de poner un signo de interrogación, no dará ningún error indefinido.