Skip to content

Commit

Permalink
returned e2e taxonomy rest method
Browse files Browse the repository at this point in the history
  • Loading branch information
Fellan-91 committed Jan 29, 2025
1 parent f24753c commit d5e1894
Showing 1 changed file with 8 additions and 23 deletions.
31 changes: 8 additions & 23 deletions tests/e2e/specs/archive.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -617,33 +617,18 @@ test.describe('archive pages', () => {
: '/wp/v2/portfolio_tag';

try {
const RestLogs = await retryRequest(() =>
const existingTerms = await retryRequest(() =>
requestUtils.rest({
path: '/wp/v2',
path: endpoint,
method: 'GET',
params: {
per_page: 100,
context: 'view',
hide_empty: false,
},
})
);

console.log('Rest Logs: ');
console.log(RestLogs);
// Fetch existing terms with retry
let existingTerms;

if (type === 'portfolio_category') {
existingTerms = await retryRequest(() =>
requestUtils.rest({
path: '/wp/v2/portfolio_category?context=view',
params: { per_page: 100 },
})
);
} else {
existingTerms = await retryRequest(() =>
requestUtils.rest({
path: '/wp/v2/portfolio_tag?context=view',
params: { per_page: 100 },
})
);
}

// Ensure existingTerms is an array before proceeding
if (!Array.isArray(existingTerms)) {
throw new Error(
Expand Down

0 comments on commit d5e1894

Please sign in to comment.