Skip to content

Commit

Permalink
Some improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
htuzel committed Nov 18, 2024
1 parent 4365338 commit 419a5a2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
run: npm install algoliasearch

- name: Run Algolia Index Tests
run: npm test -- test/e2e/variation_index.test.js
run: npm run test:variationindex

frontend-tests:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ node scripts/runSFCCJob.js

echo "Running index tests..."
npm install algoliasearch
npm test -- test/e2e/variation_index.test.js
npm run test:variationindex

echo "Running frontend tests..."
npx cypress run
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"run:sfcc-job": "node scripts/runSFCCJob.js",
"test:index": "npm install algoliasearch && npm test -- test/e2e/variation_index.test.js",
"test:frontend": "cypress run",
"test:e2e": "chmod +x e2e.sh && ./e2e.sh"
"test:e2e": "./e2e.sh",
"test:variationindex": "jest test/e2e/variation_index.test.js"
},
"repository": {
"type": "git",
Expand Down
10 changes: 0 additions & 10 deletions test/e2e/variation_index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ const sfcc = require('sfcc-ci');

describe('Algolia Integration', () => {
beforeAll(async () => {
if (!process.env.CIRCLECI) {
console.log('Skipping Algolia Integration tests - not in CircleCI environment');
return;
}

const sfccAuthVars = ['SFCC_OAUTH_CLIENT_ID', 'SFCC_OAUTH_CLIENT_SECRET'];
sfccAuthVars.forEach(envVar => {
Expand Down Expand Up @@ -51,18 +47,12 @@ describe('Algolia Integration', () => {
let index;

beforeEach(() => {
// Skip setup if not in CircleCI
if (!process.env.CIRCLECI) return;

client = algoliasearch(process.env.ALGOLIA_APP_ID, process.env.ALGOLIA_API_KEY);
index = client.initIndex(process.env.ALGOLIA_INDEX_NAME || 'varx__products__en_US');
});

test('should search for a specific product', async () => {
if (!process.env.CIRCLECI) {
console.log('Test skipped - not in CircleCI environment');
return;
}

// Updated API URL structure to match curl example
const apiUrl = `https://${process.env.SANDBOX_HOST}/s/-/dw/data/v24_5/products/${process.env.TEST_PRODUCT_ID}?site_id=RefArch&client_id=${process.env.SFCC_OAUTH_CLIENT_ID}`;
Expand Down

0 comments on commit 419a5a2

Please sign in to comment.