Openbravo Issue Tracking System - POS2
View Issue Details
0053962POS2POSpublic2023-11-16 13:562023-11-17 13:22
AugustoMauch 
AugustoMauch 
normalminorhave not tried
scheduledopen 
5
 
 
No
0053962: The quality of many jest unit tests can be improved, replacing dependencies withs mocks
Wee have identified several cases where a component is very simple (i.e. CashupProcess [1]) but its test requires a lot of setup because it is using the dependencies (both direct and indirect) of the component it is testing, instead of mocking them like they should in unit tests.

[1] https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/blob/c78aa8b8c92612072140ef9d21545e355cdd2b40/web-jspack/org.openbravo.pos2/src/components/Cashup/CashupProcess/CashupProcess.jsx [^]
[2] https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/blob/c78aa8b8c92612072140ef9d21545e355cdd2b40/web-jspack/org.openbravo.pos2/src/components/Cashup/CashupProcess/__test__/CashupProcess.test.jsx [^]
-
Mock dependencies instead of testing the real ones
No tags attached.
Issue History
2023-11-16 13:56AugustoMauchNew Issue
2023-11-16 13:56AugustoMauchAssigned To => AugustoMauch
2023-11-16 13:56AugustoMauchTriggers an Emergency Pack => No
2023-11-16 13:56AugustoMauchStatusnew => scheduled
2023-11-17 13:22hgbotNote Added: 0157285

Notes
(0157285)
hgbot   
2023-11-17 13:22   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/1288 [^]