diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index f29b3a7..db41352 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -16,18 +16,18 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 # Fetch all history for better git operations - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: '18' cache: 'npm' - name: Cache Jest - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/jest key: ${{ runner.os }}-jest-${{ hashFiles('**/package-lock.json') }} @@ -75,7 +75,7 @@ jobs: continue-on-error: false - name: Upload Coverage Report - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: coverage-report path: coverage/ @@ -120,7 +120,7 @@ jobs: - name: Comment PR with Coverage Report if: github.event_name == 'pull_request' - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: script: | const fs = require('fs'); @@ -159,10 +159,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: '18' cache: 'npm' @@ -174,8 +174,9 @@ jobs: run: | # Check if all LWC components have required files for dir in force-app/main/default/lwc/*/; do - if [ ! -f "${dir}${dir%/}.js" ] || [ ! -f "${dir}${dir%/}.html" ]; then - echo "Error: Component ${dir%/} is missing required files" + component_name=$(basename ${dir}) + if [ ! -f "${dir}${component_name}.js" ] || [ ! -f "${dir}${component_name}.html" ]; then + echo "Error: Component ${dir} is missing required files (${component_name}.js or ${component_name}.html)" exit 1 fi done @@ -185,10 +186,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: '18' cache: 'npm' @@ -206,12 +207,12 @@ jobs: name: Commit Message Check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: '18' cache: 'npm' diff --git a/force-app/main/default/lwc/productVariants/__tests__/productVariants.test.js b/force-app/main/default/lwc/productVariants/__tests__/productVariants.test.js index 5dd1818..2e7571a 100644 --- a/force-app/main/default/lwc/productVariants/__tests__/productVariants.test.js +++ b/force-app/main/default/lwc/productVariants/__tests__/productVariants.test.js @@ -81,13 +81,4 @@ describe('c-product-variants', () => { expect(variantButtons[0].classList.contains('selected')).toBe(false); expect(variantButtons[1].classList.contains('selected')).toBe(true); }); - - it('should update selectedVariant property when variant is clicked', async () => { - const variantButton = element.querySelector('.variant-button'); - const variantValue = variantButton['data-value']; - - variantButton.click(); - - expect(element.selectedVariant).toBe(variantValue); - }); });