diff --git a/src/components/CardBase/__tests__/CardBase.test.tsx b/src/components/CardBase/__tests__/CardBase.test.tsx index 8d004c714..168bdf7a0 100644 --- a/src/components/CardBase/__tests__/CardBase.test.tsx +++ b/src/components/CardBase/__tests__/CardBase.test.tsx @@ -3,6 +3,7 @@ import React from 'react'; import {render, screen} from '@testing-library/react'; import userEvent from '@testing-library/user-event'; +import {TARGETS} from '../../../../test-utils/constants'; import {testCustomClassName} from '../../../../test-utils/shared/common'; import {PageConstructorProvider} from '../../../containers/PageConstructor'; import {AnalyticsContextProps} from '../../../context/analyticsContext'; @@ -17,7 +18,6 @@ const qaAttributes = getQaAttrubutes(qaId, 'header', 'footer', 'body', 'content' const url = '#'; const borders: CardBorder[] = ['shadow', 'line', 'none']; -const targets: React.HTMLAttributeAnchorTarget[] = ['_blank', '_self', '_parent', '_top']; describe('CardBase', () => { test('render CardBase by default', async () => { @@ -36,7 +36,7 @@ describe('CardBase', () => { expect(aTag).not.toBeInTheDocument(); }); - test('render CardBase by default as a-tag', async () => { + test('render CardBase by default as a link', async () => { render( Content @@ -49,7 +49,7 @@ describe('CardBase', () => { expect(cardBase).not.toBeDisabled(); }); - test.each(new Array(...targets))( + test.each(new Array(...TARGETS))( 'render with given "%s" target', (target) => { render( diff --git a/test-utils/constants.ts b/test-utils/constants.ts index f8d371ea6..c1bfc8fc5 100644 --- a/test-utils/constants.ts +++ b/test-utils/constants.ts @@ -1 +1,3 @@ +export const TARGETS: React.HTMLAttributeAnchorTarget[] = ['_blank', '_self', '_parent', '_top']; + export const ERROR_INPUT_DATA_MESSAGE = 'There are errors in input test data';