From f7967ae70d506e65f4cfc0e75a2fb59f1fafb6dd Mon Sep 17 00:00:00 2001 From: "Hasan.Ahmed" Date: Wed, 5 Aug 2026 16:32:32 +0100 Subject: [PATCH 1/3] fix(devops): correct VITE_PRIVATE_BETA_FEATURE_USER_GROUP2 env var name in pipeline The env var was added in #524 as VITE_PRIVATE_BETA_USER_GROUP2 (missing FEATURE segment), so Vite could not resolve VITE_PRIVATE_BETA_FEATURE_USER_GROUP2 at build time. This caused the transfer-move feature gate to malfunction in production. Also adds the variable to .env.playwright for test coverage. --- devops-pipelines/templates/ui-build-and-deploy-stages.yml | 2 +- ui-spa/.env.playwright | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/devops-pipelines/templates/ui-build-and-deploy-stages.yml b/devops-pipelines/templates/ui-build-and-deploy-stages.yml index c7f08d249..b86603805 100644 --- a/devops-pipelines/templates/ui-build-and-deploy-stages.yml +++ b/devops-pipelines/templates/ui-build-and-deploy-stages.yml @@ -84,7 +84,7 @@ stages: VITE_CLIENT_ID: $(VITE_CLIENT_ID) VITE_TENANT_ID: $(VITE_TENANT_ID) VITE_PRIVATE_BETA_USER_GROUP: $(VITE_PRIVATE_BETA_USER_GROUP) - VITE_PRIVATE_BETA_USER_GROUP2: $(VITE_PRIVATE_BETA_USER_GROUP2) + VITE_PRIVATE_BETA_FEATURE_USER_GROUP2: $(VITE_PRIVATE_BETA_FEATURE_USER_GROUP2) VITE_PRIVATE_BETA_CONTACT_EMAIL: $(VITE_PRIVATE_BETA_CONTACT_EMAIL) VITE_FEATURE_FLAG_TRANSFER_MOVE: $(VITE_FEATURE_FLAG_TRANSFER_MOVE) VITE_FEATURE_FLAG_GLOBAL_NAV: $(VITE_FEATURE_FLAG_GLOBAL_NAV) diff --git a/ui-spa/.env.playwright b/ui-spa/.env.playwright index f0dedf481..21c5465ba 100644 --- a/ui-spa/.env.playwright +++ b/ui-spa/.env.playwright @@ -7,6 +7,7 @@ VITE_MOCK_AUTH="true" VITE_FEATURE_FLAG_CASE_DETAILS=false VITE_FEATURE_FLAG_TRANSFER_MOVE=true VITE_FEATURE_FLAG_DISCONNECT_SHARED_DRIVE=true +VITE_PRIVATE_BETA_FEATURE_USER_GROUP2=test-group-id VITE_FEATURE_FLAG_GLOBAL_NAV=false VITE_FEATURE_FLAG_TRANSFER_MATERIALS_V1=false VITE_GLOBAL_NAV_SCRIPT_URL= From b9285839fa3acfe0c9d33eed52fb71d731d661f0 Mon Sep 17 00:00:00 2001 From: "Hasan.Ahmed" Date: Thu, 6 Aug 2026 11:25:21 +0100 Subject: [PATCH 2/3] FCT2-21225 - fix(transfer-v1): gate Move button on transferMove feature flag TransferControls rendered the Move button whenever transferSource was egress, without checking featureFlags.transferMove. The old screen (NetAppFolderContainer) had this gate but it was never carried over to the v1 screen. Now onMove is only passed when featureFlags.transferMove is true, and TransferControls only renders the button when onMove is defined. Adds unit tests for TransferControls covering all render conditions. --- .../TransferControls.test.tsx | 88 +++++++++++++++++++ .../TransferControls.tsx | 2 +- .../transfer-materials-v1/index.tsx | 12 ++- 3 files changed, 99 insertions(+), 3 deletions(-) create mode 100644 ui-spa/src/components/case-management/transfer-materials-v1/TransferControls.test.tsx diff --git a/ui-spa/src/components/case-management/transfer-materials-v1/TransferControls.test.tsx b/ui-spa/src/components/case-management/transfer-materials-v1/TransferControls.test.tsx new file mode 100644 index 000000000..5c9646ff7 --- /dev/null +++ b/ui-spa/src/components/case-management/transfer-materials-v1/TransferControls.test.tsx @@ -0,0 +1,88 @@ +import { render, screen } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import { describe, it, vi, expect } from "vitest"; +import TransferControls from "./TransferControls"; + +describe("TransferControls", () => { + const defaultProps = { + transferSource: "egress" as const, + disableControls: false, + toggleTransferDirection: vi.fn(), + onCopy: vi.fn(), + }; + + it("renders the Move button when transferSource is egress and onMove is provided", () => { + const onMove = vi.fn(); + render(); + + expect(screen.getByText("Move selected")).toBeInTheDocument(); + }); + + it("does not render the Move button when transferSource is egress but onMove is undefined", () => { + render(); + + expect(screen.queryByText("Move selected")).not.toBeInTheDocument(); + }); + + it("does not render the Move button when transferSource is netapp even if onMove is provided", () => { + const onMove = vi.fn(); + render( + , + ); + + expect(screen.queryByText("Move selected")).not.toBeInTheDocument(); + }); + + it("calls onMove when the Move button is clicked", () => { + const onMove = vi.fn(); + render(); + + userEvent.click(screen.getByText("Move selected")); + expect(onMove).toHaveBeenCalledTimes(1); + }); + + it("disables the Move button when disableControls is true", () => { + const onMove = vi.fn(); + render( + , + ); + + expect(screen.getByText("Move selected")).toBeDisabled(); + }); + + it("always renders the Copy button", () => { + render(); + + expect(screen.getByText("Copy selected")).toBeInTheDocument(); + }); + + it("calls onCopy when the Copy button is clicked", () => { + render(); + + userEvent.click(screen.getByText("Copy selected")); + expect(defaultProps.onCopy).toHaveBeenCalledTimes(1); + }); + + it("shows View Shared Drive link when transferSource is egress", () => { + render(); + + expect(screen.getByText("View Shared Drive")).toBeInTheDocument(); + }); + + it("shows View Egress link when transferSource is netapp", () => { + render(); + + expect(screen.getByText("View Egress")).toBeInTheDocument(); + }); + + it("calls toggleTransferDirection when the direction link is clicked", () => { + render(); + + userEvent.click(screen.getByTestId("toggle-transfer-direction")); + expect(defaultProps.toggleTransferDirection).toHaveBeenCalledTimes(1); + }); +}); diff --git a/ui-spa/src/components/case-management/transfer-materials-v1/TransferControls.tsx b/ui-spa/src/components/case-management/transfer-materials-v1/TransferControls.tsx index cb29ed77d..dc0e48cde 100644 --- a/ui-spa/src/components/case-management/transfer-materials-v1/TransferControls.tsx +++ b/ui-spa/src/components/case-management/transfer-materials-v1/TransferControls.tsx @@ -25,7 +25,7 @@ const TransferControls = ({ > Copy selected - {transferSource === "egress" && ( + {transferSource === "egress" && onMove && (