diff --git a/src/components/Alert/__tests__/Alert.test.jsx b/src/components/Alert/__tests__/Alert.test.jsx index a846d99a..591cca14 100644 --- a/src/components/Alert/__tests__/Alert.test.jsx +++ b/src/components/Alert/__tests__/Alert.test.jsx @@ -5,7 +5,8 @@ import { within, } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { colorPropTest } from '../../../../tests/propTests/colorPropTest'; +import { feedbackColorPropTest } from '../../../../tests/propTests/feedbackColorPropTest'; +import { neutralColorPropTest } from '../../../../tests/propTests/neutralColorPropTest'; import defaultTranslations from '../../../translations/en'; import { Alert } from '../Alert'; @@ -20,7 +21,8 @@ describe('rendering', () => { { children:
content text
}, (rootElement) => expect(within(rootElement).getByText('content text')), ], - ...colorPropTest, + ...feedbackColorPropTest, + ...neutralColorPropTest, [ { icon: (
icon
) }, (rootElement) => expect(within(rootElement).getByText('icon')), diff --git a/src/components/Badge/__tests__/Badge.test.jsx b/src/components/Badge/__tests__/Badge.test.jsx index 6e40cec2..37531b99 100644 --- a/src/components/Badge/__tests__/Badge.test.jsx +++ b/src/components/Badge/__tests__/Badge.test.jsx @@ -3,7 +3,8 @@ import { render, within, } from '@testing-library/react'; -import { colorPropTest } from '../../../../tests/propTests/colorPropTest'; +import { feedbackColorPropTest } from '../../../../tests/propTests/feedbackColorPropTest'; +import { neutralColorPropTest } from '../../../../tests/propTests/neutralColorPropTest'; import { Badge } from '../Badge'; const mandatoryProps = { @@ -12,7 +13,8 @@ const mandatoryProps = { describe('rendering', () => { it.each([ - ...colorPropTest, + ...feedbackColorPropTest, + ...neutralColorPropTest, [ { label: 'label text' }, (rootElement) => expect(within(rootElement).getByText('label text')), diff --git a/src/components/Button/__tests__/Button.test.jsx b/src/components/Button/__tests__/Button.test.jsx index 17a17491..0a5ee0a0 100644 --- a/src/components/Button/__tests__/Button.test.jsx +++ b/src/components/Button/__tests__/Button.test.jsx @@ -7,7 +7,8 @@ import { import userEvent from '@testing-library/user-event'; import { actionColorPropTest } from '../../../../tests/propTests/actionColorPropTest'; import { blockPropTest } from '../../../../tests/propTests/blockPropTest'; -import { colorPropTest } from '../../../../tests/propTests/colorPropTest'; +import { feedbackColorPropTest } from '../../../../tests/propTests/feedbackColorPropTest'; +import { neutralColorPropTest } from '../../../../tests/propTests/neutralColorPropTest'; import { refPropTest } from '../../../../tests/propTests/refPropTest'; import { labelPropTest } from '../../../../tests/propTests/labelPropTest'; import { sizePropTest } from '../../../../tests/propTests/sizePropTest'; @@ -67,7 +68,8 @@ describe('rendering', () => { ], ...actionColorPropTest, ...blockPropTest, - ...colorPropTest, + ...feedbackColorPropTest, + ...neutralColorPropTest, [ { disabled: true }, (rootElement) => expect(rootElement).toBeDisabled(), diff --git a/src/components/Card/__tests__/Card.test.jsx b/src/components/Card/__tests__/Card.test.jsx index bee505ef..3b902993 100644 --- a/src/components/Card/__tests__/Card.test.jsx +++ b/src/components/Card/__tests__/Card.test.jsx @@ -3,7 +3,8 @@ import { render, within, } from '@testing-library/react'; -import { colorPropTest } from '../../../../tests/propTests/colorPropTest'; +import { feedbackColorPropTest } from '../../../../tests/propTests/feedbackColorPropTest'; +import { neutralColorPropTest } from '../../../../tests/propTests/neutralColorPropTest'; import { raisedPropTest } from '../../../../tests/propTests/raisedPropTest'; import { ScrollView } from '../../ScrollView'; import { Card } from '../Card'; @@ -33,7 +34,8 @@ describe('rendering', () => { { children: scroll view content }, (rootElement) => expect(within(rootElement).getByText('scroll view content')), ], - ...colorPropTest, + ...feedbackColorPropTest, + ...neutralColorPropTest, ...densePropTest('Root'), [ { disabled: true }, diff --git a/tests/propTests/colorPropTest.js b/tests/propTests/feedbackColorPropTest.js similarity index 72% rename from tests/propTests/colorPropTest.js rename to tests/propTests/feedbackColorPropTest.js index 0c47eec4..ff8662ee 100644 --- a/tests/propTests/colorPropTest.js +++ b/tests/propTests/feedbackColorPropTest.js @@ -1,8 +1,4 @@ -export const colorPropTest = [ - [ - { color: 'dark' }, - (rootElement) => expect(rootElement).toHaveClass('isRootColorDark'), - ], +export const feedbackColorPropTest = [ [ { color: 'danger' }, (rootElement) => expect(rootElement).toHaveClass('isRootColorDanger'), @@ -15,10 +11,6 @@ export const colorPropTest = [ { color: 'info' }, (rootElement) => expect(rootElement).toHaveClass('isRootColorInfo'), ], - [ - { color: 'light' }, - (rootElement) => expect(rootElement).toHaveClass('isRootColorLight'), - ], [ { color: 'note' }, (rootElement) => expect(rootElement).toHaveClass('isRootColorNote'), diff --git a/tests/propTests/neutralColorPropTest.js b/tests/propTests/neutralColorPropTest.js new file mode 100644 index 00000000..3d5d294f --- /dev/null +++ b/tests/propTests/neutralColorPropTest.js @@ -0,0 +1,10 @@ +export const neutralColorPropTest = [ + [ + { color: 'dark' }, + (rootElement) => expect(rootElement).toHaveClass('isRootColorDark'), + ], + [ + { color: 'light' }, + (rootElement) => expect(rootElement).toHaveClass('isRootColorLight'), + ], +];