@scottish-government/designsystem-react 0.6.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@types/components/Accordion.d.ts +2 -2
- package/@types/components/ConfirmationMessage.d.ts +1 -1
- package/@types/components/NotificationPanel.d.ts +1 -1
- package/@types/components/SummaryCard.d.ts +1 -1
- package/@types/components/Tabs.d.ts +1 -1
- package/@types/sgds.d.ts +1 -1
- package/CHANGELOG.md +81 -0
- package/README.md +4 -0
- package/dist/common/{abstract-notification-banner.jsx → AbstractNotificationBanner.jsx} +5 -5
- package/dist/components/{accordion/accordion.jsx → Accordion/Accordion.jsx} +6 -6
- package/dist/components/{back-to-top/back-to-top.jsx → BackToTop/BackToTop.jsx} +2 -2
- package/dist/components/{button/button.jsx → Button/Button.jsx} +7 -7
- package/dist/components/{checkbox/checkbox.jsx → Checkbox/Checkbox.jsx} +2 -2
- package/dist/components/{confirmation-message/confirmation-message.jsx → ConfirmationMessage/ConfirmationMessage.jsx} +6 -6
- package/dist/components/{contents-nav/contents-nav.jsx → ContentsNav/ContentsNav.jsx} +3 -3
- package/dist/components/{cookie-banner/cookie-banner.jsx → CookieBanner/CookieBanner.jsx} +4 -4
- package/dist/components/{date-picker/date-picker.jsx → DatePicker/DatePicker.jsx} +7 -7
- package/dist/components/{error-summary/error-summary.jsx → ErrorSummary/ErrorSummary.jsx} +2 -2
- package/dist/components/{file-download/file-download.jsx → FileDownload/FileDownload.jsx} +2 -2
- package/dist/components/{hide-this-page/hide-this-page.jsx → HideThisPage/HideThisPage.jsx} +3 -3
- package/dist/components/{notification-banner/notification-banner.jsx → NotificationBanner/NotificationBanner.jsx} +4 -4
- package/dist/components/{notification-panel/notification-panel.jsx → NotificationPanel/NotificationPanel.jsx} +4 -4
- package/dist/components/{pagination/pagination.jsx → Pagination/Pagination.jsx} +3 -3
- package/dist/components/{phase-banner/phase-banner.jsx → PhaseBanner/PhaseBanner.jsx} +2 -2
- package/dist/components/{question/question.jsx → Question/Question.jsx} +7 -7
- package/dist/components/{radio-button/radio-button.jsx → RadioButton/RadioButton.jsx} +2 -2
- package/dist/components/{select/select.jsx → Select/Select.jsx} +4 -4
- package/dist/components/{site-header/site-header.jsx → SiteHeader/SiteHeader.jsx} +13 -13
- package/dist/components/{site-search/site-search.jsx → SiteSearch/SiteSearch.jsx} +2 -2
- package/dist/components/{summary-card/summary-card.jsx → SummaryCard/SummaryCard.jsx} +6 -6
- package/dist/components/{summary-list/summary-list.jsx → SummaryList/SummaryList.jsx} +8 -8
- package/dist/components/{tabs/tabs.jsx → Tabs/Tabs.jsx} +4 -4
- package/dist/components/{task-list/task-list.jsx → TaskList/TaskList.jsx} +9 -9
- package/dist/components/{text-input/text-input.jsx → TextInput/TextInput.jsx} +11 -11
- package/dist/components/{textarea/textarea.jsx → Textarea/Textarea.jsx} +7 -7
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/common/{abstract-notification-banner.test.tsx → AbstractNotificationBanner.test.tsx} +11 -11
- package/src/common/{abstract-notification-banner.tsx → AbstractNotificationBanner.tsx} +2 -2
- package/src/common/{conditional-wrapper.test.tsx → ConditionalWrapper.test.tsx} +1 -1
- package/src/common/{file-icon.test.tsx → FileIcon.test.tsx} +10 -10
- package/src/common/{hint-text.test.tsx → HintText.test.tsx} +12 -12
- package/src/common/{icon.test.tsx → Icon.test.tsx} +16 -16
- package/src/common/{screen-reader-text.test.tsx → ScreenReaderText.test.tsx} +5 -5
- package/src/common/{wrapper-tag.test.tsx → WrapperTag.test.tsx} +5 -5
- package/src/components/{accordion/accordion.test.tsx → Accordion/Accordion.test.tsx} +35 -35
- package/src/components/{accordion/accordion.tsx → Accordion/Accordion.tsx} +5 -5
- package/src/components/{aspect-box/aspect-box.test.tsx → AspectBox/AspectBox.test.tsx} +2 -2
- package/src/components/{back-to-top/back-to-top.test.tsx → BackToTop/BackToTop.test.tsx} +1 -1
- package/src/components/{back-to-top/back-to-top.tsx → BackToTop/BackToTop.tsx} +1 -1
- package/src/components/{breadcrumbs/breadcrumbs.test.tsx → Breadcrumbs/Breadcrumbs.test.tsx} +7 -7
- package/src/components/{button/button.test.tsx → Button/Button.test.tsx} +1 -1
- package/src/components/{button/button.tsx → Button/Button.tsx} +3 -3
- package/src/components/{checkbox/checkbox.test.tsx → Checkbox/Checkbox.test.tsx} +16 -16
- package/src/components/{checkbox/checkbox.tsx → Checkbox/Checkbox.tsx} +1 -1
- package/src/components/{confirmation-message/confirmation-message.test.tsx → ConfirmationMessage/ConfirmationMessage.test.tsx} +12 -14
- package/src/components/{confirmation-message/confirmation-message.tsx → ConfirmationMessage/ConfirmationMessage.tsx} +4 -4
- package/src/components/{contents-nav/contents-nav.test.tsx → ContentsNav/ContentsNav.test.tsx} +21 -28
- package/src/components/{contents-nav/contents-nav.tsx → ContentsNav/ContentsNav.tsx} +1 -1
- package/src/components/{cookie-banner/cookie-banner.test.tsx → CookieBanner/CookieBanner.test.tsx} +3 -3
- package/src/components/{cookie-banner/cookie-banner.tsx → CookieBanner/CookieBanner.tsx} +1 -1
- package/src/components/{date-picker/date-picker.test.tsx → DatePicker/DatePicker.test.tsx} +76 -66
- package/src/components/{date-picker/date-picker.tsx → DatePicker/DatePicker.tsx} +2 -2
- package/src/components/{details/details.test.tsx → Details/Details.test.tsx} +10 -10
- package/src/components/{error-message/error-message.test.tsx → ErrorMessage/ErrorMessage.test.tsx} +10 -10
- package/src/components/{error-summary/error-summary.test.tsx → ErrorSummary/ErrorSummary.test.tsx} +13 -14
- package/src/components/{error-summary/error-summary.tsx → ErrorSummary/ErrorSummary.tsx} +1 -1
- package/src/components/{file-download/file-download.test.tsx → FileDownload/FileDownload.test.tsx} +21 -21
- package/src/components/{file-download/file-download.tsx → FileDownload/FileDownload.tsx} +1 -1
- package/src/components/{hide-this-page/hide-this-page.test.tsx → HideThisPage/HideThisPage.test.tsx} +4 -4
- package/src/components/{hide-this-page/hide-this-page.tsx → HideThisPage/HideThisPage.tsx} +3 -3
- package/src/components/{inset-text/inset-text.test.tsx → InsetText/InsetText.test.tsx} +1 -1
- package/src/components/{notification-banner/notification-banner.test.tsx → NotificationBanner/NotificationBanner.test.tsx} +4 -4
- package/src/components/{notification-banner/notification-banner.tsx → NotificationBanner/NotificationBanner.tsx} +1 -1
- package/src/components/{notification-panel/notification-panel.test.tsx → NotificationPanel/NotificationPanel.test.tsx} +24 -23
- package/src/components/{notification-panel/notification-panel.tsx → NotificationPanel/NotificationPanel.tsx} +3 -3
- package/src/components/{page-header/page-header.test.tsx → PageHeader/PageHeader.test.tsx} +9 -9
- package/src/components/{page-metadata/page-metadata.test.tsx → PageMetadata/PageMetadata.test.tsx} +9 -9
- package/src/components/{pagination/pagination.test.tsx → Pagination/Pagination.test.tsx} +56 -56
- package/src/components/{pagination/pagination.tsx → Pagination/Pagination.tsx} +1 -1
- package/src/components/{phase-banner/phase-banner.test.tsx → PhaseBanner/PhaseBanner.test.tsx} +9 -9
- package/src/components/{phase-banner/phase-banner.tsx → PhaseBanner/PhaseBanner.tsx} +1 -1
- package/src/components/{question/question.test.tsx → Question/Question.test.tsx} +10 -10
- package/src/components/{question/question.tsx → Question/Question.tsx} +3 -3
- package/src/components/{radio-button/radio-button.test.tsx → RadioButton/RadioButton.test.tsx} +23 -23
- package/src/components/{radio-button/radio-button.tsx → RadioButton/RadioButton.tsx} +1 -1
- package/src/components/{select/select.test.tsx → Select/Select.test.tsx} +67 -64
- package/src/components/{select/select.tsx → Select/Select.tsx} +2 -2
- package/src/components/{sequential-navigation/sequential-navigation.test.tsx → SequentialNavigation/SequentialNavigation.test.tsx} +18 -18
- package/src/components/{side-navigation/side-navigation.test.tsx → SideNavigation/SideNavigation.test.tsx} +8 -8
- package/src/components/{site-header/site-header.test.tsx → SiteHeader/SiteHeader.test.tsx} +25 -25
- package/src/components/{site-header/site-header.tsx → SiteHeader/SiteHeader.tsx} +4 -4
- package/src/components/{site-navigation/site-navigation.test.tsx → SiteNavigation/SiteNavigation.test.tsx} +8 -8
- package/src/components/{site-search/site-search.test.tsx → SiteSearch/SiteSearch.test.tsx} +16 -16
- package/src/components/{site-search/site-search.tsx → SiteSearch/SiteSearch.tsx} +1 -1
- package/src/components/{skip-links/skip-links.test.tsx → SkipLinks/SkipLinks.test.tsx} +15 -15
- package/src/components/{summary-card/summary-card.test.tsx → SummaryCard/SummaryCard.test.tsx} +28 -28
- package/src/components/{summary-card/summary-card.tsx → SummaryCard/SummaryCard.tsx} +4 -4
- package/src/components/{summary-list/summary-list.test.tsx → SummaryList/SummaryList.test.tsx} +55 -56
- package/src/components/{summary-list/summary-list.tsx → SummaryList/SummaryList.tsx} +2 -2
- package/src/components/{table/table.test.tsx → Table/Table.test.tsx} +4 -4
- package/src/components/{tabs/tabs.test.tsx → Tabs/Tabs.test.tsx} +22 -42
- package/src/components/{tabs/tabs.tsx → Tabs/Tabs.tsx} +3 -3
- package/src/components/{tag/tag.test.tsx → Tag/Tag.test.tsx} +10 -10
- package/src/components/{task-list/task-list.test.tsx → TaskList/TaskList.test.tsx} +109 -108
- package/src/components/{task-list/task-list.tsx → TaskList/TaskList.tsx} +4 -4
- package/src/components/{text-input/text-input.test.tsx → TextInput/TextInput.test.tsx} +92 -87
- package/src/components/{text-input/text-input.tsx → TextInput/TextInput.tsx} +4 -4
- package/src/components/{textarea/textarea.test.tsx → Textarea/Textarea.test.tsx} +71 -67
- package/src/components/{textarea/textarea.tsx → Textarea/Textarea.tsx} +3 -3
- package/src/components/{warning-text/warning-text.test.tsx → WarningText/WarningText.test.tsx} +1 -1
- package/dist/icons/ArrowUpward.jsx +0 -41
- package/dist/icons/CalendarToday.jsx +0 -41
- package/dist/icons/Cancel.jsx +0 -40
- package/dist/icons/CheckCircle.jsx +0 -41
- package/dist/icons/ChevronLeft.jsx +0 -41
- package/dist/icons/ChevronRight.jsx +0 -41
- package/dist/icons/Close.jsx +0 -41
- package/dist/icons/Description.jsx +0 -41
- package/dist/icons/DoubleChevronLeft.jsx +0 -40
- package/dist/icons/DoubleChevronRight.jsx +0 -40
- package/dist/icons/Error.jsx +0 -41
- package/dist/icons/ExpandLess.jsx +0 -41
- package/dist/icons/ExpandMore.jsx +0 -41
- package/dist/icons/List.jsx +0 -44
- package/dist/icons/Menu.jsx +0 -41
- package/dist/icons/PriorityHigh.jsx +0 -42
- package/dist/icons/Search.jsx +0 -41
- package/dist/icons/index.js +0 -40
- /package/dist/common/{conditional-wrapper.jsx → ConditionalWrapper.jsx} +0 -0
- /package/dist/common/{file-icon.jsx → FileIcon.jsx} +0 -0
- /package/dist/common/{hint-text.jsx → HintText.jsx} +0 -0
- /package/dist/common/{icon.jsx → Icon.jsx} +0 -0
- /package/dist/common/{screen-reader-text.jsx → ScreenReaderText.jsx} +0 -0
- /package/dist/common/{wrapper-tag.jsx → WrapperTag.jsx} +0 -0
- /package/dist/components/{aspect-box/aspect-box.jsx → AspectBox/AspectBox.jsx} +0 -0
- /package/dist/components/{breadcrumbs/breadcrumbs.jsx → Breadcrumbs/Breadcrumbs.jsx} +0 -0
- /package/dist/components/{details/details.jsx → Details/Details.jsx} +0 -0
- /package/dist/components/{error-message/error-message.jsx → ErrorMessage/ErrorMessage.jsx} +0 -0
- /package/dist/components/{inset-text/inset-text.jsx → InsetText/InsetText.jsx} +0 -0
- /package/dist/components/{page-header/page-header.jsx → PageHeader/PageHeader.jsx} +0 -0
- /package/dist/components/{page-metadata/page-metadata.jsx → PageMetadata/PageMetadata.jsx} +0 -0
- /package/dist/components/{sequential-navigation/sequential-navigation.jsx → SequentialNavigation/SequentialNavigation.jsx} +0 -0
- /package/dist/components/{side-navigation/side-navigation.jsx → SideNavigation/SideNavigation.jsx} +0 -0
- /package/dist/components/{site-navigation/site-navigation.jsx → SiteNavigation/SiteNavigation.jsx} +0 -0
- /package/dist/components/{skip-links/skip-links.jsx → SkipLinks/SkipLinks.jsx} +0 -0
- /package/dist/components/{table/table.jsx → Table/Table.jsx} +0 -0
- /package/dist/components/{tag/tag.jsx → Tag/Tag.jsx} +0 -0
- /package/dist/components/{warning-text/warning-text.jsx → WarningText/WarningText.jsx} +0 -0
- /package/src/common/{conditional-wrapper.tsx → ConditionalWrapper.tsx} +0 -0
- /package/src/common/{file-icon.tsx → FileIcon.tsx} +0 -0
- /package/src/common/{hint-text.tsx → HintText.tsx} +0 -0
- /package/src/common/{icon.tsx → Icon.tsx} +0 -0
- /package/src/common/{screen-reader-text.tsx → ScreenReaderText.tsx} +0 -0
- /package/src/common/{wrapper-tag.tsx → WrapperTag.tsx} +0 -0
- /package/src/components/{aspect-box/aspect-box.tsx → AspectBox/AspectBox.tsx} +0 -0
- /package/src/components/{breadcrumbs/breadcrumbs.tsx → Breadcrumbs/Breadcrumbs.tsx} +0 -0
- /package/src/components/{details/details.tsx → Details/Details.tsx} +0 -0
- /package/src/components/{error-message/error-message.tsx → ErrorMessage/ErrorMessage.tsx} +0 -0
- /package/src/components/{inset-text/inset-text.tsx → InsetText/InsetText.tsx} +0 -0
- /package/src/components/{page-header/page-header.tsx → PageHeader/PageHeader.tsx} +0 -0
- /package/src/components/{page-metadata/page-metadata.tsx → PageMetadata/PageMetadata.tsx} +0 -0
- /package/src/components/{sequential-navigation/sequential-navigation.tsx → SequentialNavigation/SequentialNavigation.tsx} +0 -0
- /package/src/components/{side-navigation/side-navigation.tsx → SideNavigation/SideNavigation.tsx} +0 -0
- /package/src/components/{site-navigation/site-navigation.tsx → SiteNavigation/SiteNavigation.tsx} +0 -0
- /package/src/components/{skip-links/skip-links.tsx → SkipLinks/SkipLinks.tsx} +0 -0
- /package/src/components/{table/table.tsx → Table/Table.tsx} +0 -0
- /package/src/components/{tag/tag.tsx → Tag/Tag.tsx} +0 -0
- /package/src/components/{warning-text/warning-text.tsx → WarningText/WarningText.tsx} +0 -0
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { test, expect, vi } from 'vitest';
|
|
2
2
|
import { render, screen, within, fireEvent } from '@testing-library/react';
|
|
3
|
-
import TextInput from './
|
|
3
|
+
import TextInput from './TextInput';
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const INPUT_ID = 'text-input';
|
|
6
|
+
const LABEL_TEXT = 'First name';
|
|
7
7
|
|
|
8
8
|
test('text input renders correctly', () => {
|
|
9
9
|
render(
|
|
10
10
|
<TextInput
|
|
11
|
-
id={
|
|
12
|
-
label={
|
|
11
|
+
id={INPUT_ID}
|
|
12
|
+
label={LABEL_TEXT}
|
|
13
13
|
/>
|
|
14
14
|
);
|
|
15
15
|
|
|
16
16
|
const textInput = screen.getByRole('textbox');
|
|
17
|
-
const label = screen.getByText(
|
|
17
|
+
const label = screen.getByText(LABEL_TEXT);
|
|
18
18
|
|
|
19
19
|
expect(textInput).toHaveClass('ds_input');
|
|
20
|
-
expect(textInput).toHaveAttribute('id',
|
|
21
|
-
expect(textInput).toHaveAttribute('name',
|
|
20
|
+
expect(textInput).toHaveAttribute('id', INPUT_ID);
|
|
21
|
+
expect(textInput).toHaveAttribute('name', INPUT_ID);
|
|
22
22
|
expect(textInput).toHaveAttribute('type', 'text');
|
|
23
23
|
expect(textInput.tagName).toEqual('INPUT');
|
|
24
24
|
|
|
25
25
|
expect(label).toHaveClass('ds_label');
|
|
26
|
-
expect(label).toHaveAttribute('for',
|
|
26
|
+
expect(label).toHaveAttribute('for', INPUT_ID);
|
|
27
27
|
expect(label.tagName).toEqual('LABEL');
|
|
28
|
-
expect(label.textContent).toEqual(
|
|
28
|
+
expect(label.textContent).toEqual(LABEL_TEXT);
|
|
29
29
|
|
|
30
30
|
expect(textInput.previousSibling).toEqual(label);
|
|
31
31
|
});
|
|
@@ -33,8 +33,8 @@ test('text input renders correctly', () => {
|
|
|
33
33
|
test('text input with custom class(es)', () => {
|
|
34
34
|
render(
|
|
35
35
|
<TextInput
|
|
36
|
-
id={
|
|
37
|
-
label={
|
|
36
|
+
id={INPUT_ID}
|
|
37
|
+
label={LABEL_TEXT}
|
|
38
38
|
className="foo bar"
|
|
39
39
|
/>
|
|
40
40
|
);
|
|
@@ -45,62 +45,62 @@ test('text input with custom class(es)', () => {
|
|
|
45
45
|
});
|
|
46
46
|
|
|
47
47
|
test('text input with character count', () => {
|
|
48
|
-
const
|
|
48
|
+
const MAX_LENGTH = 100;
|
|
49
49
|
|
|
50
50
|
render(
|
|
51
51
|
<TextInput
|
|
52
|
-
id={
|
|
53
|
-
label={
|
|
54
|
-
maxlength={
|
|
52
|
+
id={INPUT_ID}
|
|
53
|
+
label={LABEL_TEXT}
|
|
54
|
+
maxlength={MAX_LENGTH}
|
|
55
55
|
/>
|
|
56
56
|
);
|
|
57
57
|
|
|
58
58
|
const textInput = screen.getByRole('textbox');
|
|
59
59
|
const textInputWrapper = textInput.parentElement;
|
|
60
60
|
|
|
61
|
-
expect(textInputWrapper).toHaveAttribute('data-maxlength',
|
|
61
|
+
expect(textInputWrapper).toHaveAttribute('data-maxlength', MAX_LENGTH.toString());
|
|
62
62
|
expect(textInputWrapper).toHaveAttribute('data-module', 'ds-character-count');
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
test('text input with character count and threshold', () => {
|
|
66
|
-
const
|
|
67
|
-
const
|
|
66
|
+
const MAX_LENGTH = 100;
|
|
67
|
+
const COUNT_THRESHOLD = 80;
|
|
68
68
|
|
|
69
69
|
render(
|
|
70
70
|
<TextInput
|
|
71
|
-
id={
|
|
72
|
-
label={
|
|
73
|
-
maxlength={
|
|
74
|
-
countThreshold={
|
|
71
|
+
id={INPUT_ID}
|
|
72
|
+
label={LABEL_TEXT}
|
|
73
|
+
maxlength={MAX_LENGTH}
|
|
74
|
+
countThreshold={COUNT_THRESHOLD}
|
|
75
75
|
/>
|
|
76
76
|
);
|
|
77
77
|
|
|
78
78
|
const textInput = screen.getByRole('textbox');
|
|
79
79
|
const textInputWrapper = textInput.parentElement;
|
|
80
80
|
|
|
81
|
-
expect(textInputWrapper).toHaveAttribute('data-threshold',
|
|
81
|
+
expect(textInputWrapper).toHaveAttribute('data-threshold', COUNT_THRESHOLD.toString());
|
|
82
82
|
});
|
|
83
83
|
|
|
84
84
|
test('text input with width', () => {
|
|
85
|
-
const
|
|
85
|
+
const INPUT_WIDTH = 'fixed-10';
|
|
86
86
|
|
|
87
87
|
render(
|
|
88
88
|
<TextInput
|
|
89
|
-
id={
|
|
90
|
-
label={
|
|
91
|
-
width={
|
|
89
|
+
id={INPUT_ID}
|
|
90
|
+
label={LABEL_TEXT}
|
|
91
|
+
width={INPUT_WIDTH}
|
|
92
92
|
/>
|
|
93
93
|
);
|
|
94
94
|
|
|
95
95
|
const textInput = screen.getByRole('textbox');
|
|
96
|
-
expect(textInput).toHaveClass(`ds_input--${
|
|
96
|
+
expect(textInput).toHaveClass(`ds_input--${INPUT_WIDTH}`);
|
|
97
97
|
});
|
|
98
98
|
|
|
99
99
|
test('text input with currency', () => {
|
|
100
100
|
render(
|
|
101
101
|
<TextInput
|
|
102
|
-
id={
|
|
103
|
-
label={
|
|
102
|
+
id={INPUT_ID}
|
|
103
|
+
label={LABEL_TEXT}
|
|
104
104
|
currency
|
|
105
105
|
/>
|
|
106
106
|
);
|
|
@@ -114,32 +114,33 @@ test('text input with currency', () => {
|
|
|
114
114
|
});
|
|
115
115
|
|
|
116
116
|
test('text input with custom currency symbol', () => {
|
|
117
|
-
const
|
|
117
|
+
const CURRENCY_SYMBOL = '@';
|
|
118
118
|
|
|
119
119
|
render(
|
|
120
120
|
<TextInput
|
|
121
|
-
id={
|
|
122
|
-
label={
|
|
121
|
+
id={INPUT_ID}
|
|
122
|
+
label={LABEL_TEXT}
|
|
123
123
|
currency
|
|
124
|
-
currencySymbol={
|
|
124
|
+
currencySymbol={CURRENCY_SYMBOL}
|
|
125
125
|
/>
|
|
126
126
|
);
|
|
127
127
|
|
|
128
128
|
const textInput = screen.getByRole('textbox');
|
|
129
129
|
const textInputWrapper = textInput.parentElement;
|
|
130
130
|
|
|
131
|
-
expect(textInputWrapper).toHaveAttribute('data-symbol',
|
|
131
|
+
expect(textInputWrapper).toHaveAttribute('data-symbol', CURRENCY_SYMBOL);
|
|
132
132
|
});
|
|
133
133
|
|
|
134
134
|
test('text input with button', () => {
|
|
135
|
-
const
|
|
136
|
-
const
|
|
135
|
+
const BUTTON_TEXT = 'Search';
|
|
136
|
+
const BUTTON_ICON = 'Search';
|
|
137
|
+
|
|
137
138
|
render(
|
|
138
139
|
<TextInput
|
|
139
|
-
id={
|
|
140
|
-
label={
|
|
141
|
-
buttonIcon={
|
|
142
|
-
buttonText={
|
|
140
|
+
id={INPUT_ID}
|
|
141
|
+
label={LABEL_TEXT}
|
|
142
|
+
buttonIcon={BUTTON_ICON}
|
|
143
|
+
buttonText={BUTTON_TEXT}
|
|
143
144
|
hasButton
|
|
144
145
|
/>
|
|
145
146
|
);
|
|
@@ -147,7 +148,7 @@ test('text input with button', () => {
|
|
|
147
148
|
const textInput = screen.getByRole('textbox');
|
|
148
149
|
const textInputWrapper = textInput.parentElement;
|
|
149
150
|
const button = screen.getByRole('button');
|
|
150
|
-
const buttonTextElement = within(button).getByText(
|
|
151
|
+
const buttonTextElement = within(button).getByText(BUTTON_TEXT);
|
|
151
152
|
const buttonIconElement = within(button).getByRole('img', { hidden: true });
|
|
152
153
|
|
|
153
154
|
expect(textInputWrapper).toHaveClass('ds_input__wrapper', 'ds_input__wrapper--has-icon ');
|
|
@@ -163,16 +164,17 @@ test('text input with button', () => {
|
|
|
163
164
|
});
|
|
164
165
|
|
|
165
166
|
test('text input with hint text', () => {
|
|
166
|
-
const
|
|
167
|
+
const HINT_TEXT = 'hint text';
|
|
168
|
+
|
|
167
169
|
render(
|
|
168
170
|
<TextInput
|
|
169
|
-
id={
|
|
170
|
-
label={
|
|
171
|
-
hintText={
|
|
171
|
+
id={INPUT_ID}
|
|
172
|
+
label={LABEL_TEXT}
|
|
173
|
+
hintText={HINT_TEXT}
|
|
172
174
|
/>
|
|
173
175
|
);
|
|
174
176
|
|
|
175
|
-
const hintTextEl = screen.getByText(
|
|
177
|
+
const hintTextEl = screen.getByText(HINT_TEXT);
|
|
176
178
|
const textInput = screen.getByRole('textbox');
|
|
177
179
|
|
|
178
180
|
expect(hintTextEl).toBeInTheDocument();
|
|
@@ -180,27 +182,28 @@ test('text input with hint text', () => {
|
|
|
180
182
|
});
|
|
181
183
|
|
|
182
184
|
test('text input with custom name', () => {
|
|
183
|
-
const
|
|
185
|
+
const INPUT_NAME = 'foo';
|
|
184
186
|
|
|
185
187
|
render(
|
|
186
188
|
<TextInput
|
|
187
|
-
id={
|
|
188
|
-
label={
|
|
189
|
-
name={
|
|
189
|
+
id={INPUT_ID}
|
|
190
|
+
label={LABEL_TEXT}
|
|
191
|
+
name={INPUT_NAME}
|
|
190
192
|
/>
|
|
191
193
|
);
|
|
192
194
|
|
|
193
195
|
const textInput = screen.getByRole('textbox');
|
|
194
|
-
expect(textInput).toHaveAttribute('name',
|
|
196
|
+
expect(textInput).toHaveAttribute('name', INPUT_NAME);
|
|
195
197
|
});
|
|
196
198
|
|
|
197
199
|
test('text input with blur function', () => {
|
|
198
|
-
const
|
|
200
|
+
const ONBLUR_FUNCTION = vi.fn();
|
|
201
|
+
|
|
199
202
|
render(
|
|
200
203
|
<TextInput
|
|
201
|
-
id={
|
|
202
|
-
label={
|
|
203
|
-
onBlur={
|
|
204
|
+
id={INPUT_ID}
|
|
205
|
+
label={LABEL_TEXT}
|
|
206
|
+
onBlur={ONBLUR_FUNCTION}
|
|
204
207
|
/>
|
|
205
208
|
);
|
|
206
209
|
|
|
@@ -208,16 +211,17 @@ test('text input with blur function', () => {
|
|
|
208
211
|
|
|
209
212
|
fireEvent.blur(textInput);
|
|
210
213
|
|
|
211
|
-
expect(
|
|
214
|
+
expect(ONBLUR_FUNCTION).toHaveBeenCalled();
|
|
212
215
|
});
|
|
213
216
|
|
|
214
217
|
test('text input with change function', () => {
|
|
215
|
-
const
|
|
218
|
+
const ONCHANGE_FUNCTION = vi.fn();
|
|
219
|
+
|
|
216
220
|
render(
|
|
217
221
|
<TextInput
|
|
218
|
-
id={
|
|
219
|
-
label={
|
|
220
|
-
onChange={
|
|
222
|
+
id={INPUT_ID}
|
|
223
|
+
label={LABEL_TEXT}
|
|
224
|
+
onChange={ONCHANGE_FUNCTION}
|
|
221
225
|
/>
|
|
222
226
|
);
|
|
223
227
|
|
|
@@ -225,67 +229,68 @@ test('text input with change function', () => {
|
|
|
225
229
|
|
|
226
230
|
fireEvent.change(textInput, {target: {value: 'foo'}});
|
|
227
231
|
|
|
228
|
-
expect(
|
|
232
|
+
expect(ONCHANGE_FUNCTION).toHaveBeenCalled();
|
|
229
233
|
});
|
|
230
234
|
|
|
231
235
|
test('text input with placeholder text', () => {
|
|
232
|
-
const
|
|
236
|
+
const PLACEHOLDER_TEXT = 'foo';
|
|
233
237
|
|
|
234
238
|
render(
|
|
235
239
|
<TextInput
|
|
236
|
-
id={
|
|
237
|
-
label={
|
|
238
|
-
placeholder={
|
|
240
|
+
id={INPUT_ID}
|
|
241
|
+
label={LABEL_TEXT}
|
|
242
|
+
placeholder={PLACEHOLDER_TEXT}
|
|
239
243
|
/>
|
|
240
244
|
);
|
|
241
245
|
|
|
242
246
|
const textInput = screen.getByRole('textbox');
|
|
243
|
-
expect(textInput).toHaveAttribute('placeholder',
|
|
247
|
+
expect(textInput).toHaveAttribute('placeholder', PLACEHOLDER_TEXT);
|
|
244
248
|
});
|
|
245
249
|
|
|
246
250
|
test('text input with different type', () => {
|
|
247
|
-
const
|
|
251
|
+
const INPUT_TYPE = 'foo';
|
|
248
252
|
|
|
249
253
|
render(
|
|
250
254
|
<TextInput
|
|
251
|
-
id={
|
|
252
|
-
label={
|
|
253
|
-
type={
|
|
255
|
+
id={INPUT_ID}
|
|
256
|
+
label={LABEL_TEXT}
|
|
257
|
+
type={INPUT_TYPE}
|
|
254
258
|
/>
|
|
255
259
|
);
|
|
256
260
|
|
|
257
261
|
const textInput = screen.getByRole('textbox');
|
|
258
|
-
expect(textInput).toHaveAttribute('type',
|
|
262
|
+
expect(textInput).toHaveAttribute('type', INPUT_TYPE);
|
|
259
263
|
});
|
|
260
264
|
|
|
261
265
|
test('text input with initial value', () => {
|
|
262
|
-
const
|
|
266
|
+
const INITIAL_VALUE = 'initial value';
|
|
263
267
|
|
|
264
268
|
render(
|
|
265
269
|
<TextInput
|
|
266
|
-
id={
|
|
267
|
-
label={
|
|
268
|
-
value={
|
|
270
|
+
id={INPUT_ID}
|
|
271
|
+
label={LABEL_TEXT}
|
|
272
|
+
value={INITIAL_VALUE}
|
|
269
273
|
/>
|
|
270
274
|
);
|
|
271
275
|
|
|
272
276
|
const textInput = screen.getByRole('textbox');
|
|
273
|
-
expect(textInput).toHaveAttribute('value',
|
|
277
|
+
expect(textInput).toHaveAttribute('value', INITIAL_VALUE);
|
|
274
278
|
});
|
|
275
279
|
|
|
276
280
|
test('text input with error message', () => {
|
|
277
|
-
const
|
|
281
|
+
const ERROR_MESSAGE_TEXT = 'This is a required field';
|
|
282
|
+
|
|
278
283
|
render(
|
|
279
284
|
<TextInput
|
|
280
|
-
id={
|
|
281
|
-
label={
|
|
285
|
+
id={INPUT_ID}
|
|
286
|
+
label={LABEL_TEXT}
|
|
282
287
|
error
|
|
283
|
-
errorMessage={
|
|
288
|
+
errorMessage={ERROR_MESSAGE_TEXT}
|
|
284
289
|
/>
|
|
285
290
|
);
|
|
286
291
|
|
|
287
292
|
const textInput = screen.getByRole('textbox');
|
|
288
|
-
const errorMessageElement = screen.getByText(
|
|
293
|
+
const errorMessageElement = screen.getByText(ERROR_MESSAGE_TEXT);
|
|
289
294
|
|
|
290
295
|
expect(textInput).toHaveClass('ds_input--error')
|
|
291
296
|
expect(textInput).toHaveAttribute('aria-describedby', errorMessageElement.id);
|
|
@@ -297,8 +302,8 @@ test('text input with error message', () => {
|
|
|
297
302
|
test('passing additional props', () => {
|
|
298
303
|
render(
|
|
299
304
|
<TextInput
|
|
300
|
-
id={
|
|
301
|
-
label={
|
|
305
|
+
id={INPUT_ID}
|
|
306
|
+
label={LABEL_TEXT}
|
|
302
307
|
data-test="foo"
|
|
303
308
|
/>
|
|
304
309
|
);
|
|
@@ -310,8 +315,8 @@ test('passing additional props', () => {
|
|
|
310
315
|
test('passing additional CSS classes', () => {
|
|
311
316
|
render(
|
|
312
317
|
<TextInput
|
|
313
|
-
id={
|
|
314
|
-
label={
|
|
318
|
+
id={INPUT_ID}
|
|
319
|
+
label={LABEL_TEXT}
|
|
315
320
|
className="foo"
|
|
316
321
|
/>
|
|
317
322
|
);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'react';
|
|
2
2
|
// @ts-ignore
|
|
3
3
|
import DSCharacterCount from '@scottish-government/design-system/src/forms/character-count/character-count';
|
|
4
|
-
import Button from '../
|
|
5
|
-
import ConditionalWrapper from '../../common/
|
|
6
|
-
import ErrorMessage from '../
|
|
7
|
-
import HintText from '../../common/
|
|
4
|
+
import Button from '../Button/Button';
|
|
5
|
+
import ConditionalWrapper from '../../common/ConditionalWrapper';
|
|
6
|
+
import ErrorMessage from '../ErrorMessage/ErrorMessage';
|
|
7
|
+
import HintText from '../../common/HintText';
|
|
8
8
|
|
|
9
9
|
const TextInput: React.FC<SGDS.Component.TextInput> = ({
|
|
10
10
|
buttonIcon,
|
|
@@ -1,82 +1,83 @@
|
|
|
1
1
|
import { test, expect, vi } from 'vitest';
|
|
2
|
-
import { render, screen,
|
|
3
|
-
import Textarea from './
|
|
2
|
+
import { render, screen, fireEvent } from '@testing-library/react';
|
|
3
|
+
import Textarea from './Textarea';
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const TEXTAREA_ID = 'textarea';
|
|
6
|
+
const LABEL_TEXT = 'Description';
|
|
7
7
|
|
|
8
8
|
test('text input renders correctly', () => {
|
|
9
9
|
render(
|
|
10
10
|
<Textarea
|
|
11
|
-
id={
|
|
12
|
-
label={
|
|
11
|
+
id={TEXTAREA_ID}
|
|
12
|
+
label={LABEL_TEXT}
|
|
13
13
|
/>
|
|
14
14
|
);
|
|
15
15
|
|
|
16
16
|
const textarea = screen.getByRole('textbox');
|
|
17
|
-
const label = screen.getByText(
|
|
17
|
+
const label = screen.getByText(LABEL_TEXT);
|
|
18
18
|
|
|
19
19
|
expect(textarea).toHaveClass('ds_input');
|
|
20
|
-
expect(textarea).toHaveAttribute('id',
|
|
21
|
-
expect(textarea).toHaveAttribute('name',
|
|
20
|
+
expect(textarea).toHaveAttribute('id', TEXTAREA_ID);
|
|
21
|
+
expect(textarea).toHaveAttribute('name', TEXTAREA_ID);
|
|
22
22
|
expect(textarea).toHaveAttribute('rows', String(4));
|
|
23
23
|
|
|
24
24
|
expect(label).toHaveClass('ds_label');
|
|
25
|
-
expect(label).toHaveAttribute('for',
|
|
25
|
+
expect(label).toHaveAttribute('for', TEXTAREA_ID);
|
|
26
26
|
expect(label.tagName).toEqual('LABEL');
|
|
27
|
-
expect(label.textContent).toEqual(
|
|
27
|
+
expect(label.textContent).toEqual(LABEL_TEXT);
|
|
28
28
|
|
|
29
29
|
expect(textarea.previousSibling).toEqual(label);
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
test('textarea with character count', () => {
|
|
33
|
-
const
|
|
33
|
+
const MAX_LENGTH = 250;
|
|
34
34
|
|
|
35
35
|
render(
|
|
36
36
|
<Textarea
|
|
37
|
-
id={
|
|
38
|
-
label={
|
|
39
|
-
maxlength={
|
|
37
|
+
id={TEXTAREA_ID}
|
|
38
|
+
label={LABEL_TEXT}
|
|
39
|
+
maxlength={MAX_LENGTH}
|
|
40
40
|
/>
|
|
41
41
|
);
|
|
42
42
|
|
|
43
43
|
const textarea = screen.getByRole('textbox');
|
|
44
44
|
const textareaWrapper = textarea.parentElement;
|
|
45
45
|
|
|
46
|
-
expect(textareaWrapper).toHaveAttribute('data-maxlength',
|
|
46
|
+
expect(textareaWrapper).toHaveAttribute('data-maxlength', MAX_LENGTH.toString());
|
|
47
47
|
expect(textareaWrapper).toHaveAttribute('data-module', 'ds-character-count');
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
test('text input with character count and threshold', () => {
|
|
51
|
-
const
|
|
52
|
-
const
|
|
51
|
+
const MAX_LENGTH = 250;
|
|
52
|
+
const COUNT_THRESHOLD = 80;
|
|
53
53
|
|
|
54
54
|
render(
|
|
55
55
|
<Textarea
|
|
56
|
-
id={
|
|
57
|
-
label={
|
|
58
|
-
maxlength={
|
|
59
|
-
countThreshold={
|
|
56
|
+
id={TEXTAREA_ID}
|
|
57
|
+
label={LABEL_TEXT}
|
|
58
|
+
maxlength={MAX_LENGTH}
|
|
59
|
+
countThreshold={COUNT_THRESHOLD}
|
|
60
60
|
/>
|
|
61
61
|
);
|
|
62
62
|
|
|
63
63
|
const textarea = screen.getByRole('textbox');
|
|
64
64
|
const textareaWrapper = textarea.parentElement;
|
|
65
65
|
|
|
66
|
-
expect(textareaWrapper).toHaveAttribute('data-threshold',
|
|
66
|
+
expect(textareaWrapper).toHaveAttribute('data-threshold', COUNT_THRESHOLD.toString());
|
|
67
67
|
});
|
|
68
68
|
|
|
69
69
|
test('textarea with hint text', () => {
|
|
70
|
-
const
|
|
70
|
+
const HINT_TEXT = 'hint text';
|
|
71
|
+
|
|
71
72
|
render(
|
|
72
73
|
<Textarea
|
|
73
|
-
id={
|
|
74
|
-
label={
|
|
75
|
-
hintText={
|
|
74
|
+
id={TEXTAREA_ID}
|
|
75
|
+
label={LABEL_TEXT}
|
|
76
|
+
hintText={HINT_TEXT}
|
|
76
77
|
/>
|
|
77
78
|
);
|
|
78
79
|
|
|
79
|
-
const hintTextEl = screen.getByText(
|
|
80
|
+
const hintTextEl = screen.getByText(HINT_TEXT);
|
|
80
81
|
const textarea = screen.getByRole('textbox');
|
|
81
82
|
|
|
82
83
|
expect(hintTextEl).toBeInTheDocument();
|
|
@@ -84,27 +85,28 @@ test('textarea with hint text', () => {
|
|
|
84
85
|
});
|
|
85
86
|
|
|
86
87
|
test('textarea with custom name', () => {
|
|
87
|
-
const
|
|
88
|
+
const TEXTAREA_NAME = 'foo';
|
|
88
89
|
|
|
89
90
|
render(
|
|
90
91
|
<Textarea
|
|
91
|
-
id={
|
|
92
|
-
label={
|
|
93
|
-
name={
|
|
92
|
+
id={TEXTAREA_ID}
|
|
93
|
+
label={LABEL_TEXT}
|
|
94
|
+
name={TEXTAREA_NAME}
|
|
94
95
|
/>
|
|
95
96
|
);
|
|
96
97
|
|
|
97
98
|
const textarea = screen.getByRole('textbox');
|
|
98
|
-
expect(textarea).toHaveAttribute('name',
|
|
99
|
+
expect(textarea).toHaveAttribute('name', TEXTAREA_NAME);
|
|
99
100
|
});
|
|
100
101
|
|
|
101
102
|
test('textarea with blur function', () => {
|
|
102
|
-
const
|
|
103
|
+
const ONBLUR_FUNCTION = vi.fn();
|
|
104
|
+
|
|
103
105
|
render(
|
|
104
106
|
<Textarea
|
|
105
|
-
id={
|
|
106
|
-
label={
|
|
107
|
-
onBlur={
|
|
107
|
+
id={TEXTAREA_ID}
|
|
108
|
+
label={LABEL_TEXT}
|
|
109
|
+
onBlur={ONBLUR_FUNCTION}
|
|
108
110
|
/>
|
|
109
111
|
);
|
|
110
112
|
|
|
@@ -112,16 +114,17 @@ test('textarea with blur function', () => {
|
|
|
112
114
|
|
|
113
115
|
fireEvent.blur(textarea);
|
|
114
116
|
|
|
115
|
-
expect(
|
|
117
|
+
expect(ONBLUR_FUNCTION).toHaveBeenCalled();
|
|
116
118
|
});
|
|
117
119
|
|
|
118
120
|
test('textarea with change function', () => {
|
|
119
|
-
const
|
|
121
|
+
const ONCHANGE_FUNCTION = vi.fn();
|
|
122
|
+
|
|
120
123
|
render(
|
|
121
124
|
<Textarea
|
|
122
|
-
id={
|
|
123
|
-
label={
|
|
124
|
-
onChange={
|
|
125
|
+
id={TEXTAREA_ID}
|
|
126
|
+
label={LABEL_TEXT}
|
|
127
|
+
onChange={ONCHANGE_FUNCTION}
|
|
125
128
|
/>
|
|
126
129
|
);
|
|
127
130
|
|
|
@@ -129,68 +132,69 @@ test('textarea with change function', () => {
|
|
|
129
132
|
|
|
130
133
|
fireEvent.change(textarea, {target: {value: 'foo'}});
|
|
131
134
|
|
|
132
|
-
expect(
|
|
135
|
+
expect(ONCHANGE_FUNCTION).toHaveBeenCalled();
|
|
133
136
|
});
|
|
134
137
|
|
|
135
138
|
test('textarea with placeholder text', () => {
|
|
136
|
-
const
|
|
139
|
+
const PLACEHOLDER_TEXT = 'foo';
|
|
137
140
|
|
|
138
141
|
render(
|
|
139
142
|
<Textarea
|
|
140
|
-
id={
|
|
141
|
-
label={
|
|
142
|
-
placeholder={
|
|
143
|
+
id={TEXTAREA_ID}
|
|
144
|
+
label={LABEL_TEXT}
|
|
145
|
+
placeholder={PLACEHOLDER_TEXT}
|
|
143
146
|
/>
|
|
144
147
|
);
|
|
145
148
|
|
|
146
149
|
const textarea = screen.getByRole('textbox');
|
|
147
|
-
expect(textarea).toHaveAttribute('placeholder',
|
|
150
|
+
expect(textarea).toHaveAttribute('placeholder', PLACEHOLDER_TEXT);
|
|
148
151
|
});
|
|
149
152
|
|
|
150
153
|
test('textarea with custom rows', () => {
|
|
151
|
-
const
|
|
154
|
+
const ROWS = 2;
|
|
152
155
|
|
|
153
156
|
render(
|
|
154
157
|
<Textarea
|
|
155
|
-
id={
|
|
156
|
-
label={
|
|
157
|
-
rows={
|
|
158
|
+
id={TEXTAREA_ID}
|
|
159
|
+
label={LABEL_TEXT}
|
|
160
|
+
rows={ROWS}
|
|
158
161
|
/>
|
|
159
162
|
);
|
|
160
163
|
|
|
161
164
|
const textarea = screen.getByRole('textbox');
|
|
162
165
|
|
|
163
|
-
expect(textarea).toHaveAttribute('rows', String(
|
|
166
|
+
expect(textarea).toHaveAttribute('rows', String(ROWS));
|
|
164
167
|
});
|
|
165
168
|
|
|
166
169
|
test('textarea with initial value', () => {
|
|
167
|
-
const
|
|
170
|
+
const TEXTAREA_CONTENT = 'Mygov.scot gives people and businesses information about and access to public services in Scotland. We work closely with public sector organisations to make public services easy to find and understand.';
|
|
168
171
|
|
|
169
172
|
render(
|
|
170
173
|
<Textarea
|
|
171
|
-
defaultValue={
|
|
172
|
-
id={
|
|
173
|
-
label={
|
|
174
|
+
defaultValue={TEXTAREA_CONTENT}
|
|
175
|
+
id={TEXTAREA_ID}
|
|
176
|
+
label={LABEL_TEXT}
|
|
174
177
|
/>
|
|
175
178
|
);
|
|
176
179
|
|
|
177
180
|
const textarea = screen.getByRole('textbox');
|
|
178
|
-
expect(textarea.textContent).toEqual(
|
|
181
|
+
expect(textarea.textContent).toEqual(TEXTAREA_CONTENT);
|
|
179
182
|
});
|
|
180
183
|
|
|
181
184
|
test('textarea with error message', () => {
|
|
182
|
-
const
|
|
185
|
+
const ERROR_MESSAGE_TEXT = 'This is a required field';
|
|
186
|
+
|
|
183
187
|
render(
|
|
184
188
|
<Textarea
|
|
185
|
-
id={
|
|
186
|
-
label={
|
|
189
|
+
id={TEXTAREA_ID}
|
|
190
|
+
label={LABEL_TEXT}
|
|
187
191
|
error
|
|
188
|
-
errorMessage={
|
|
192
|
+
errorMessage={ERROR_MESSAGE_TEXT}
|
|
189
193
|
/>
|
|
190
194
|
);
|
|
191
195
|
|
|
192
196
|
const textarea = screen.getByRole('textbox');
|
|
193
|
-
const errorMessageElement = screen.getByText(
|
|
197
|
+
const errorMessageElement = screen.getByText(ERROR_MESSAGE_TEXT);
|
|
194
198
|
|
|
195
199
|
expect(textarea).toHaveClass('ds_input--error')
|
|
196
200
|
expect(textarea).toHaveAttribute('aria-describedby', errorMessageElement.id);
|
|
@@ -202,8 +206,8 @@ test('textarea with error message', () => {
|
|
|
202
206
|
test('passing additional props', () => {
|
|
203
207
|
render(
|
|
204
208
|
<Textarea
|
|
205
|
-
id={
|
|
206
|
-
label={
|
|
209
|
+
id={TEXTAREA_ID}
|
|
210
|
+
label={LABEL_TEXT}
|
|
207
211
|
data-test="foo"
|
|
208
212
|
/>
|
|
209
213
|
);
|
|
@@ -215,8 +219,8 @@ test('passing additional props', () => {
|
|
|
215
219
|
test('passing additional CSS classes', () => {
|
|
216
220
|
render(
|
|
217
221
|
<Textarea
|
|
218
|
-
id={
|
|
219
|
-
label={
|
|
222
|
+
id={TEXTAREA_ID}
|
|
223
|
+
label={LABEL_TEXT}
|
|
220
224
|
className="foo"
|
|
221
225
|
/>
|
|
222
226
|
);
|