Skip to content

Commit

Permalink
fixup! fixup! fixup! test(CardBase): test for CardBase added
Browse files Browse the repository at this point in the history
  • Loading branch information
niktverd committed Sep 20, 2023
1 parent db47596 commit 644153b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/CardBase/__tests__/CardBase.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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 () => {
Expand All @@ -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(
<CardBase qa={qaId} url={url}>
<CardBase.Content>Content</CardBase.Content>
Expand All @@ -49,7 +49,7 @@ describe('CardBase', () => {
expect(cardBase).not.toBeDisabled();
});

test.each(new Array<React.HTMLAttributeAnchorTarget>(...targets))(
test.each(new Array<React.HTMLAttributeAnchorTarget>(...TARGETS))(
'render with given "%s" target',
(target) => {
render(
Expand Down
2 changes: 2 additions & 0 deletions test-utils/constants.ts
Original file line number Diff line number Diff line change
@@ -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';

0 comments on commit 644153b

Please sign in to comment.