Skip to content

Commit cba24a1

Browse files
fix(TextArea): added missing modifier class (#11482)
* fix(TextArea): added missing modifier class * Updated remaining snapshots
1 parent 2cadfb9 commit cba24a1

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

packages/react-core/src/components/FileUpload/__tests__/__snapshots__/FileUpload.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ exports[`simple fileupload 1`] = `
7676
class="pf-v6-c-file-upload__file-details"
7777
>
7878
<span
79-
class="pf-v6-c-form-control pf-m-resize-vertical"
79+
class="pf-v6-c-form-control pf-m-textarea pf-m-resize-vertical"
8080
>
8181
<textarea
8282
aria-invalid="false"

packages/react-core/src/components/FileUpload/__tests__/__snapshots__/FileUploadField.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ exports[`simple fileuploadfield 1`] = `
7474
class="pf-v6-c-file-upload__file-details"
7575
>
7676
<span
77-
class="pf-v6-c-form-control pf-m-resize-vertical"
77+
class="pf-v6-c-form-control pf-m-textarea pf-m-resize-vertical"
7878
>
7979
<textarea
8080
aria-invalid="false"

packages/react-core/src/components/TextArea/TextArea.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ class TextAreaBase extends React.Component<TextAreaProps> {
129129
<span
130130
className={css(
131131
styles.formControl,
132+
styles.modifiers.textarea,
132133
readOnlyVariant && styles.modifiers.readonly,
133134
readOnlyVariant === 'plain' && styles.modifiers.plain,
134135
resizeOrientation !== 'none' && styles.modifiers[orientation],

packages/react-core/src/components/TextArea/__tests__/TextArea.test.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,12 @@ test('Text area is not read only by default', () => {
6969
expect(screen.getByRole('textbox')).not.toHaveAttribute('readonly');
7070
});
7171

72-
test('Renders text area with default class name only', () => {
72+
test('Renders text area with default class names only', () => {
7373
render(<TextArea aria-label="validated textarea" />);
74-
expect(screen.getByRole('textbox').parentElement).toHaveClass(formControlStyles.formControl);
74+
75+
const formControlWrapper = screen.getByRole('textbox').parentElement;
76+
expect(formControlWrapper).toHaveClass(formControlStyles.formControl);
77+
expect(formControlWrapper).toHaveClass(formControlStyles.modifiers.textarea);
7578
});
7679

7780
test('Renders validated text area with success className', () => {

packages/react-core/src/components/TextArea/__tests__/__snapshots__/TextArea.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
exports[`Matches the snapshot 1`] = `
44
<DocumentFragment>
55
<span
6-
class="pf-v6-c-form-control pf-m-resize-both pf-m-disabled custom class"
6+
class="pf-v6-c-form-control pf-m-textarea pf-m-resize-both pf-m-disabled custom class"
77
style="height: 6px;"
88
>
99
<textarea

0 commit comments

Comments
 (0)