diff --git a/scripts/apps/vocabularies/tests/vocabularies.spec.tsx b/scripts/apps/vocabularies/tests/vocabularies.spec.tsx index d683af7a87..6c041d0dff 100644 --- a/scripts/apps/vocabularies/tests/vocabularies.spec.tsx +++ b/scripts/apps/vocabularies/tests/vocabularies.spec.tsx @@ -2,7 +2,7 @@ import React from 'react'; import {mount} from 'enzyme'; import {noop} from 'lodash'; import {VocabularyItemsViewEdit} from '../components/VocabularyItemsViewEdit'; -import {s} from './../../../../e2e/client/playwright/utils'; +import {s} from 'core/helpers/testUtils'; const getPromise = () => Promise.resolve({}); diff --git a/scripts/core/helpers/testUtils.ts b/scripts/core/helpers/testUtils.ts index 0f4e3af30e..83e9d19781 100644 --- a/scripts/core/helpers/testUtils.ts +++ b/scripts/core/helpers/testUtils.ts @@ -1,7 +1,17 @@ -const getTestSelector = (testIds: Array) => { - return testIds - .map((testId) => `[data-test-id="${testId}"]`) +const getTestSelector = (...testIds: Array) => { + const selector = testIds + .map((testId) => { + if (testId.includes('=')) { + const [id, value] = testId.split('='); + + return `[data-test-id="${id}"][data-test-value="${value}"]`; + } else { + return `[data-test-id="${testId}"]`; + } + }) .join(' '); + + return selector; }; export const s = getTestSelector;