Skip to content

Commit

Permalink
fix failed test part II
Browse files Browse the repository at this point in the history
  • Loading branch information
dzonidoo committed Jul 18, 2024
1 parent b0d5119 commit c4372b0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scripts/apps/vocabularies/tests/vocabularies.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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({});

Expand Down
16 changes: 13 additions & 3 deletions scripts/core/helpers/testUtils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
const getTestSelector = (testIds: Array<string>) => {
return testIds
.map((testId) => `[data-test-id="${testId}"]`)
const getTestSelector = (...testIds: Array<string>) => {
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;

0 comments on commit c4372b0

Please sign in to comment.