@open-mercato/core 0.4.5-develop-2e9903a57a → 0.4.5-develop-eeccf7adf4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/dist/modules/auth/__integration__/TC-AUTH-001.spec.js +0 -9
- package/dist/modules/auth/__integration__/TC-AUTH-001.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-002.spec.js +0 -22
- package/dist/modules/auth/__integration__/TC-AUTH-002.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-003.spec.js +0 -21
- package/dist/modules/auth/__integration__/TC-AUTH-003.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-004.spec.js +0 -15
- package/dist/modules/auth/__integration__/TC-AUTH-004.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-005.spec.js +0 -11
- package/dist/modules/auth/__integration__/TC-AUTH-005.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-006.spec.js +0 -11
- package/dist/modules/auth/__integration__/TC-AUTH-006.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-007.spec.js +0 -14
- package/dist/modules/auth/__integration__/TC-AUTH-007.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-008.spec.js +0 -26
- package/dist/modules/auth/__integration__/TC-AUTH-008.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-009.spec.js +0 -16
- package/dist/modules/auth/__integration__/TC-AUTH-009.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-010.spec.js +0 -32
- package/dist/modules/auth/__integration__/TC-AUTH-010.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-011.spec.js +0 -26
- package/dist/modules/auth/__integration__/TC-AUTH-011.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-012.spec.js +0 -30
- package/dist/modules/auth/__integration__/TC-AUTH-012.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-013.spec.js +0 -41
- package/dist/modules/auth/__integration__/TC-AUTH-013.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-014.spec.js +0 -25
- package/dist/modules/auth/__integration__/TC-AUTH-014.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-015.spec.js +0 -20
- package/dist/modules/auth/__integration__/TC-AUTH-015.spec.js.map +0 -7
- package/dist/modules/auth/__integration__/TC-AUTH-016.spec.js +0 -76
- package/dist/modules/auth/__integration__/TC-AUTH-016.spec.js.map +0 -7
- package/dist/modules/catalog/__integration__/TC-CAT-001.spec.js +0 -20
- package/dist/modules/catalog/__integration__/TC-CAT-001.spec.js.map +0 -7
- package/dist/modules/catalog/__integration__/TC-CAT-002.spec.js +0 -12
- package/dist/modules/catalog/__integration__/TC-CAT-002.spec.js.map +0 -7
- package/dist/modules/catalog/__integration__/TC-CAT-003.spec.js +0 -28
- package/dist/modules/catalog/__integration__/TC-CAT-003.spec.js.map +0 -7
- package/dist/modules/catalog/__integration__/TC-CAT-004.spec.js +0 -33
- package/dist/modules/catalog/__integration__/TC-CAT-004.spec.js.map +0 -7
- package/dist/modules/catalog/__integration__/TC-CAT-005.spec.js +0 -30
- package/dist/modules/catalog/__integration__/TC-CAT-005.spec.js.map +0 -7
- package/dist/modules/catalog/__integration__/TC-CAT-006.spec.js +0 -31
- package/dist/modules/catalog/__integration__/TC-CAT-006.spec.js.map +0 -7
- package/dist/modules/catalog/__integration__/TC-CAT-007.spec.js +0 -31
- package/dist/modules/catalog/__integration__/TC-CAT-007.spec.js.map +0 -7
- package/dist/modules/catalog/__integration__/TC-CAT-008.spec.js +0 -65
- package/dist/modules/catalog/__integration__/TC-CAT-008.spec.js.map +0 -7
- package/dist/modules/catalog/__integration__/TC-CAT-009.spec.js +0 -31
- package/dist/modules/catalog/__integration__/TC-CAT-009.spec.js.map +0 -7
- package/dist/modules/catalog/__integration__/TC-CAT-010.spec.js +0 -28
- package/dist/modules/catalog/__integration__/TC-CAT-010.spec.js.map +0 -7
- package/dist/modules/catalog/__integration__/TC-CAT-011.spec.js +0 -34
- package/dist/modules/catalog/__integration__/TC-CAT-011.spec.js.map +0 -7
- package/dist/modules/catalog/__integration__/TC-CAT-012.spec.js +0 -27
- package/dist/modules/catalog/__integration__/TC-CAT-012.spec.js.map +0 -7
- package/dist/modules/core/__integration__/admin/TC-ADMIN-001.spec.js +0 -44
- package/dist/modules/core/__integration__/admin/TC-ADMIN-001.spec.js.map +0 -7
- package/dist/modules/core/__integration__/admin/TC-ADMIN-002.spec.js +0 -53
- package/dist/modules/core/__integration__/admin/TC-ADMIN-002.spec.js.map +0 -7
- package/dist/modules/core/__integration__/admin/TC-ADMIN-003.spec.js +0 -26
- package/dist/modules/core/__integration__/admin/TC-ADMIN-003.spec.js.map +0 -7
- package/dist/modules/core/__integration__/admin/TC-ADMIN-004.spec.js +0 -47
- package/dist/modules/core/__integration__/admin/TC-ADMIN-004.spec.js.map +0 -7
- package/dist/modules/core/__integration__/admin/TC-ADMIN-005.spec.js +0 -33
- package/dist/modules/core/__integration__/admin/TC-ADMIN-005.spec.js.map +0 -7
- package/dist/modules/core/__integration__/admin/TC-ADMIN-006.spec.js +0 -30
- package/dist/modules/core/__integration__/admin/TC-ADMIN-006.spec.js.map +0 -7
- package/dist/modules/core/__integration__/admin/TC-ADMIN-007.spec.js +0 -36
- package/dist/modules/core/__integration__/admin/TC-ADMIN-007.spec.js.map +0 -7
- package/dist/modules/core/__integration__/admin/TC-ADMIN-008.spec.js +0 -113
- package/dist/modules/core/__integration__/admin/TC-ADMIN-008.spec.js.map +0 -7
- package/dist/modules/core/__integration__/admin/TC-ADMIN-009.spec.js +0 -25
- package/dist/modules/core/__integration__/admin/TC-ADMIN-009.spec.js.map +0 -7
- package/dist/modules/core/__integration__/admin/TC-ADMIN-010.spec.js +0 -35
- package/dist/modules/core/__integration__/admin/TC-ADMIN-010.spec.js.map +0 -7
- package/dist/modules/core/__integration__/helpers/api.js +0 -64
- package/dist/modules/core/__integration__/helpers/api.js.map +0 -7
- package/dist/modules/core/__integration__/helpers/auth.js +0 -98
- package/dist/modules/core/__integration__/helpers/auth.js.map +0 -7
- package/dist/modules/core/__integration__/helpers/authUi.js +0 -31
- package/dist/modules/core/__integration__/helpers/authUi.js.map +0 -7
- package/dist/modules/core/__integration__/helpers/catalogFixtures.js +0 -49
- package/dist/modules/core/__integration__/helpers/catalogFixtures.js.map +0 -7
- package/dist/modules/core/__integration__/helpers/crmFixtures.js +0 -73
- package/dist/modules/core/__integration__/helpers/crmFixtures.js.map +0 -7
- package/dist/modules/core/__integration__/helpers/salesFixtures.js +0 -63
- package/dist/modules/core/__integration__/helpers/salesFixtures.js.map +0 -7
- package/dist/modules/core/__integration__/helpers/salesUi.js +0 -464
- package/dist/modules/core/__integration__/helpers/salesUi.js.map +0 -7
- package/dist/modules/core/__integration__/integration/TC-INT-001.spec.js +0 -26
- package/dist/modules/core/__integration__/integration/TC-INT-001.spec.js.map +0 -7
- package/dist/modules/core/__integration__/integration/TC-INT-002.spec.js +0 -60
- package/dist/modules/core/__integration__/integration/TC-INT-002.spec.js.map +0 -7
- package/dist/modules/core/__integration__/integration/TC-INT-003.spec.js +0 -36
- package/dist/modules/core/__integration__/integration/TC-INT-003.spec.js.map +0 -7
- package/dist/modules/core/__integration__/integration/TC-INT-004.spec.js +0 -74
- package/dist/modules/core/__integration__/integration/TC-INT-004.spec.js.map +0 -7
- package/dist/modules/core/__integration__/integration/TC-INT-005.spec.js +0 -21
- package/dist/modules/core/__integration__/integration/TC-INT-005.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-001.spec.js +0 -32
- package/dist/modules/customers/__integration__/TC-CRM-001.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-002.spec.js +0 -35
- package/dist/modules/customers/__integration__/TC-CRM-002.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-003.spec.js +0 -40
- package/dist/modules/customers/__integration__/TC-CRM-003.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-004.spec.js +0 -40
- package/dist/modules/customers/__integration__/TC-CRM-004.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-005.spec.js +0 -37
- package/dist/modules/customers/__integration__/TC-CRM-005.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-006.spec.js +0 -42
- package/dist/modules/customers/__integration__/TC-CRM-006.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-007.spec.js +0 -44
- package/dist/modules/customers/__integration__/TC-CRM-007.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-008.spec.js +0 -50
- package/dist/modules/customers/__integration__/TC-CRM-008.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-009.spec.js +0 -33
- package/dist/modules/customers/__integration__/TC-CRM-009.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-010.spec.js +0 -39
- package/dist/modules/customers/__integration__/TC-CRM-010.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-011.spec.js +0 -37
- package/dist/modules/customers/__integration__/TC-CRM-011.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-012.spec.js +0 -38
- package/dist/modules/customers/__integration__/TC-CRM-012.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-013.spec.js +0 -43
- package/dist/modules/customers/__integration__/TC-CRM-013.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-014.spec.js +0 -23
- package/dist/modules/customers/__integration__/TC-CRM-014.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-015.spec.js +0 -63
- package/dist/modules/customers/__integration__/TC-CRM-015.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-016.spec.js +0 -46
- package/dist/modules/customers/__integration__/TC-CRM-016.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-017.spec.js +0 -29
- package/dist/modules/customers/__integration__/TC-CRM-017.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-018.spec.js +0 -52
- package/dist/modules/customers/__integration__/TC-CRM-018.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-019.spec.js +0 -37
- package/dist/modules/customers/__integration__/TC-CRM-019.spec.js.map +0 -7
- package/dist/modules/customers/__integration__/TC-CRM-020.spec.js +0 -65
- package/dist/modules/customers/__integration__/TC-CRM-020.spec.js.map +0 -7
- package/dist/modules/progress/__integration__/TC-PROG-001.spec.js +0 -51
- package/dist/modules/progress/__integration__/TC-PROG-001.spec.js.map +0 -7
- package/dist/modules/resources/__integration__/TC-INT-007.spec.js +0 -88
- package/dist/modules/resources/__integration__/TC-INT-007.spec.js.map +0 -7
- package/dist/modules/resources/__integration__/helpers/resourcesFixtures.js +0 -45
- package/dist/modules/resources/__integration__/helpers/resourcesFixtures.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-001.spec.js +0 -20
- package/dist/modules/sales/__integration__/TC-SALES-001.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-002.spec.js +0 -31
- package/dist/modules/sales/__integration__/TC-SALES-002.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-003.spec.js +0 -13
- package/dist/modules/sales/__integration__/TC-SALES-003.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-004.spec.js +0 -14
- package/dist/modules/sales/__integration__/TC-SALES-004.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-005.spec.js +0 -15
- package/dist/modules/sales/__integration__/TC-SALES-005.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-006.spec.js +0 -20
- package/dist/modules/sales/__integration__/TC-SALES-006.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-007.spec.js +0 -19
- package/dist/modules/sales/__integration__/TC-SALES-007.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-008.spec.js +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-008.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-009.spec.js +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-009.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-010.spec.js +0 -16
- package/dist/modules/sales/__integration__/TC-SALES-010.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-011.spec.js +0 -20
- package/dist/modules/sales/__integration__/TC-SALES-011.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-012.spec.js +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-012.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-013.spec.js +0 -66
- package/dist/modules/sales/__integration__/TC-SALES-013.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-014.spec.js +0 -13
- package/dist/modules/sales/__integration__/TC-SALES-014.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-015.spec.js +0 -13
- package/dist/modules/sales/__integration__/TC-SALES-015.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-016.spec.js +0 -13
- package/dist/modules/sales/__integration__/TC-SALES-016.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-017.spec.js +0 -44
- package/dist/modules/sales/__integration__/TC-SALES-017.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-018.spec.js +0 -18
- package/dist/modules/sales/__integration__/TC-SALES-018.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-019.spec.js +0 -16
- package/dist/modules/sales/__integration__/TC-SALES-019.spec.js.map +0 -7
- package/dist/modules/sales/__integration__/TC-SALES-020.spec.js +0 -75
- package/dist/modules/sales/__integration__/TC-SALES-020.spec.js.map +0 -7
- package/dist/modules/staff/__integration__/TC-INT-006.spec.js +0 -64
- package/dist/modules/staff/__integration__/TC-INT-006.spec.js.map +0 -7
- package/dist/modules/translations/__integration__/TC-TRANS-001.spec.js +0 -48
- package/dist/modules/translations/__integration__/TC-TRANS-001.spec.js.map +0 -7
- package/dist/modules/translations/__integration__/TC-TRANS-002.spec.js +0 -94
- package/dist/modules/translations/__integration__/TC-TRANS-002.spec.js.map +0 -7
- package/dist/modules/translations/__integration__/TC-TRANS-003.spec.js +0 -61
- package/dist/modules/translations/__integration__/TC-TRANS-003.spec.js.map +0 -7
- package/dist/modules/translations/__integration__/TC-TRANS-004.spec.js +0 -52
- package/dist/modules/translations/__integration__/TC-TRANS-004.spec.js.map +0 -7
- package/dist/modules/translations/__integration__/TC-TRANS-005.spec.js +0 -106
- package/dist/modules/translations/__integration__/TC-TRANS-005.spec.js.map +0 -7
- package/dist/modules/translations/__integration__/TC-TRANS-006.spec.js +0 -94
- package/dist/modules/translations/__integration__/TC-TRANS-006.spec.js.map +0 -7
- package/dist/modules/translations/__integration__/TC-TRANS-007.spec.js +0 -62
- package/dist/modules/translations/__integration__/TC-TRANS-007.spec.js.map +0 -7
- package/dist/modules/translations/__integration__/TC-TRANS-008.spec.js +0 -168
- package/dist/modules/translations/__integration__/TC-TRANS-008.spec.js.map +0 -7
- package/dist/modules/translations/__integration__/helpers/translationFixtures.js +0 -63
- package/dist/modules/translations/__integration__/helpers/translationFixtures.js.map +0 -7
- package/dist/modules/workflows/__integration__/TC-WF-001.spec.js +0 -73
- package/dist/modules/workflows/__integration__/TC-WF-001.spec.js.map +0 -7
- package/src/__tests__/module-decoupling.test.ts +0 -356
- package/src/modules/api_keys/api/__tests__/keys.route.test.ts +0 -244
- package/src/modules/attachments/api/__tests__/attachments.api.test.ts +0 -240
- package/src/modules/attachments/components/__tests__/AttachmentContentPreview.test.tsx +0 -45
- package/src/modules/attachments/data/__tests__/entities-ocr.test.ts +0 -15
- package/src/modules/attachments/lib/__tests__/ocr-config.test.ts +0 -27
- package/src/modules/attachments/lib/__tests__/textExtraction.test.ts +0 -64
- package/src/modules/audit_logs/api/__tests__/access.route.test.ts +0 -118
- package/src/modules/audit_logs/api/__tests__/redo.route.test.ts +0 -131
- package/src/modules/audit_logs/api/__tests__/undo.route.test.ts +0 -103
- package/src/modules/audit_logs/services/__tests__/actionLogService.test.ts +0 -26
- package/src/modules/auth/__integration__/TC-AUTH-001.spec.ts +0 -13
- package/src/modules/auth/__integration__/TC-AUTH-002.spec.ts +0 -30
- package/src/modules/auth/__integration__/TC-AUTH-003.spec.ts +0 -28
- package/src/modules/auth/__integration__/TC-AUTH-004.spec.ts +0 -21
- package/src/modules/auth/__integration__/TC-AUTH-005.spec.ts +0 -17
- package/src/modules/auth/__integration__/TC-AUTH-006.spec.ts +0 -17
- package/src/modules/auth/__integration__/TC-AUTH-007.spec.ts +0 -19
- package/src/modules/auth/__integration__/TC-AUTH-008.spec.ts +0 -31
- package/src/modules/auth/__integration__/TC-AUTH-009.spec.ts +0 -22
- package/src/modules/auth/__integration__/TC-AUTH-010.spec.ts +0 -39
- package/src/modules/auth/__integration__/TC-AUTH-011.spec.ts +0 -35
- package/src/modules/auth/__integration__/TC-AUTH-012.spec.ts +0 -36
- package/src/modules/auth/__integration__/TC-AUTH-013.spec.ts +0 -48
- package/src/modules/auth/__integration__/TC-AUTH-014.spec.ts +0 -31
- package/src/modules/auth/__integration__/TC-AUTH-015.spec.ts +0 -28
- package/src/modules/auth/__integration__/TC-AUTH-016.spec.ts +0 -109
- package/src/modules/auth/__tests__/cli-rotate-encryption.test.ts +0 -97
- package/src/modules/auth/__tests__/cli-setup-acl.test.ts +0 -148
- package/src/modules/auth/api/__tests__/feature-check.test.ts +0 -65
- package/src/modules/auth/api/__tests__/login.test.ts +0 -47
- package/src/modules/auth/commands/__tests__/roles.custom-fields.test.ts +0 -126
- package/src/modules/auth/commands/__tests__/users.custom-fields.test.ts +0 -147
- package/src/modules/auth/lib/__tests__/rateLimitCheck.test.ts +0 -224
- package/src/modules/auth/services/__tests__/authService.test.ts +0 -32
- package/src/modules/auth/services/__tests__/rbacService.test.ts +0 -814
- package/src/modules/business_rules/api/__tests__/execute.route.test.ts +0 -311
- package/src/modules/business_rules/api/__tests__/logs-detail.route.test.ts +0 -181
- package/src/modules/business_rules/api/__tests__/logs.route.test.ts +0 -261
- package/src/modules/business_rules/api/__tests__/rules-detail.route.test.ts +0 -115
- package/src/modules/business_rules/api/__tests__/rules.route.test.ts +0 -746
- package/src/modules/business_rules/api/__tests__/sets-detail.route.test.ts +0 -169
- package/src/modules/business_rules/api/__tests__/sets-members.route.test.ts +0 -367
- package/src/modules/business_rules/api/__tests__/sets.route.test.ts +0 -361
- package/src/modules/business_rules/api/__tests__/test-helpers.ts +0 -42
- package/src/modules/business_rules/components/utils/__tests__/formHelpers.test.ts +0 -69
- package/src/modules/business_rules/data/__tests__/validators.test.ts +0 -637
- package/src/modules/business_rules/lib/__tests__/action-executor.test.ts +0 -728
- package/src/modules/business_rules/lib/__tests__/expression-evaluator.test.ts +0 -592
- package/src/modules/business_rules/lib/__tests__/rule-engine.test.ts +0 -805
- package/src/modules/business_rules/lib/__tests__/rule-evaluator.test.ts +0 -436
- package/src/modules/catalog/__integration__/TC-CAT-001.spec.ts +0 -32
- package/src/modules/catalog/__integration__/TC-CAT-002.spec.ts +0 -19
- package/src/modules/catalog/__integration__/TC-CAT-003.spec.ts +0 -39
- package/src/modules/catalog/__integration__/TC-CAT-004.spec.ts +0 -41
- package/src/modules/catalog/__integration__/TC-CAT-005.spec.ts +0 -37
- package/src/modules/catalog/__integration__/TC-CAT-006.spec.ts +0 -40
- package/src/modules/catalog/__integration__/TC-CAT-007.spec.ts +0 -37
- package/src/modules/catalog/__integration__/TC-CAT-008.spec.ts +0 -76
- package/src/modules/catalog/__integration__/TC-CAT-009.spec.ts +0 -39
- package/src/modules/catalog/__integration__/TC-CAT-010.spec.ts +0 -36
- package/src/modules/catalog/__integration__/TC-CAT-011.spec.ts +0 -44
- package/src/modules/catalog/__integration__/TC-CAT-012.spec.ts +0 -35
- package/src/modules/catalog/api/__tests__/offers.route.test.ts +0 -161
- package/src/modules/catalog/api/__tests__/prices.route.test.ts +0 -39
- package/src/modules/catalog/api/__tests__/products.route.test.ts +0 -91
- package/src/modules/catalog/api/__tests__/utils.test.ts +0 -36
- package/src/modules/catalog/api/__tests__/variants.route.test.ts +0 -44
- package/src/modules/catalog/backend/catalog/products/__tests__/ProductsDataTable.test.tsx +0 -172
- package/src/modules/catalog/commands/__tests__/products.delete.test.ts +0 -146
- package/src/modules/catalog/commands/__tests__/products.update.test.ts +0 -142
- package/src/modules/catalog/commands/__tests__/registration.test.ts +0 -54
- package/src/modules/catalog/commands/__tests__/shared.test.ts +0 -129
- package/src/modules/catalog/components/__tests__/catalogComponentsRender.test.tsx +0 -373
- package/src/modules/catalog/components/products/__tests__/ProductImageCell.test.tsx +0 -51
- package/src/modules/catalog/components/products/__tests__/productForm.test.ts +0 -32
- package/src/modules/catalog/lib/__tests__/pricing.test.ts +0 -150
- package/src/modules/catalog/services/__tests__/catalogPricingService.test.ts +0 -21
- package/src/modules/configs/components/__tests__/CachePanel.test.tsx +0 -134
- package/src/modules/configs/components/__tests__/SystemStatusPanel.test.tsx +0 -93
- package/src/modules/configs/lib/__tests__/system-status.test.ts +0 -55
- package/src/modules/configs/lib/__tests__/upgrade-actions.test.ts +0 -135
- package/src/modules/core/__integration__/admin/TC-ADMIN-001.spec.ts +0 -70
- package/src/modules/core/__integration__/admin/TC-ADMIN-002.spec.ts +0 -83
- package/src/modules/core/__integration__/admin/TC-ADMIN-003.spec.ts +0 -50
- package/src/modules/core/__integration__/admin/TC-ADMIN-004.spec.ts +0 -77
- package/src/modules/core/__integration__/admin/TC-ADMIN-005.spec.ts +0 -49
- package/src/modules/core/__integration__/admin/TC-ADMIN-006.spec.ts +0 -59
- package/src/modules/core/__integration__/admin/TC-ADMIN-007.spec.ts +0 -68
- package/src/modules/core/__integration__/admin/TC-ADMIN-008.spec.ts +0 -127
- package/src/modules/core/__integration__/admin/TC-ADMIN-009.spec.ts +0 -48
- package/src/modules/core/__integration__/admin/TC-ADMIN-010.spec.ts +0 -57
- package/src/modules/core/__integration__/helpers/api.ts +0 -84
- package/src/modules/core/__integration__/helpers/auth.ts +0 -110
- package/src/modules/core/__integration__/helpers/authUi.ts +0 -33
- package/src/modules/core/__integration__/helpers/catalogFixtures.ts +0 -73
- package/src/modules/core/__integration__/helpers/crmFixtures.ts +0 -101
- package/src/modules/core/__integration__/helpers/salesFixtures.ts +0 -89
- package/src/modules/core/__integration__/helpers/salesUi.ts +0 -528
- package/src/modules/core/__integration__/integration/TC-INT-001.spec.ts +0 -34
- package/src/modules/core/__integration__/integration/TC-INT-002.spec.ts +0 -74
- package/src/modules/core/__integration__/integration/TC-INT-003.spec.ts +0 -43
- package/src/modules/core/__integration__/integration/TC-INT-004.spec.ts +0 -82
- package/src/modules/core/__integration__/integration/TC-INT-005.spec.ts +0 -29
- package/src/modules/currencies/backend/exchange-rates/__tests__/formatDateTimeLocal.test.ts +0 -78
- package/src/modules/currencies/data/__tests__/validators.test.ts +0 -100
- package/src/modules/currencies/services/__tests__/exchangeRateService.test.ts +0 -666
- package/src/modules/currencies/services/__tests__/rateFetchingService.basic.test.ts +0 -398
- package/src/modules/currencies/services/__tests__/rateFetchingService.errors.test.ts +0 -296
- package/src/modules/currencies/services/__tests__/rateFetchingService.providers.test.ts +0 -350
- package/src/modules/currencies/services/__tests__/rateFetchingService.setup.ts +0 -188
- package/src/modules/customers/__integration__/TC-CRM-001.spec.ts +0 -42
- package/src/modules/customers/__integration__/TC-CRM-002.spec.ts +0 -47
- package/src/modules/customers/__integration__/TC-CRM-003.spec.ts +0 -55
- package/src/modules/customers/__integration__/TC-CRM-004.spec.ts +0 -57
- package/src/modules/customers/__integration__/TC-CRM-005.spec.ts +0 -50
- package/src/modules/customers/__integration__/TC-CRM-006.spec.ts +0 -60
- package/src/modules/customers/__integration__/TC-CRM-007.spec.ts +0 -57
- package/src/modules/customers/__integration__/TC-CRM-008.spec.ts +0 -62
- package/src/modules/customers/__integration__/TC-CRM-009.spec.ts +0 -46
- package/src/modules/customers/__integration__/TC-CRM-010.spec.ts +0 -49
- package/src/modules/customers/__integration__/TC-CRM-011.spec.ts +0 -47
- package/src/modules/customers/__integration__/TC-CRM-012.spec.ts +0 -49
- package/src/modules/customers/__integration__/TC-CRM-013.spec.ts +0 -61
- package/src/modules/customers/__integration__/TC-CRM-014.spec.ts +0 -31
- package/src/modules/customers/__integration__/TC-CRM-015.spec.ts +0 -89
- package/src/modules/customers/__integration__/TC-CRM-016.spec.ts +0 -55
- package/src/modules/customers/__integration__/TC-CRM-017.spec.ts +0 -37
- package/src/modules/customers/__integration__/TC-CRM-018.spec.ts +0 -62
- package/src/modules/customers/__integration__/TC-CRM-019.spec.ts +0 -44
- package/src/modules/customers/__integration__/TC-CRM-020.spec.ts +0 -73
- package/src/modules/customers/api/__tests__/utils.test.ts +0 -61
- package/src/modules/customers/api/dashboard/widgets/new-deals/__tests__/route.test.ts +0 -54
- package/src/modules/customers/commands/__tests__/shared.test.ts +0 -263
- package/src/modules/customers/commands/__tests__/undo.custom-fields.test.ts +0 -1184
- package/src/modules/customers/components/detail/__tests__/ActivityForm.validation.test.ts +0 -37
- package/src/modules/customers/components/detail/__tests__/DealForm.validation.test.ts +0 -45
- package/src/modules/customers/components/detail/__tests__/InlineEditors.test.tsx +0 -166
- package/src/modules/customers/components/detail/__tests__/TaskForm.submit.test.ts +0 -21
- package/src/modules/customers/components/detail/hooks/__tests__/useCustomerDictionary.test.ts +0 -97
- package/src/modules/customers/lib/__tests__/customFieldRouting.test.ts +0 -107
- package/src/modules/customers/utils/__tests__/addressFormat.test.ts +0 -105
- package/src/modules/customers/utils/__tests__/phoneDuplicates.test.ts +0 -98
- package/src/modules/dashboards/__tests__/widgets.test.ts +0 -70
- package/src/modules/dashboards/lib/__tests__/aggregations.test.ts +0 -328
- package/src/modules/dashboards/lib/__tests__/formatters.test.ts +0 -128
- package/src/modules/directory/backend/directory/organizations/__tests__/create-submit.test.ts +0 -46
- package/src/modules/directory/backend/directory/organizations/__tests__/edit-submit.test.ts +0 -49
- package/src/modules/directory/components/__tests__/OrganizationSelect.test.tsx +0 -71
- package/src/modules/directory/components/__tests__/TenantSelect.test.tsx +0 -75
- package/src/modules/entities/__tests__/cli-decrypt-database.test.ts +0 -534
- package/src/modules/entities/__tests__/cli-rotate-encryption.test.ts +0 -123
- package/src/modules/entities/api/__tests__/encryption.api.test.ts +0 -57
- package/src/modules/entities/api/__tests__/records.get.custom-entity.test.ts +0 -43
- package/src/modules/entities/api/__tests__/records.validation.test.ts +0 -53
- package/src/modules/entities/backend/entities/user/__tests__/create-entity-submit.test.ts +0 -47
- package/src/modules/entities/backend/entities/user/__tests__/records-submit.test.ts +0 -104
- package/src/modules/feature_toggles/commands/__tests__/global.test.ts +0 -325
- package/src/modules/feature_toggles/commands/__tests__/overrides.test.ts +0 -186
- package/src/modules/feature_toggles/lib/__tests__/feature-flag-check.test.ts +0 -365
- package/src/modules/feature_toggles/lib/__tests__/queries.test.ts +0 -130
- package/src/modules/inbox_ops/api/emails/[id]/reprocess/__tests__/route.test.ts +0 -194
- package/src/modules/inbox_ops/api/proposals/[id]/__tests__/route.test.ts +0 -124
- package/src/modules/inbox_ops/api/proposals/[id]/accept-all/__tests__/route.test.ts +0 -154
- package/src/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/__tests__/route.test.ts +0 -200
- package/src/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/accept/__tests__/route.test.ts +0 -261
- package/src/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/reject/__tests__/route.test.ts +0 -201
- package/src/modules/inbox_ops/api/proposals/[id]/reject/__tests__/route.test.ts +0 -123
- package/src/modules/inbox_ops/api/proposals/[id]/replies/[replyId]/send/__tests__/route.test.ts +0 -232
- package/src/modules/inbox_ops/api/proposals/[id]/translate/__tests__/route.test.ts +0 -173
- package/src/modules/inbox_ops/api/proposals/__tests__/route.test.ts +0 -185
- package/src/modules/inbox_ops/api/webhook/__tests__/inbound.test.ts +0 -317
- package/src/modules/inbox_ops/data/__tests__/validators.test.ts +0 -463
- package/src/modules/inbox_ops/lib/__tests__/catalogLookup.test.ts +0 -143
- package/src/modules/inbox_ops/lib/__tests__/contactMatcher.test.ts +0 -158
- package/src/modules/inbox_ops/lib/__tests__/emailParser.test.ts +0 -191
- package/src/modules/inbox_ops/lib/__tests__/executionEngine.test.ts +0 -1419
- package/src/modules/inbox_ops/lib/__tests__/extractionPrompt.test.ts +0 -151
- package/src/modules/inbox_ops/lib/__tests__/priceValidator.test.ts +0 -259
- package/src/modules/inbox_ops/lib/__tests__/translationProvider.test.ts +0 -99
- package/src/modules/inbox_ops/subscribers/__tests__/extractionWorker.test.ts +0 -803
- package/src/modules/notifications/__tests__/deliver-notification.test.ts +0 -285
- package/src/modules/notifications/__tests__/deliveryStrategies.test.ts +0 -19
- package/src/modules/notifications/__tests__/notificationService.test.ts +0 -248
- package/src/modules/planner/__tests__/availabilityMerge.test.ts +0 -99
- package/src/modules/planner/__tests__/plannerAvailabilityService.test.ts +0 -89
- package/src/modules/planner/data/__tests__/validators.test.ts +0 -78
- package/src/modules/progress/__integration__/TC-PROG-001.spec.ts +0 -67
- package/src/modules/progress/__tests__/progressService.test.ts +0 -377
- package/src/modules/query_index/__tests__/hybrid-engine.test.ts +0 -365
- package/src/modules/query_index/__tests__/indexer.test.ts +0 -175
- package/src/modules/resources/__integration__/TC-INT-007.spec.ts +0 -110
- package/src/modules/resources/__integration__/helpers/resourcesFixtures.ts +0 -50
- package/src/modules/resources/data/__tests__/validators.test.ts +0 -65
- package/src/modules/sales/__integration__/TC-SALES-001.spec.ts +0 -26
- package/src/modules/sales/__integration__/TC-SALES-002.spec.ts +0 -38
- package/src/modules/sales/__integration__/TC-SALES-003.spec.ts +0 -18
- package/src/modules/sales/__integration__/TC-SALES-004.spec.ts +0 -19
- package/src/modules/sales/__integration__/TC-SALES-005.spec.ts +0 -21
- package/src/modules/sales/__integration__/TC-SALES-006.spec.ts +0 -26
- package/src/modules/sales/__integration__/TC-SALES-007.spec.ts +0 -23
- package/src/modules/sales/__integration__/TC-SALES-008.spec.ts +0 -11
- package/src/modules/sales/__integration__/TC-SALES-009.spec.ts +0 -12
- package/src/modules/sales/__integration__/TC-SALES-010.spec.ts +0 -20
- package/src/modules/sales/__integration__/TC-SALES-011.spec.ts +0 -26
- package/src/modules/sales/__integration__/TC-SALES-012.spec.ts +0 -12
- package/src/modules/sales/__integration__/TC-SALES-013.spec.ts +0 -73
- package/src/modules/sales/__integration__/TC-SALES-014.spec.ts +0 -17
- package/src/modules/sales/__integration__/TC-SALES-015.spec.ts +0 -17
- package/src/modules/sales/__integration__/TC-SALES-016.spec.ts +0 -17
- package/src/modules/sales/__integration__/TC-SALES-017.spec.ts +0 -60
- package/src/modules/sales/__integration__/TC-SALES-018.spec.ts +0 -25
- package/src/modules/sales/__integration__/TC-SALES-019.spec.ts +0 -22
- package/src/modules/sales/__integration__/TC-SALES-020.spec.ts +0 -107
- package/src/modules/sales/api/__tests__/channels.route.test.ts +0 -50
- package/src/modules/sales/api/__tests__/document-history.test.ts +0 -146
- package/src/modules/sales/api/__tests__/documents.factory.test.ts +0 -98
- package/src/modules/sales/api/__tests__/documents.routes.test.ts +0 -149
- package/src/modules/sales/api/__tests__/quotes.acceptance.test.ts +0 -209
- package/src/modules/sales/api/__tests__/timeline.test.tsx +0 -165
- package/src/modules/sales/api/dashboard/widgets/new-orders/__tests__/route.test.ts +0 -112
- package/src/modules/sales/api/dashboard/widgets/new-quotes/__tests__/route.test.ts +0 -116
- package/src/modules/sales/commands/__tests__/documents.cache.test.ts +0 -126
- package/src/modules/sales/commands/__tests__/documents.undo.test.ts +0 -170
- package/src/modules/sales/commands/__tests__/registration.test.ts +0 -141
- package/src/modules/sales/components/__tests__/salesComponentsRender.test.tsx +0 -456
- package/src/modules/sales/lib/__tests__/calculations.test.ts +0 -210
- package/src/modules/sales/services/__tests__/salesCalculationService.test.ts +0 -181
- package/src/modules/sales/services/__tests__/taxCalculationService.test.ts +0 -79
- package/src/modules/sales/widgets/dashboard/new-orders/__tests__/config.test.ts +0 -47
- package/src/modules/sales/widgets/dashboard/new-quotes/__tests__/config.test.ts +0 -47
- package/src/modules/staff/__integration__/TC-INT-006.spec.ts +0 -71
- package/src/modules/staff/data/__tests__/validators.test.ts +0 -60
- package/src/modules/translations/__integration__/TC-TRANS-001.spec.ts +0 -57
- package/src/modules/translations/__integration__/TC-TRANS-002.spec.ts +0 -114
- package/src/modules/translations/__integration__/TC-TRANS-003.spec.ts +0 -71
- package/src/modules/translations/__integration__/TC-TRANS-004.spec.ts +0 -66
- package/src/modules/translations/__integration__/TC-TRANS-005.spec.ts +0 -135
- package/src/modules/translations/__integration__/TC-TRANS-006.spec.ts +0 -113
- package/src/modules/translations/__integration__/TC-TRANS-007.spec.ts +0 -80
- package/src/modules/translations/__integration__/TC-TRANS-008.spec.ts +0 -209
- package/src/modules/translations/__integration__/helpers/translationFixtures.ts +0 -95
- package/src/modules/translations/api/__tests__/locales.test.ts +0 -67
- package/src/modules/translations/data/__tests__/validators.test.ts +0 -143
- package/src/modules/translations/lib/__tests__/extract-record-id.test.ts +0 -75
- package/src/modules/translations/lib/__tests__/helpers.test.ts +0 -215
- package/src/modules/translations/lib/__tests__/locale.test.ts +0 -115
- package/src/modules/translations/lib/__tests__/resolve-field-list.test.ts +0 -176
- package/src/modules/translations/lib/__tests__/translatable-fields.test.ts +0 -79
- package/src/modules/translations/widgets/__tests__/injection-table.test.ts +0 -83
- package/src/modules/workflows/__integration__/TC-WF-001.spec.ts +0 -114
- package/src/modules/workflows/api/__tests__/definitions.route.test.ts +0 -762
- package/src/modules/workflows/api/__tests__/instances.route.test.ts +0 -869
- package/src/modules/workflows/data/__tests__/validators.test.ts +0 -707
- package/src/modules/workflows/lib/__tests__/activity-executor.test.ts +0 -1230
- package/src/modules/workflows/lib/__tests__/call-api.test.ts +0 -421
- package/src/modules/workflows/lib/__tests__/compensation.test.ts +0 -713
- package/src/modules/workflows/lib/__tests__/event-logger.test.ts +0 -615
- package/src/modules/workflows/lib/__tests__/integration.test.ts +0 -693
- package/src/modules/workflows/lib/__tests__/signals.test.ts +0 -566
- package/src/modules/workflows/lib/__tests__/step-handler.test.ts +0 -670
- package/src/modules/workflows/lib/__tests__/sub-workflow.test.ts +0 -934
- package/src/modules/workflows/lib/__tests__/transition-handler.test.ts +0 -925
- package/src/modules/workflows/lib/__tests__/workflow-executor.test.ts +0 -684
|
@@ -1,528 +0,0 @@
|
|
|
1
|
-
import { expect, type Locator, type Page } from '@playwright/test';
|
|
2
|
-
import { apiRequest, getAuthToken } from './api';
|
|
3
|
-
|
|
4
|
-
type DocumentKind = 'quote' | 'order';
|
|
5
|
-
|
|
6
|
-
type CreateDocumentOptions = {
|
|
7
|
-
kind: DocumentKind;
|
|
8
|
-
customerQuery?: string;
|
|
9
|
-
channelQuery?: string;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
type AddLineOptions = {
|
|
13
|
-
name: string;
|
|
14
|
-
quantity: number;
|
|
15
|
-
unitPriceGross: number;
|
|
16
|
-
taxClassName?: string;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
type AddAdjustmentOptions = {
|
|
20
|
-
label: string;
|
|
21
|
-
kindLabel?: string;
|
|
22
|
-
netAmount: number;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const TEST_WAIT_TIMEOUT_MS = 10_000;
|
|
26
|
-
|
|
27
|
-
function escapeRegExp(value: string): string {
|
|
28
|
-
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function parseCurrencyAmount(value: string): number {
|
|
32
|
-
const normalized = value.replace(/,/g, '');
|
|
33
|
-
const matches = normalized.match(/-?\$[0-9]+(?:\.[0-9]{2})?/g);
|
|
34
|
-
const lastMatch = matches?.[matches.length - 1];
|
|
35
|
-
if (!lastMatch) {
|
|
36
|
-
throw new Error(`Could not parse currency from: ${value}`);
|
|
37
|
-
}
|
|
38
|
-
return Number.parseFloat(lastMatch.replace('$', ''));
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function readId(payload: unknown, keys: string[]): string | null {
|
|
42
|
-
if (!payload || typeof payload !== 'object') return null;
|
|
43
|
-
const map = payload as Record<string, unknown>;
|
|
44
|
-
for (const key of keys) {
|
|
45
|
-
const value = map[key];
|
|
46
|
-
if (typeof value === 'string' && value.length > 0) return value;
|
|
47
|
-
}
|
|
48
|
-
for (const value of Object.values(map)) {
|
|
49
|
-
if (value && typeof value === 'object' && !Array.isArray(value)) {
|
|
50
|
-
const nested = readId(value, keys);
|
|
51
|
-
if (nested) return nested;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
async function ensureSalesDocumentFixtures(
|
|
58
|
-
page: Page,
|
|
59
|
-
options: CreateDocumentOptions,
|
|
60
|
-
): Promise<{ customerQuery: string; channelQuery: string }> {
|
|
61
|
-
let customerQuery = options.customerQuery;
|
|
62
|
-
let channelQuery = options.channelQuery;
|
|
63
|
-
|
|
64
|
-
if (customerQuery && channelQuery) {
|
|
65
|
-
return { customerQuery, channelQuery };
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const token = await getAuthToken(page.request, 'admin').catch(() => null);
|
|
69
|
-
if (!token) {
|
|
70
|
-
if (!customerQuery) {
|
|
71
|
-
customerQuery = `QA Sales Customer ${Date.now()}`;
|
|
72
|
-
await page.goto('/backend/customers/companies/create');
|
|
73
|
-
await page.locator('form').getByRole('textbox').first().fill(customerQuery);
|
|
74
|
-
await page.getByPlaceholder('https://example.com').fill('https://example.com');
|
|
75
|
-
await page.locator('form').getByRole('button', { name: /Create Company/i }).click();
|
|
76
|
-
await expect(page).toHaveURL(/\/backend\/customers\/companies\/[0-9a-f-]{36}$/i);
|
|
77
|
-
}
|
|
78
|
-
if (!channelQuery) {
|
|
79
|
-
const timestamp = Date.now();
|
|
80
|
-
channelQuery = `QA Sales Channel ${timestamp}`;
|
|
81
|
-
const channelCode = `qa-sales-channel-${timestamp}`;
|
|
82
|
-
await page.goto('/backend/sales/channels');
|
|
83
|
-
await page.getByRole('link', { name: /Add channel/i }).click();
|
|
84
|
-
const createForm = page.locator('form').first();
|
|
85
|
-
await createForm.getByRole('textbox').nth(0).fill(channelQuery);
|
|
86
|
-
await createForm.getByRole('textbox').nth(1).fill(channelCode);
|
|
87
|
-
await page.getByRole('button', { name: /Create channel|Create/i }).last().click();
|
|
88
|
-
await expect(page).toHaveURL(/\/backend\/sales\/channels$/i);
|
|
89
|
-
}
|
|
90
|
-
return {
|
|
91
|
-
customerQuery,
|
|
92
|
-
channelQuery,
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
if (!customerQuery) {
|
|
97
|
-
const companyName = `QA Sales Customer ${Date.now()}`;
|
|
98
|
-
const companyResponse = await apiRequest(page.request, 'POST', '/api/customers/companies', {
|
|
99
|
-
token,
|
|
100
|
-
data: { displayName: companyName },
|
|
101
|
-
}).catch(() => null);
|
|
102
|
-
if (companyResponse && companyResponse.ok()) {
|
|
103
|
-
const companyBody = (await companyResponse.json().catch(() => null)) as unknown;
|
|
104
|
-
const companyId = readId(companyBody, ['id', 'entityId', 'companyId']);
|
|
105
|
-
if (companyId) {
|
|
106
|
-
await apiRequest(page.request, 'POST', '/api/customers/addresses', {
|
|
107
|
-
token,
|
|
108
|
-
data: {
|
|
109
|
-
entityId: companyId,
|
|
110
|
-
name: 'Primary',
|
|
111
|
-
purpose: 'Shipping',
|
|
112
|
-
addressLine1: '100 QA Street',
|
|
113
|
-
city: 'Austin',
|
|
114
|
-
postalCode: '78701',
|
|
115
|
-
country: 'US',
|
|
116
|
-
isPrimary: true,
|
|
117
|
-
},
|
|
118
|
-
}).catch(() => {});
|
|
119
|
-
customerQuery = companyName;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
if (!customerQuery) {
|
|
123
|
-
customerQuery = 'Copperleaf';
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
if (!channelQuery) {
|
|
128
|
-
const timestamp = Date.now();
|
|
129
|
-
const channelName = `QA Sales Channel ${timestamp}`;
|
|
130
|
-
const channelCode = `qa-sales-channel-${timestamp}`;
|
|
131
|
-
const channelResponse = await apiRequest(page.request, 'POST', '/api/sales/channels', {
|
|
132
|
-
token,
|
|
133
|
-
data: {
|
|
134
|
-
name: channelName,
|
|
135
|
-
code: channelCode,
|
|
136
|
-
},
|
|
137
|
-
}).catch(() => null);
|
|
138
|
-
if (channelResponse && channelResponse.ok()) {
|
|
139
|
-
channelQuery = channelName;
|
|
140
|
-
} else {
|
|
141
|
-
channelQuery = 'online';
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
return {
|
|
146
|
-
customerQuery: customerQuery ?? 'Copperleaf',
|
|
147
|
-
channelQuery: channelQuery ?? 'online',
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
async function selectFirstAddressIfAvailable(page: Page): Promise<void> {
|
|
152
|
-
const addressSelect = page
|
|
153
|
-
.locator('select')
|
|
154
|
-
.filter({ has: page.locator('option', { hasText: 'Select address' }) })
|
|
155
|
-
.first();
|
|
156
|
-
if ((await addressSelect.count()) === 0) return;
|
|
157
|
-
if (!(await addressSelect.isEnabled())) return;
|
|
158
|
-
|
|
159
|
-
const nextValue = await addressSelect.evaluate((element) => {
|
|
160
|
-
const select = element as HTMLSelectElement;
|
|
161
|
-
return select.options.length > 1 ? select.options[1]?.value ?? null : null;
|
|
162
|
-
});
|
|
163
|
-
if (nextValue) {
|
|
164
|
-
await addressSelect.selectOption(nextValue);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
export async function createSalesDocument(page: Page, options: CreateDocumentOptions): Promise<string> {
|
|
169
|
-
const fixtureContext = await ensureSalesDocumentFixtures(page, options);
|
|
170
|
-
const customerQuery = fixtureContext.customerQuery;
|
|
171
|
-
const channelQuery = fixtureContext.channelQuery;
|
|
172
|
-
|
|
173
|
-
await page.goto(`/backend/sales/documents/create?kind=${options.kind}`);
|
|
174
|
-
|
|
175
|
-
await page.waitForLoadState('networkidle');
|
|
176
|
-
await page.waitForTimeout(500);
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
await page.getByText('Document type').click();
|
|
180
|
-
await page.getByRole('textbox', { name: /Search customers/i }).fill(customerQuery);
|
|
181
|
-
await page.waitForTimeout(500);
|
|
182
|
-
|
|
183
|
-
const selectButton = page
|
|
184
|
-
.locator('[role="button"]')
|
|
185
|
-
.filter({ hasText: customerQuery })
|
|
186
|
-
.getByRole('button', { name: 'Select' });
|
|
187
|
-
|
|
188
|
-
await selectButton.scrollIntoViewIfNeeded();
|
|
189
|
-
await selectButton.click();
|
|
190
|
-
// Channel selection
|
|
191
|
-
await page.getByRole('textbox', { name: /Select a channel/i }).fill(channelQuery);
|
|
192
|
-
try {
|
|
193
|
-
await page
|
|
194
|
-
.getByRole('button', { name: /Select$/i })
|
|
195
|
-
.filter({ hasText: new RegExp(escapeRegExp(channelQuery), 'i') })
|
|
196
|
-
.first()
|
|
197
|
-
.click({ timeout: 2000 });
|
|
198
|
-
} catch {
|
|
199
|
-
await page.getByRole('button', { name: /Select$/i }).first().click();
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
await selectFirstAddressIfAvailable(page);
|
|
203
|
-
|
|
204
|
-
await page.getByRole('button', { name: /^Create$/i }).first().click();
|
|
205
|
-
await expect(page).toHaveURL(new RegExp(`/backend/sales/documents/[0-9a-f-]{36}\\?kind=${options.kind}$`, 'i'));
|
|
206
|
-
|
|
207
|
-
const match = page.url().match(/\/backend\/sales\/documents\/([0-9a-f-]{36})\?kind=/i);
|
|
208
|
-
if (!match) {
|
|
209
|
-
throw new Error(`Could not resolve document id from URL: ${page.url()}`);
|
|
210
|
-
}
|
|
211
|
-
return match[1];
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
function lineDialog(page: Page): Locator {
|
|
215
|
-
return page.getByRole('dialog', { name: /Add line|Edit line/i });
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
async function selectFirstOption(container: Locator, rowNamePattern: RegExp): Promise<void> {
|
|
219
|
-
const optionRow = container.getByRole('button', { name: rowNamePattern }).first();
|
|
220
|
-
await optionRow.waitFor({ state: 'visible', timeout: 4_000 }).catch(() => {});
|
|
221
|
-
if ((await optionRow.count()) === 0) return;
|
|
222
|
-
|
|
223
|
-
const selectButton = optionRow.getByRole('button', { name: /^Select$/i }).first();
|
|
224
|
-
if ((await selectButton.count()) > 0) {
|
|
225
|
-
await selectButton.click();
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
await optionRow.click();
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
async function selectShipmentMethod(dialog: Locator): Promise<void> {
|
|
232
|
-
const shippingMethodInput = dialog.getByPlaceholder(/Select method/i).first();
|
|
233
|
-
if ((await shippingMethodInput.count()) === 0) return;
|
|
234
|
-
await shippingMethodInput.click().catch(() => {});
|
|
235
|
-
await shippingMethodInput.press('ControlOrMeta+a').catch(() => {});
|
|
236
|
-
await shippingMethodInput.type('Standard', { delay: 20 }).catch(() => {});
|
|
237
|
-
await shippingMethodInput.press('Enter').catch(() => {});
|
|
238
|
-
await selectFirstOption(dialog, /standard ground|express air|select/i);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
async function selectShipmentStatus(dialog: Locator): Promise<void> {
|
|
242
|
-
const statusInput = dialog.getByPlaceholder(/Select shipment status/i).first();
|
|
243
|
-
if ((await statusInput.count()) > 0) {
|
|
244
|
-
await statusInput.click().catch(() => {});
|
|
245
|
-
await statusInput.press('ControlOrMeta+a').catch(() => {});
|
|
246
|
-
await statusInput.type('Shipped', { delay: 20 }).catch(() => {});
|
|
247
|
-
await statusInput.press('Enter').catch(() => {});
|
|
248
|
-
}
|
|
249
|
-
await selectFirstOption(dialog, /shipped.*select|in transit.*select|packed.*select|select/i);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
async function selectShipmentAddress(dialog: Locator): Promise<void> {
|
|
253
|
-
const addressInput = dialog.getByPlaceholder(/Select address/i).first();
|
|
254
|
-
if ((await addressInput.count()) === 0) return;
|
|
255
|
-
const currentValue = await addressInput.inputValue().catch(() => '');
|
|
256
|
-
if (currentValue.trim().length > 0) return;
|
|
257
|
-
if ((await addressInput.count()) > 0) {
|
|
258
|
-
await addressInput.click().catch(() => {});
|
|
259
|
-
await addressInput.press('Enter').catch(() => {});
|
|
260
|
-
}
|
|
261
|
-
await selectFirstOption(dialog, /shipping address|select/i);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
async function fillShipmentQuantity(dialog: Locator): Promise<void> {
|
|
265
|
-
const quantityInputs = dialog.getByRole('spinbutton');
|
|
266
|
-
const count = await quantityInputs.count();
|
|
267
|
-
for (let index = 0; index < count; index += 1) {
|
|
268
|
-
const input = quantityInputs.nth(index);
|
|
269
|
-
const isVisible = await input.isVisible().catch(() => false);
|
|
270
|
-
const isEnabled = await input.isEnabled().catch(() => false);
|
|
271
|
-
if (!isVisible || !isEnabled) continue;
|
|
272
|
-
await input.click().catch(() => {});
|
|
273
|
-
await input.press('ControlOrMeta+a').catch(() => {});
|
|
274
|
-
await input.type('1', { delay: 20 }).catch(() => {});
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
async function selectShipmentRequiredOptions(dialog: Locator): Promise<void> {
|
|
279
|
-
for (let attempt = 0; attempt < 6; attempt += 1) {
|
|
280
|
-
const pendingSelect = dialog.getByRole('button', { name: /^Select$/i }).first();
|
|
281
|
-
if ((await pendingSelect.count()) === 0) return;
|
|
282
|
-
if (!(await pendingSelect.isVisible().catch(() => false))) return;
|
|
283
|
-
await pendingSelect.click().catch(() => {});
|
|
284
|
-
await dialog.getByText(/Searching…|Searching\.\.\./i).first().waitFor({ state: 'hidden', timeout: 3_000 }).catch(() => {});
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
async function fillShipmentDates(dialog: Locator): Promise<void> {
|
|
289
|
-
const now = new Date();
|
|
290
|
-
const day = String(now.getDate()).padStart(2, '0');
|
|
291
|
-
const month = String(now.getMonth() + 1).padStart(2, '0');
|
|
292
|
-
const year = String(now.getFullYear());
|
|
293
|
-
const shippedDateValue = `${day}/${month}/${year}`;
|
|
294
|
-
|
|
295
|
-
const shippedDateInput = dialog.getByLabel(/Shipped date/i).first();
|
|
296
|
-
if ((await shippedDateInput.count()) > 0) {
|
|
297
|
-
const currentValue = await shippedDateInput.inputValue().catch(() => '');
|
|
298
|
-
if (currentValue.trim().length === 0) {
|
|
299
|
-
await shippedDateInput.fill(shippedDateValue).catch(() => {});
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
async function fillShipmentNumber(dialog: Locator, shipmentNumber: string): Promise<void> {
|
|
305
|
-
const shipmentNumberInput = dialog.getByRole('textbox').first();
|
|
306
|
-
if ((await shipmentNumberInput.count()) === 0) return;
|
|
307
|
-
await shipmentNumberInput.click().catch(() => {});
|
|
308
|
-
await shipmentNumberInput.press('ControlOrMeta+a').catch(() => {});
|
|
309
|
-
await shipmentNumberInput.type(shipmentNumber, { delay: 20 }).catch(() => {});
|
|
310
|
-
await shipmentNumberInput.press('Tab').catch(() => {});
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
export async function addCustomLine(page: Page, options: AddLineOptions): Promise<void> {
|
|
314
|
-
await page.getByRole('button', { name: /^Items$/i }).click();
|
|
315
|
-
await page.getByRole('button', { name: /Add item/i }).first().click();
|
|
316
|
-
|
|
317
|
-
const dialog = lineDialog(page);
|
|
318
|
-
await expect(dialog).toBeVisible();
|
|
319
|
-
|
|
320
|
-
await dialog.getByRole('button', { name: /Custom line/i }).click();
|
|
321
|
-
await dialog.getByRole('textbox', { name: /Optional line name/i }).fill(options.name);
|
|
322
|
-
await dialog.getByRole('textbox', { name: '0.00' }).fill(String(options.unitPriceGross));
|
|
323
|
-
await dialog.getByRole('textbox', { name: '1' }).fill(String(options.quantity));
|
|
324
|
-
|
|
325
|
-
if (options.taxClassName) {
|
|
326
|
-
const taxClassSelect = dialog
|
|
327
|
-
.locator('select')
|
|
328
|
-
.filter({ has: dialog.locator('option', { hasText: /No tax class selected/i }) })
|
|
329
|
-
.first();
|
|
330
|
-
if ((await taxClassSelect.count()) > 0) {
|
|
331
|
-
await taxClassSelect.selectOption({ label: options.taxClassName });
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
await dialog.getByRole('button', { name: /Add item/i }).click();
|
|
336
|
-
await expect(page.getByRole('row', { name: new RegExp(escapeRegExp(options.name), 'i') })).toBeVisible();
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
export async function updateLineQuantity(page: Page, lineName: string, quantity: number): Promise<void> {
|
|
340
|
-
await page.getByRole('button', { name: /^Items$/i }).click();
|
|
341
|
-
const row = page.getByRole('row', { name: new RegExp(escapeRegExp(lineName), 'i') });
|
|
342
|
-
await row.click();
|
|
343
|
-
|
|
344
|
-
const dialog = page.getByRole('dialog', { name: /Edit line/i });
|
|
345
|
-
await expect(dialog).toBeVisible();
|
|
346
|
-
await dialog.getByRole('textbox', { name: '1' }).fill(String(quantity));
|
|
347
|
-
await dialog.getByRole('button', { name: /Save changes/i }).click();
|
|
348
|
-
|
|
349
|
-
await expect(page.getByRole('row', { name: new RegExp(`${escapeRegExp(lineName)}.*\\b${quantity}\\b`, 'i') })).toBeVisible();
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
export async function deleteLine(page: Page, lineName: string): Promise<void> {
|
|
353
|
-
await page.getByRole('button', { name: /^Items$/i }).click();
|
|
354
|
-
const row = page.getByRole('row', { name: new RegExp(escapeRegExp(lineName), 'i') });
|
|
355
|
-
await expect(row).toBeVisible();
|
|
356
|
-
await row.locator('button').last().click();
|
|
357
|
-
|
|
358
|
-
const confirmDialog = page.getByRole('alertdialog');
|
|
359
|
-
if (await confirmDialog.isVisible().catch(() => false)) {
|
|
360
|
-
await confirmDialog.getByRole('button', { name: /^Delete$/i }).first().click();
|
|
361
|
-
await expect(confirmDialog).toBeHidden();
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
await expect(page.getByRole('row', { name: new RegExp(escapeRegExp(lineName), 'i') })).toHaveCount(0);
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
export async function addAdjustment(page: Page, options: AddAdjustmentOptions): Promise<void> {
|
|
368
|
-
await page.getByRole('button', { name: /^Adjustments$/i }).click();
|
|
369
|
-
await page.getByRole('button', { name: /Add adjustment/i }).first().click();
|
|
370
|
-
|
|
371
|
-
const dialog = page.getByRole('dialog', { name: /Add adjustment/i });
|
|
372
|
-
await expect(dialog).toBeVisible();
|
|
373
|
-
const fillAdjustmentForm = async (): Promise<void> => {
|
|
374
|
-
const labelInput = dialog.getByRole('textbox', { name: /e\.g\. Shipping fee/i }).first();
|
|
375
|
-
if ((await labelInput.count()) > 0) {
|
|
376
|
-
await labelInput.fill(options.label);
|
|
377
|
-
} else {
|
|
378
|
-
await dialog.locator('input[placeholder="e.g. Shipping fee"]').first().fill(options.label);
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
const kindSelect = dialog.getByRole('combobox').first();
|
|
382
|
-
if ((await kindSelect.count()) > 0) {
|
|
383
|
-
await kindSelect.selectOption({ label: options.kindLabel ?? 'Surcharge' }).catch(async () => {
|
|
384
|
-
await kindSelect.selectOption({ label: 'Custom' });
|
|
385
|
-
});
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
const enabledAmountInputs = dialog.locator('input[placeholder="0.00"]:not([disabled])');
|
|
389
|
-
if ((await enabledAmountInputs.count()) > 0) {
|
|
390
|
-
await enabledAmountInputs.first().fill(String(options.netAmount));
|
|
391
|
-
}
|
|
392
|
-
if ((await enabledAmountInputs.count()) > 1) {
|
|
393
|
-
await enabledAmountInputs.nth(1).fill(String(options.netAmount));
|
|
394
|
-
}
|
|
395
|
-
};
|
|
396
|
-
|
|
397
|
-
let saved = false;
|
|
398
|
-
for (let attempt = 0; attempt < 3; attempt += 1) {
|
|
399
|
-
await fillAdjustmentForm();
|
|
400
|
-
await dialog.getByRole('button', { name: /Add adjustment/i }).click();
|
|
401
|
-
saved = await dialog.waitFor({ state: 'hidden', timeout: 3_000 }).then(() => true).catch(() => false);
|
|
402
|
-
if (saved) break;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
await expect(dialog).toBeHidden({ timeout: 8_000 });
|
|
406
|
-
await page.getByRole('button', { name: /^Adjustments$/i }).click();
|
|
407
|
-
await expect(page.getByText(new RegExp(escapeRegExp(options.label), 'i')).first()).toBeVisible({ timeout: 8_000 });
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
export async function addPayment(page: Page, amount: number): Promise<{ amountLabel: string; added: boolean }> {
|
|
411
|
-
await page.getByRole('button', { name: /^Payments$/i }).click();
|
|
412
|
-
const amountLabel = amount.toFixed(2);
|
|
413
|
-
const amountInputValue = String(Math.max(1, Math.round(amount)));
|
|
414
|
-
await page.getByRole('button', { name: /Add payment/i }).click();
|
|
415
|
-
|
|
416
|
-
const dialog = page.getByRole('dialog', { name: /Add payment/i });
|
|
417
|
-
await expect(dialog).toBeVisible();
|
|
418
|
-
const setAmount = async (): Promise<void> => {
|
|
419
|
-
const amountInput = dialog.getByRole('spinbutton').first();
|
|
420
|
-
await amountInput.click();
|
|
421
|
-
await amountInput.press('ControlOrMeta+a');
|
|
422
|
-
await amountInput.type(amountInputValue, { delay: 20 });
|
|
423
|
-
await amountInput.press('Tab');
|
|
424
|
-
};
|
|
425
|
-
await setAmount();
|
|
426
|
-
|
|
427
|
-
await dialog.getByText(/Loading payment methods/i).waitFor({ state: 'hidden', timeout: TEST_WAIT_TIMEOUT_MS }).catch(() => {});
|
|
428
|
-
const paymentMethodOption = dialog.getByRole('button', { name: /bank transfer|credit card|cash on delivery/i }).first();
|
|
429
|
-
if ((await paymentMethodOption.count()) > 0) {
|
|
430
|
-
const methodSelectButton = paymentMethodOption.getByRole('button', { name: /^Select$/i }).first();
|
|
431
|
-
if ((await methodSelectButton.count()) > 0) {
|
|
432
|
-
await methodSelectButton.click();
|
|
433
|
-
} else {
|
|
434
|
-
await paymentMethodOption.click();
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
const paymentStatusOption = dialog.getByRole('button', { name: /pending.*select|captured.*select/i }).first();
|
|
438
|
-
if ((await paymentStatusOption.count()) > 0) {
|
|
439
|
-
const statusSelectButton = paymentStatusOption.getByRole('button', { name: /^Select$/i }).first();
|
|
440
|
-
if ((await statusSelectButton.count()) > 0) {
|
|
441
|
-
await statusSelectButton.click();
|
|
442
|
-
} else {
|
|
443
|
-
await paymentStatusOption.click();
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
const saveButton = dialog.getByRole('button', { name: /Save/i }).first();
|
|
447
|
-
const operationMessage = page.getByText(/Last operation:\s*Create payment/i).first();
|
|
448
|
-
for (let attempt = 0; attempt < 3; attempt += 1) {
|
|
449
|
-
await setAmount();
|
|
450
|
-
await saveButton.click();
|
|
451
|
-
const closed = await dialog.waitFor({ state: 'hidden', timeout: 4_000 }).then(() => true).catch(() => false);
|
|
452
|
-
if (closed) {
|
|
453
|
-
break;
|
|
454
|
-
}
|
|
455
|
-
const operationVisible = await operationMessage.isVisible().catch(() => false);
|
|
456
|
-
if (operationVisible) {
|
|
457
|
-
break;
|
|
458
|
-
}
|
|
459
|
-
const hasRequiredFieldError = await dialog.getByText(/This field is required/i).isVisible().catch(() => false);
|
|
460
|
-
if (!hasRequiredFieldError) {
|
|
461
|
-
await page.waitForTimeout(200);
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
if (await dialog.isVisible().catch(() => false)) {
|
|
465
|
-
await dialog.press('Escape').catch(() => {});
|
|
466
|
-
await dialog.waitFor({ state: 'hidden', timeout: 4_000 }).catch(() => {});
|
|
467
|
-
}
|
|
468
|
-
await operationMessage.waitFor({ state: 'visible', timeout: TEST_WAIT_TIMEOUT_MS }).catch(() => {});
|
|
469
|
-
const added = await operationMessage.isVisible().catch(() => false);
|
|
470
|
-
return { amountLabel, added };
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
export async function addShipment(page: Page): Promise<{ trackingNumber: string; shipmentNumber: string; added: boolean }> {
|
|
474
|
-
await page.getByRole('button', { name: /^Shipments$/i }).click();
|
|
475
|
-
const trackingNumber = `SHIP-${Date.now()}`;
|
|
476
|
-
const shipmentNumber = String(Date.now());
|
|
477
|
-
await page.getByRole('button', { name: /Add shipment/i }).click();
|
|
478
|
-
|
|
479
|
-
const dialog = page.getByRole('dialog', { name: /Add shipment/i });
|
|
480
|
-
await expect(dialog).toBeVisible();
|
|
481
|
-
await fillShipmentNumber(dialog, shipmentNumber);
|
|
482
|
-
const trackingInput = dialog.getByLabel(/Tracking numbers/i).first();
|
|
483
|
-
if ((await trackingInput.count()) > 0) {
|
|
484
|
-
await trackingInput.fill(trackingNumber);
|
|
485
|
-
} else {
|
|
486
|
-
await dialog.getByPlaceholder(/One per line or comma separated/i).first().fill(trackingNumber);
|
|
487
|
-
}
|
|
488
|
-
await selectShipmentMethod(dialog);
|
|
489
|
-
await selectShipmentStatus(dialog);
|
|
490
|
-
await selectShipmentAddress(dialog);
|
|
491
|
-
await fillShipmentQuantity(dialog);
|
|
492
|
-
await fillShipmentDates(dialog);
|
|
493
|
-
await selectShipmentRequiredOptions(dialog);
|
|
494
|
-
await fillShipmentNumber(dialog, shipmentNumber);
|
|
495
|
-
|
|
496
|
-
await dialog.getByText(/Searching…|Searching\.\.\./i).first().waitFor({ state: 'hidden', timeout: TEST_WAIT_TIMEOUT_MS }).catch(() => {});
|
|
497
|
-
const saveButton = dialog.getByRole('button', { name: /^Save\b/i }).first();
|
|
498
|
-
const canClickSave = (await saveButton.count()) > 0 && (await saveButton.isVisible().catch(() => false));
|
|
499
|
-
if (canClickSave) {
|
|
500
|
-
await saveButton.click({ timeout: TEST_WAIT_TIMEOUT_MS }).catch(() => {});
|
|
501
|
-
} else {
|
|
502
|
-
await dialog.press('ControlOrMeta+Enter').catch(() => {});
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
const closed = await dialog
|
|
506
|
-
.waitFor({ state: 'hidden', timeout: TEST_WAIT_TIMEOUT_MS })
|
|
507
|
-
.then(() => true)
|
|
508
|
-
.catch(() => false);
|
|
509
|
-
|
|
510
|
-
if (!closed) {
|
|
511
|
-
return { trackingNumber, shipmentNumber, added: false };
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
await page.getByRole('button', { name: /^Shipments$/i }).click();
|
|
515
|
-
const shipmentLabel = page.getByText(new RegExp(`Shipment\\s+${escapeRegExp(shipmentNumber)}`, 'i')).first();
|
|
516
|
-
const added = await shipmentLabel
|
|
517
|
-
.waitFor({ state: 'visible', timeout: TEST_WAIT_TIMEOUT_MS })
|
|
518
|
-
.then(() => true)
|
|
519
|
-
.catch(() => false);
|
|
520
|
-
return { trackingNumber, shipmentNumber, added };
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
export async function readGrandTotalGross(page: Page): Promise<number> {
|
|
524
|
-
const row = page.getByRole('row', { name: /Grand total \(gross\)/i }).first();
|
|
525
|
-
await expect(row).toBeVisible();
|
|
526
|
-
const text = (await row.innerText()).trim();
|
|
527
|
-
return parseCurrencyAmount(text);
|
|
528
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { expect, test } from '@playwright/test';
|
|
2
|
-
import { login } from '@open-mercato/core/modules/core/__integration__/helpers/auth';
|
|
3
|
-
import { addCustomLine, addPayment, addShipment, createSalesDocument } from '@open-mercato/core/modules/core/__integration__/helpers/salesUi';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* TC-INT-001: Quote to Order to Invoice to Payment
|
|
7
|
-
* Source: .ai/qa/scenarios/TC-INT-001-quote-to-order-to-invoice.md
|
|
8
|
-
*/
|
|
9
|
-
test.describe('TC-INT-001: Quote to Order to Invoice to Payment', () => {
|
|
10
|
-
test('should progress quote to order and record fulfillment/payment actions', async ({ page }) => {
|
|
11
|
-
await login(page, 'admin');
|
|
12
|
-
await createSalesDocument(page, { kind: 'quote' });
|
|
13
|
-
await addCustomLine(page, { name: `QA INT-001 ${Date.now()}`, quantity: 1, unitPriceGross: 50 });
|
|
14
|
-
|
|
15
|
-
await page.getByRole('button', { name: /^Actions$/i }).click();
|
|
16
|
-
const convertToOrder = page.getByRole('menuitem', { name: /Convert to order/i });
|
|
17
|
-
if ((await convertToOrder.count()) === 0) {
|
|
18
|
-
test.skip(true, 'Quote to order conversion is unavailable in this environment.');
|
|
19
|
-
}
|
|
20
|
-
await convertToOrder.first().click();
|
|
21
|
-
|
|
22
|
-
const confirm = page.getByRole('button', { name: /Convert|Create order|Continue/i }).last();
|
|
23
|
-
if (await confirm.isVisible().catch(() => false)) await confirm.click();
|
|
24
|
-
await expect(page).toHaveURL(/kind=order$/i);
|
|
25
|
-
|
|
26
|
-
const shipmentResult = await addShipment(page);
|
|
27
|
-
await addPayment(page, 50);
|
|
28
|
-
|
|
29
|
-
await page.getByRole('button', { name: /^Shipments$/i }).click();
|
|
30
|
-
await expect(page.getByText(new RegExp(`Shipment\\s+${shipmentResult.shipmentNumber}`, 'i')).first()).toBeVisible();
|
|
31
|
-
await page.getByRole('button', { name: /^Payments$/i }).click();
|
|
32
|
-
await expect(page.getByText(/\$50\.00|50\.00/).first()).toBeVisible();
|
|
33
|
-
});
|
|
34
|
-
});
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { expect, test } from '@playwright/test';
|
|
2
|
-
import { login } from '@open-mercato/core/modules/core/__integration__/helpers/auth';
|
|
3
|
-
import { getAuthToken } from '@open-mercato/core/modules/core/__integration__/helpers/api';
|
|
4
|
-
import { deleteEntityIfExists } from '@open-mercato/core/modules/core/__integration__/helpers/crmFixtures';
|
|
5
|
-
import { createSalesDocument } from '@open-mercato/core/modules/core/__integration__/helpers/salesUi';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* TC-INT-002: Customer to Deal to Quote to Order Flow
|
|
9
|
-
* Source: .ai/qa/scenarios/TC-INT-002-customer-deal-order-flow.md
|
|
10
|
-
*/
|
|
11
|
-
test.describe('TC-INT-002: Customer to Deal to Quote to Order Flow', () => {
|
|
12
|
-
test('should create CRM records and open a sales order flow', async ({ page, request }) => {
|
|
13
|
-
const stamp = Date.now();
|
|
14
|
-
const companyName = `QA INT-002 Co ${stamp}`;
|
|
15
|
-
const personFirst = `QA${stamp}`;
|
|
16
|
-
const personLast = 'IntFlow';
|
|
17
|
-
const dealTitle = `QA INT-002 Deal ${stamp}`;
|
|
18
|
-
let token: string | null = null;
|
|
19
|
-
let companyId: string | null = null;
|
|
20
|
-
let personId: string | null = null;
|
|
21
|
-
let dealId: string | null = null;
|
|
22
|
-
|
|
23
|
-
try {
|
|
24
|
-
token = await getAuthToken(request);
|
|
25
|
-
await login(page, 'admin');
|
|
26
|
-
|
|
27
|
-
await page.goto('/backend/customers/companies/create');
|
|
28
|
-
await page.locator('form').getByRole('textbox').first().fill(companyName);
|
|
29
|
-
await page.getByPlaceholder('https://example.com').fill('https://example.com');
|
|
30
|
-
await page.locator('form').getByRole('button', { name: /Create Company/i }).click();
|
|
31
|
-
await expect(page).toHaveURL(/\/backend\/customers\/companies\/[0-9a-f-]{36}$/i);
|
|
32
|
-
companyId = page.url().match(/\/backend\/customers\/companies\/([0-9a-f-]{36})$/i)?.[1] ?? null;
|
|
33
|
-
|
|
34
|
-
await page.goto('/backend/customers/people/create');
|
|
35
|
-
await page.locator('form').getByRole('textbox').first().fill(personFirst);
|
|
36
|
-
await page.locator('form').getByRole('textbox').nth(1).fill(personLast);
|
|
37
|
-
await page.getByPlaceholder('name@example.com').fill(`qa-int-002-${stamp}@example.com`);
|
|
38
|
-
await page.getByPlaceholder('+00 000 000 000').fill('+1 555 010 0020');
|
|
39
|
-
await page
|
|
40
|
-
.locator('select')
|
|
41
|
-
.filter({ has: page.locator('option', { hasText: companyName }) })
|
|
42
|
-
.first()
|
|
43
|
-
.selectOption({ label: companyName });
|
|
44
|
-
await page.getByRole('button', { name: 'Create Person' }).first().click();
|
|
45
|
-
await expect(page).toHaveURL(/\/backend\/customers\/people\/[0-9a-f-]{36}$/i);
|
|
46
|
-
personId = page.url().match(/\/backend\/customers\/people\/([0-9a-f-]{36})$/i)?.[1] ?? null;
|
|
47
|
-
|
|
48
|
-
await page.goto('/backend/customers/deals/create');
|
|
49
|
-
await page.locator('form').getByRole('textbox').first().fill(dealTitle);
|
|
50
|
-
await page.locator('select').filter({ has: page.locator('option', { hasText: 'Open' }) }).first().selectOption({ label: 'Open' });
|
|
51
|
-
await page.locator('select').filter({ has: page.locator('option', { hasText: 'Opportunity' }) }).first().selectOption({ label: 'Opportunity' });
|
|
52
|
-
await page.getByRole('spinbutton').first().fill('10000');
|
|
53
|
-
await page.locator('select').filter({ has: page.locator('option', { hasText: /USD/i }) }).first().selectOption({ index: 1 });
|
|
54
|
-
await page.getByRole('spinbutton').nth(1).fill('50');
|
|
55
|
-
await page.locator('input[type="date"]').fill('2026-12-31');
|
|
56
|
-
await page.getByRole('textbox', { name: /Search companies/i }).fill(companyName);
|
|
57
|
-
await page.getByRole('button', { name: companyName, exact: true }).click();
|
|
58
|
-
await page.getByRole('button', { name: 'Create deal' }).first().click();
|
|
59
|
-
await expect(page).toHaveURL(/\/backend\/customers\/deals$/i);
|
|
60
|
-
|
|
61
|
-
await page.getByRole('textbox', { name: /Search deals/i }).fill(dealTitle);
|
|
62
|
-
await page.getByRole('row', { name: new RegExp(dealTitle) }).click();
|
|
63
|
-
await expect(page).toHaveURL(/\/backend\/customers\/deals\/[0-9a-f-]{36}$/i);
|
|
64
|
-
dealId = page.url().match(/\/backend\/customers\/deals\/([0-9a-f-]{36})$/i)?.[1] ?? null;
|
|
65
|
-
|
|
66
|
-
await createSalesDocument(page, { kind: 'order', customerQuery: companyName });
|
|
67
|
-
await expect(page).toHaveURL(/kind=order$/i);
|
|
68
|
-
} finally {
|
|
69
|
-
await deleteEntityIfExists(request, token, '/api/customers/deals', dealId);
|
|
70
|
-
await deleteEntityIfExists(request, token, '/api/customers/people', personId);
|
|
71
|
-
await deleteEntityIfExists(request, token, '/api/customers/companies', companyId);
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
});
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { expect, test } from '@playwright/test';
|
|
2
|
-
import { login } from '@open-mercato/core/modules/core/__integration__/helpers/auth';
|
|
3
|
-
import { getAuthToken } from '@open-mercato/core/modules/core/__integration__/helpers/api';
|
|
4
|
-
import { deleteCatalogProductIfExists } from '@open-mercato/core/modules/core/__integration__/helpers/catalogFixtures';
|
|
5
|
-
import { createSalesDocument } from '@open-mercato/core/modules/core/__integration__/helpers/salesUi';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* TC-INT-003: Product Creation to Sales Channel to Order
|
|
9
|
-
* Source: .ai/qa/scenarios/TC-INT-003-product-to-sales-flow.md
|
|
10
|
-
*/
|
|
11
|
-
test.describe('TC-INT-003: Product Creation to Sales Channel to Order', () => {
|
|
12
|
-
test('should create a product and proceed with order creation flow', async ({ page, request }) => {
|
|
13
|
-
const stamp = Date.now();
|
|
14
|
-
const productName = `QA INT-003 Product ${stamp}`;
|
|
15
|
-
const sku = `QA-INT-003-${stamp}`;
|
|
16
|
-
let token: string | null = null;
|
|
17
|
-
let productId: string | null = null;
|
|
18
|
-
|
|
19
|
-
try {
|
|
20
|
-
token = await getAuthToken(request);
|
|
21
|
-
await login(page, 'admin');
|
|
22
|
-
await page.goto('/backend/catalog/products/create');
|
|
23
|
-
await page.getByRole('textbox', { name: 'e.g., Summer sneaker' }).fill(productName);
|
|
24
|
-
await page.getByRole('textbox', { name: 'Describe the product...' }).fill('INT-003 product created for integration coverage.');
|
|
25
|
-
await page.getByRole('button', { name: 'Variants' }).click();
|
|
26
|
-
await page.getByRole('textbox', { name: 'e.g., SKU-001' }).fill(sku);
|
|
27
|
-
await page.getByRole('button', { name: 'Create product' }).last().click();
|
|
28
|
-
await expect(page).toHaveURL(/\/backend\/catalog\/products$/);
|
|
29
|
-
|
|
30
|
-
await page.getByRole('textbox', { name: 'Search' }).fill(productName);
|
|
31
|
-
const productRow = page.getByRole('row', { name: new RegExp(productName) }).first();
|
|
32
|
-
await expect(productRow).toBeVisible();
|
|
33
|
-
await productRow.click();
|
|
34
|
-
await expect(page).toHaveURL(/\/backend\/catalog\/products\/[0-9a-f-]{36}$/i);
|
|
35
|
-
productId = page.url().match(/\/backend\/catalog\/products\/([0-9a-f-]{36})$/i)?.[1] ?? null;
|
|
36
|
-
|
|
37
|
-
await createSalesDocument(page, { kind: 'order' });
|
|
38
|
-
await expect(page).toHaveURL(/kind=order$/i);
|
|
39
|
-
} finally {
|
|
40
|
-
await deleteCatalogProductIfExists(request, token, productId);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
});
|