From 54577a619d4ace69fc88bb39989142c75f0f5591 Mon Sep 17 00:00:00 2001 From: Katie George Date: Tue, 22 Oct 2024 13:22:22 -0700 Subject: [PATCH] chore: Updates broken tests --- .../__snapshots__/test-utils-selectors.test.tsx.snap | 5 +++-- src/internal/components/file-input/index.tsx | 4 +--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/__tests__/__snapshots__/test-utils-selectors.test.tsx.snap b/src/__tests__/__snapshots__/test-utils-selectors.test.tsx.snap index 90591abf2b..5489e25aa7 100644 --- a/src/__tests__/__snapshots__/test-utils-selectors.test.tsx.snap +++ b/src/__tests__/__snapshots__/test-utils-selectors.test.tsx.snap @@ -254,8 +254,6 @@ exports[`test-utils selectors 1`] = ` "awsui_file-option-thumbnail-image_ezgb4", "awsui_hints_1ubbm", "awsui_root_1ubbm", - "awsui_upload-button_4xu1k", - "awsui_upload-input_4xu1k", ], "flashbar": [ "awsui_action-button_1q84n", @@ -336,6 +334,9 @@ exports[`test-utils selectors 1`] = ` "awsui_description_1wepg", "awsui_disabled_15o6u", "awsui_dropdown_qwoo0", + "awsui_file-input-button_181f9", + "awsui_file-input-container_181f9", + "awsui_file-input_181f9", "awsui_filter-container_z5mul", "awsui_filtering-match-highlight_1p2cx", "awsui_handle_sdha6", diff --git a/src/internal/components/file-input/index.tsx b/src/internal/components/file-input/index.tsx index 434920bd6a..ba36558c6d 100644 --- a/src/internal/components/file-input/index.tsx +++ b/src/internal/components/file-input/index.tsx @@ -8,7 +8,6 @@ import { warnOnce } from '@cloudscape-design/component-toolkit/internal'; import InternalButton from '../../../button/internal'; import { useFormFieldContext } from '../../../contexts/form-field'; -import { getBaseProps } from '../../base-component'; import ScreenreaderOnly from '../../components/screenreader-only'; import { fireNonCancelableEvent } from '../../events'; import checkControlled from '../../hooks/check-controlled'; @@ -41,7 +40,6 @@ const InternalFileInput = React.forwardRef( const formFieldContext = useFormFieldContext(restProps); const selfControlId = useUniqueId('upload-input'); const controlId = formFieldContext.controlId ?? selfControlId; - const baseProps = getBaseProps(restProps); useForwardFocus(ref, uploadInputRef); @@ -88,7 +86,7 @@ const InternalFileInput = React.forwardRef( }, [value]); return ( -
+
{/* This is the actual interactive and accessible file-upload element. */} {/* It is visually hidden to achieve the desired UX design. */}