From d5e1894227c03d95519dd77cf730412398ce5c8f Mon Sep 17 00:00:00 2001 From: Fellan-91 Date: Wed, 29 Jan 2025 16:51:04 +0300 Subject: [PATCH] returned e2e taxonomy rest method --- tests/e2e/specs/archive.spec.js | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/tests/e2e/specs/archive.spec.js b/tests/e2e/specs/archive.spec.js index 03d4d26e..d1f0cd66 100644 --- a/tests/e2e/specs/archive.spec.js +++ b/tests/e2e/specs/archive.spec.js @@ -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(