Skip to content

Commit 6143df5

Browse files
ddiazccrzszirpesfshethjvcua-mobifywei-liu-sf
authored
Merge Develop in to my Theme POC Branch (#2977)
* qa prompt * update * Update usid expiry to match refresh_token expiry * Linting fix * Update changelog * Update packages/commerce-sdk-react/src/auth/index.ts Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Signed-off-by: Jainam Sheth <99490559+shethj@users.noreply.github.com> * Add unit tests for usid expiry * Remove overlapping test cases * initial implementation of create page mcp tool * fix * support open url * fix the import * update README and changelog * Modified create page mcp tool * Added Image Componentsupport to Create page MCP tool * Fixed failing tests * Added new and fixed failing tests and corrected linting issues * Added new test and minor update to system prompt * Updated image component functionality * Updated system prompt * Fixed routes issue * Added tests and comments * Fixed merge conflicts and moved cursor to retail-react-app * skip changelog * Removed unused const * Addressed comments * Update reading expiry time for usid * Removed the cursor rule * Update codeowners file to include ownership for specific features (#2921) * Update codeowners * @W-18895609: 🚀 Shopper Agent Experience v3.0 (#2658) * feat: shopper agent experience v3.0 * fix: enabling streaming (#2911) * Committing for Rules and cleanup * skip changelog * Fixed tests * Lint fix * Addressed comments * Removed the flex hardcode in log message * Fixing Page Tool * Fixing Linter * Updating the Page tool * Fix eslint discoverability in the monorepo (@W-19068681@) (#2927) * Attempt at fixing eslint discoverability in the monorepo * Support other packages * Another approach: centralize the eslint dependencies * Add a script to sync eslint stuffs to the root * Update package lock files * Move timing of script to preinstall * Update package lock files * No need for this documentation * Empty commit * Simplify the script's logic * Reverting changes for Page tool * Added comment back * Reverting the test change * @W-19179026: disable streaming responses (#2964) --------- Signed-off-by: Jainam Sheth <99490559+shethj@users.noreply.github.com> Co-authored-by: Shailesh Zirpe <szirpe+sf@salesforce.com> Co-authored-by: Jainam Sheth <j.sheth@salesforce.com> Co-authored-by: Jainam Sheth <99490559+shethj@users.noreply.github.com> Co-authored-by: vcua-mobify <47404250+vcua-mobify@users.noreply.github.com> Co-authored-by: Shailesh Zirpe <42553862+szirpesf@users.noreply.github.com> Co-authored-by: wei-liu <wei.liu@salesforce.com> Co-authored-by: atekur <atekur@salesforce.com> Co-authored-by: Aditya Tekur <126732792+aditek-sf@users.noreply.github.com> Co-authored-by: Ujwala <59447810+unandyala@users.noreply.github.com> Co-authored-by: Avinash Kasipathy <akasipathy@salesforce.com> Co-authored-by: snilakandan <snilakandan@salesforce.com> Co-authored-by: Vincent Marta <vmarta@salesforce.com> Co-authored-by: snilakandan13 <119348013+snilakandan13@users.noreply.github.com>
1 parent bffc649 commit 6143df5

File tree

43 files changed

+6361
-839
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+6361
-839
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
description: QA Tests for Template Retail React App Test Generation Rules
3+
globs: ["packages/template-retail-react-app/app/components/**/*-underTest.test.{js,jsx}"]
4+
alwaysApply: false
5+
---
6+
# QA Tests for Template Retail React App Test Patterns
7+
8+
## Purpose
9+
This file contains test cases to verify that the `unit-tests-template-retail-react-app.mdc` rule effectively guides the creation of consistent and robust React component tests.
10+
11+
## Test Cases
12+
13+
### Test 1: DrawerMenu Component Test Generation
14+
**Workflow:** Generate → Analyze → Cleanup (NO test execution)
15+
16+
**Steps:**
17+
1. **Generate:** Create new test file `drawer-menu-underTest.test.js` (colocated with existing drawer-menu component at `packages/template-retail-react-app/app/components/drawer-menu/`)
18+
2. **Apply Rules:** Use `@/testing` (located at `.cursor/rules/testing/unit-tests-generic.mdc` and `.cursor/rules/testing/unit-tests-template-retail-react-app.mdc`)
19+
3. **Prompt:** "Write unit test for drawer-menu component"
20+
4. **Analyze:** Perform static code analysis against verification patterns (see below)
21+
5. **Cleanup:** Delete the generated test file after validation
22+
23+
**Important:** DO NOT run the test after creation - skip test execution entirely
24+
25+
**Verify that the newly generated test file follows these patterns:**
26+
1. Test Setup
27+
- Uses `renderWithProviders` from `@salesforce/retail-react-app/app/utils/test-utils`
28+
- Gets user events from return value: `const {user} = renderWithProviders(...)`
29+
- Includes `beforeEach(() => jest.clearAllMocks())`
30+
31+
2. Import Structure
32+
- Does NOT import `userEvent` directly
33+
- Uses existing mock data from `@salesforce/retail-react-app/app/mocks/`
34+
- Imports `screen` from `@testing-library/react`
35+
36+
3. Test Organization
37+
- Uses `describe` block with component name
38+
- Individual `test` or `it` blocks for different scenarios
39+
- Async/await patterns for user interactions
40+
41+
4. API Mocking
42+
- Uses `prependHandlersToServer` or `msw` for API mocking when needed
43+
44+
**Failure Indicators:**
45+
- Direct import of `userEvent` from `@testing-library/user-event`
46+
- Using custom render function instead of `renderWithProviders`
47+
- Creating new mock data instead of using existing mocks
48+
- Missing Commerce SDK context providers
49+
- Not using async/await for user interactions
50+
51+
**Expected Output:**
52+
Provide a clear, structured report based on **static code analysis only** (no test execution):
53+
- ✅ **PASS** or ❌ **FAIL** for each verification point
54+
- Specific line numbers and code snippets for any failures
55+
- Summary: `X/Y patterns followed correctly`
56+
- Overall result: **RULES EFFECTIVE** or **RULES NEED IMPROVEMENT**
57+
58+
**Cleanup:**
59+
- Delete the generated test file `drawer-menu-underTest.test.js` after QA validation is complete

.github/CODEOWNERS

Lines changed: 60 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,64 @@
11
# https://help.github.com/en/enterprise/2.17/user/articles/about-code-owners
22

3-
# These owners will be the default owners for everything in
4-
# the repo. Unless a later match takes precedence,
5-
# @global-owner1 and @global-owner2 will be requested for
6-
# review when someone opens a pull request.
3+
# Global directories
4+
.cursor/ @SalesforceCommerceCloud/mobifyers
5+
.github/ @SalesforceCommerceCloud/mobifyers
6+
e2e/ @SalesforceCommerceCloud/mobifyers
7+
scripts/ @SalesforceCommerceCloud/mobifyers
8+
9+
# Package-specific ownership
10+
packages/commerce-sdk-react/ @SalesforceCommerceCloud/mobifyers
11+
packages/internal-lib-build/ @SalesforceCommerceCloud/mobifyers
12+
packages/pwa-kit-create-app/ @SalesforceCommerceCloud/mobifyers
13+
packages/pwa-kit-dev/ @SalesforceCommerceCloud/mobifyers
14+
packages/pwa-kit-mcp/ @SalesforceCommerceCloud/mobifyers
15+
packages/pwa-kit-react-sdk/ @SalesforceCommerceCloud/mobifyers
16+
packages/pwa-kit-runtime/ @SalesforceCommerceCloud/mobifyers
17+
packages/template-express-minimal/ @SalesforceCommerceCloud/mobifyers
18+
packages/template-mrt-reference-app/ @SalesforceCommerceCloud/mobifyers
19+
packages/template-retail-react-app/ @SalesforceCommerceCloud/mobifyers
20+
packages/template-typescript-minimal/ @SalesforceCommerceCloud/mobifyers
21+
packages/test-commerce-sdk-react/ @SalesforceCommerceCloud/mobifyers
22+
23+
# Root configuration and documentation files
24+
/README.md @SalesforceCommerceCloud/mobifyers
25+
/CODE_OF_CONDUCT.md @SalesforceCommerceCloud/mobifyers
26+
/CONTRIBUTING.md @SalesforceCommerceCloud/mobifyers
27+
/SECURITY.md @SalesforceCommerceCloud/mobifyers
28+
/STATEMENTS.md @SalesforceCommerceCloud/mobifyers
29+
/TERMS_OF_USE.md @SalesforceCommerceCloud/mobifyers
30+
/LICENSE @SalesforceCommerceCloud/mobifyers
31+
/.eslintrc.js @SalesforceCommerceCloud/mobifyers
32+
/.gitattributes @SalesforceCommerceCloud/mobifyers
33+
/.gitignore @SalesforceCommerceCloud/mobifyers
34+
/.prettierignore @SalesforceCommerceCloud/mobifyers
35+
/.prettierrc.yaml @SalesforceCommerceCloud/mobifyers
36+
/lerna.json @SalesforceCommerceCloud/mobifyers
37+
/package.json @SalesforceCommerceCloud/mobifyers
38+
/package-lock.json @SalesforceCommerceCloud/mobifyers
39+
/playwright.config.js @SalesforceCommerceCloud/mobifyers
40+
/.git2gus/ @SalesforceCommerceCloud/mobifyers
41+
42+
# Specific feature file ownership (overrides package-level rules above)
43+
44+
# BOPIS (Buy Online Pick up In Store) feature files - PR #2646
45+
packages/template-retail-react-app/app/components/store-display/ @SalesforceCommerceCloud/cc-spark
46+
packages/template-retail-react-app/app/hooks/use-selected-store.js @SalesforceCommerceCloud/cc-spark
47+
packages/template-retail-react-app/app/hooks/use-pickup-shipment.js @SalesforceCommerceCloud/cc-spark
48+
packages/template-retail-react-app/app/hooks/use-pickup-shipment.test.js @SalesforceCommerceCloud/cc-spark
49+
e2e/tests/desktop/bopis.spec.js @SalesforceCommerceCloud/cc-spark
50+
51+
# Bonus Products feature files - PR #2704
52+
packages/template-retail-react-app/app/components/product-item/bonus-product-quantity.jsx @SalesforceCommerceCloud/cc-sharks
53+
packages/template-retail-react-app/app/components/product-item/bonus-product-quantity.test.jsx @SalesforceCommerceCloud/cc-sharks
54+
packages/template-retail-react-app/app/components/product-item/product-quantity-picker.jsx @SalesforceCommerceCloud/cc-sharks
55+
packages/template-retail-react-app/app/components/product-item/product-quantity-picker.test.jsx @SalesforceCommerceCloud/cc-sharks
56+
packages/template-retail-react-app/app/pages/cart/partials/bonus-products-title.jsx @SalesforceCommerceCloud/cc-sharks
57+
packages/template-retail-react-app/app/pages/cart/partials/bonus-products-title.test.js @SalesforceCommerceCloud/cc-sharks
58+
59+
# Standard Products feature files - PR #2697
60+
packages/template-retail-react-app/app/mocks/standard-product.js @SalesforceCommerceCloud/cc-sharks
61+
packages/template-retail-react-app/app/utils/add-to-cart-utils.js @SalesforceCommerceCloud/cc-sharks
62+
763

8-
* @SalesforceCommerceCloud/mobifyers
964
#ECCN:Open Source

0 commit comments

Comments
 (0)