Openbravo Issue Tracking System - Retail Modules
View Issue Details
0045750Retail ModulesWeb POSpublic2021-01-19 12:492021-01-26 08:00
shuehner 
ranjith_qualiantech_com 
normalminorhave not tried
closedfixed 
5
 
 
No
0045750: do not use global scope in jest tests (fix new cases)
Currently many jest tests are using the global scope, mainly to simulate OB object. This will not be allowed by Babel which will be required by 0044751 to support jest tests with JSX.

This is clone of 44752 bug to cover new cases added since then.

- org.openbravo.retail.sessions
 web-test/model/business-object/cashup/Cashup-processCashManagements-AddHook.test.js

- org.openbravo.retail.giftcards
web-test/model/business-object/cashup/Cashup-processCashManagements-ActionPreparation.test.js
web-test/model/business-object/cashup/Cashup-processCashManagements-AddHook.test.js

run tests in strict mode which does not allow global:

    ReferenceError: OB is not defined

       9 | /* global global */
      10 |
    > 11 | OB = {
         | ^
      12 | App: {
      13 | Class: {}
      14 | },

Use global object instead of global scope.
No tags attached.
related to defect 0044752 closed alostale do not use global scope in jest tests 
related to feature request 0045019 closed Retail run jest tests in strict mode 
Issue History
2021-01-19 12:49shuehnerNew Issue
2021-01-19 12:49shuehnerAssigned To => Retail
2021-01-19 12:49shuehnerTriggers an Emergency Pack => No
2021-01-19 12:49shuehnerIssue generated from0044752
2021-01-19 12:49shuehnerRelationship addedrelated to 0044752
2021-01-19 12:55shuehnerRelationship addedrelated to 0045019
2021-01-19 14:02javietxeIssue Monitored: javietxe
2021-01-25 10:44ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2021-01-25 11:26ranjith_qualiantech_comStatusnew => scheduled
2021-01-26 02:01hgbotNote Added: 0125763
2021-01-26 02:01hgbotNote Added: 0125764
2021-01-26 07:59hgbotNote Added: 0125773
2021-01-26 07:59hgbotNote Added: 0125774
2021-01-26 08:00hgbotResolutionopen => fixed
2021-01-26 08:00hgbotStatusscheduled => closed
2021-01-26 08:00hgbotNote Added: 0125775
2021-01-26 08:00hgbotNote Added: 0125776

Notes
(0125763)
hgbot   
2021-01-26 02:01   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.giftcards/-/merge_requests/36 [^]
(0125764)
hgbot   
2021-01-26 02:01   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.sessions/-/merge_requests/14 [^]
(0125773)
hgbot   
2021-01-26 07:59   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.sessions/-/merge_requests/14 [^]
(0125774)
hgbot   
2021-01-26 07:59   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.sessions [^]
Changeset: bf5d510eee01d5f21e50dc963d02b5923a588879
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 2021-01-25T15:55:04+05:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.sessions/-/commit/bf5d510eee01d5f21e50dc963d02b5923a588879 [^]

Related to ISSUE-45750: Use global scope used in jest test

---
M web-test/model/business-object/cashup/SetupCashup.js
---
(0125775)
hgbot   
2021-01-26 08:00   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.giftcards [^]
Changeset: 181b4bb63c3c81f8fe143a393bccd52f089d9d1b
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 2021-01-25T15:54:59+05:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.giftcards/-/commit/181b4bb63c3c81f8fe143a393bccd52f089d9d1b [^]

Fixed ISSUE-45750: Use global scope used in jest test

---
M web-test/model/business-object/cashup/SetupCashup.js
---
(0125776)
hgbot   
2021-01-26 08:00   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.giftcards/-/merge_requests/36 [^]