This is an automated email from the ASF dual-hosted git repository.
bbovenzi pushed a commit to branch v3-4-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-4-test by this push:
new af57a7a6a73 [v3-4-test] Wait for variable form validation before
asserting Save is enabled (#75239) (#75353)
af57a7a6a73 is described below
commit af57a7a6a73038e02669fa4e703ee912155694aa
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Oct 22 12:11:18 2026 -0400
[v3-4-test] Wait for variable form validation before asserting Save is
enabled (#75239) (#75353)
Rendering the JSON warning does not wait for asynchronous form validity
updates, so the submission tests can race the disabled Save button.
(cherry picked from commit 92a9e5aad39ee372797c4676b94949c0eec2bd22)
Co-authored-by: Himanshu Chawla <[email protected]>
Co-authored-by: Himanshu Chawla
<[email protected]>
---
.../ui/src/pages/Variables/ManageVariable/VariableForm.test.tsx | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git
a/airflow-core/src/airflow/ui/src/pages/Variables/ManageVariable/VariableForm.test.tsx
b/airflow-core/src/airflow/ui/src/pages/Variables/ManageVariable/VariableForm.test.tsx
index 70b4e0b09e9..3d310338bda 100644
---
a/airflow-core/src/airflow/ui/src/pages/Variables/ManageVariable/VariableForm.test.tsx
+++
b/airflow-core/src/airflow/ui/src/pages/Variables/ManageVariable/VariableForm.test.tsx
@@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
+import "@testing-library/jest-dom/vitest";
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
@@ -56,7 +57,7 @@ describe("VariableForm", () => {
fireEvent.change(screen.getByLabelText(/value/iu), { target: { value:
'{"enabled": true,' } });
await waitFor(() =>
expect(screen.getByText(/variables\.form\.invalidJson/u)).toBeInTheDocument());
- expect(screen.getByRole("button", { name: /save/iu })).toBeEnabled();
+ await waitFor(() => expect(screen.getByRole("button", { name: /save/iu
})).toBeEnabled());
fireEvent.click(screen.getByRole("button", { name: /save/iu }));
@@ -74,7 +75,7 @@ describe("VariableForm", () => {
fireEvent.change(screen.getByLabelText(/value/iu), { target: { value:
"[DRAFT] plain string value" } });
await waitFor(() =>
expect(screen.getByText(/variables\.form\.invalidJson/u)).toBeInTheDocument());
- expect(screen.getByRole("button", { name: /save/iu })).toBeEnabled();
+ await waitFor(() => expect(screen.getByRole("button", { name: /save/iu
})).toBeEnabled());
fireEvent.click(screen.getByRole("button", { name: /save/iu }));
@@ -92,7 +93,7 @@ describe("VariableForm", () => {
fireEvent.change(screen.getByLabelText(/value/iu), { target: { value: "{{
var.value.x }}" } });
await waitFor(() =>
expect(screen.getByText(/variables\.form\.invalidJson/u)).toBeInTheDocument());
- expect(screen.getByRole("button", { name: /save/iu })).toBeEnabled();
+ await waitFor(() => expect(screen.getByRole("button", { name: /save/iu
})).toBeEnabled());
fireEvent.click(screen.getByRole("button", { name: /save/iu }));