From 0cc2c76f0592ce47b1c1c116355c938eb7d98f31 Mon Sep 17 00:00:00 2001
From: gd2910 <122624946+gd2910@users.noreply.github.com>
Date: Tue, 17 Dec 2024 12:10:28 +0000
Subject: [PATCH] test(react): textfield test
added cypress test and react storybook for autofocus attribute
---
.../component-tests/IcTextField/IcTextField.cy.tsx | 9 +++++++++
.../IcTextField/IcTextFieldTestData.tsx | 14 ++++++++++++++
.../react/src/stories/ic-text-field.stories.mdx | 8 ++++++++
3 files changed, 31 insertions(+)
diff --git a/packages/react/src/component-tests/IcTextField/IcTextField.cy.tsx b/packages/react/src/component-tests/IcTextField/IcTextField.cy.tsx
index b022cf96d8..71aa189d03 100644
--- a/packages/react/src/component-tests/IcTextField/IcTextField.cy.tsx
+++ b/packages/react/src/component-tests/IcTextField/IcTextField.cy.tsx
@@ -21,6 +21,7 @@ import {
} from "../utils/constants";
import {
CustomSizeTextField,
+ AutofocusTextField,
DisabledTextField,
FullWidthTextField,
HiddenLabelTextField,
@@ -333,6 +334,14 @@ describe("IcTextField end-to-end tests", () => {
input.should(HAVE_ATTR, "title", "new-input-title");
});
+
+ it.only("should autofocus when autofocus attribute is set", () => {
+ mount(