Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
Expand Down Expand Up @@ -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/
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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'
Expand All @@ -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
Expand All @@ -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'
Expand All @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});