@@ -290,7 +294,8 @@ exports[`DefaultManagedIdentity Toggle Interactions should render toggle with ch
class="toggle-label"
>
Set the system-assigned managed identity as default for "test-cosmos-account" by switching it on.
-
+
+
diff --git a/src/Explorer/Controls/Settings/SettingsSubComponents/PartitionKeyComponent.test.tsx b/src/Explorer/Controls/Settings/SettingsSubComponents/PartitionKeyComponent.test.tsx
index c2d5aa8c2..90bae91e2 100644
--- a/src/Explorer/Controls/Settings/SettingsSubComponents/PartitionKeyComponent.test.tsx
+++ b/src/Explorer/Controls/Settings/SettingsSubComponents/PartitionKeyComponent.test.tsx
@@ -1,10 +1,10 @@
-import { render, screen } from "@testing-library/react";
+import { render, screen, waitFor } from "@testing-library/react";
import { DatabaseAccount } from "Contracts/DataModels";
import {
PartitionKeyComponent,
PartitionKeyComponentProps,
} from "Explorer/Controls/Settings/SettingsSubComponents/PartitionKeyComponent";
-import * as useDataTransferJobs from "hooks/useDataTransferJobs";
+import { useDataTransferJobs } from "hooks/useDataTransferJobs";
import React from "react";
import { updateUserContext } from "UserContext";
import { DataTransferJobGetResults } from "Utils/arm/generatedClients/dataTransferService/types";
@@ -19,7 +19,7 @@ jest.mock("Common/dataAccess/dataTransfers", () => ({
}));
jest.mock("hooks/useDataTransferJobs", () => ({
- useDataTransferJobs: () => ({ dataTransferJobs: [] }),
+ useDataTransferJobs: jest.fn(() => ({ dataTransferJobs: [] })),
refreshDataTransferJobs: jest.fn().mockResolvedValue(undefined),
}));
@@ -117,7 +117,7 @@ describe("PartitionKeyComponent", () => {
});
it("shows cancel button for offline job in progress", () => {
- jest.spyOn(useDataTransferJobs, "useDataTransferJobs").mockReturnValue({
+ (useDataTransferJobs as jest.Mock).mockReturnValue({
dataTransferJobs: [mockOfflineJob],
});
@@ -127,13 +127,15 @@ describe("PartitionKeyComponent", () => {
expect(container.querySelector("[data-test='online-job-action-menu']")).toBeNull();
});
- it("shows ellipsis action menu for online job in progress", () => {
- jest.spyOn(useDataTransferJobs, "useDataTransferJobs").mockReturnValue({
+ it("shows ellipsis action menu for online job in progress", async () => {
+ (useDataTransferJobs as jest.Mock).mockReturnValue({
dataTransferJobs: [mockOnlineJob],
});
const { props } = setupTest();
const { container } = render(
);
- expect(container.querySelector("[data-test='online-job-action-menu']")).toBeTruthy();
+ await waitFor(() => {
+ expect(container.querySelector("[data-test='online-job-action-menu']")).toBeTruthy();
+ });
});
});
diff --git a/src/Explorer/Panes/ChangePartitionKeyPane/ChangePartitionKeyPane.tsx b/src/Explorer/Panes/ChangePartitionKeyPane/ChangePartitionKeyPane.tsx
index 21734a344..883566dc5 100644
--- a/src/Explorer/Panes/ChangePartitionKeyPane/ChangePartitionKeyPane.tsx
+++ b/src/Explorer/Panes/ChangePartitionKeyPane/ChangePartitionKeyPane.tsx
@@ -2,7 +2,6 @@ import {
DefaultButton,
DirectionalHint,
Dropdown,
- IChoiceGroupOption,
IDropdownOption,
Icon,
IconButton,
@@ -24,7 +23,7 @@ import { createCollection } from "Common/dataAccess/createCollection";
import { DataTransferParams, initiateDataTransfer } from "Common/dataAccess/dataTransfers";
import * as DataModels from "Contracts/DataModels";
import * as ViewModels from "Contracts/ViewModels";
-import { BackupPolicyType, CopyJobMigrationType } from "Explorer/ContainerCopy/Enums/CopyJobEnums";
+import { BackupPolicyType } from "Explorer/ContainerCopy/Enums/CopyJobEnums";
import {
getPartitionKeyName,
getPartitionKeyPlaceHolder,
@@ -50,33 +49,6 @@ export interface ChangePartitionKeyPaneProps {
onClose: () => Promise
;
}
-const migrationTypeOptions: IChoiceGroupOption[] = [
- {
- key: CopyJobMigrationType.Offline,
- text: t(Keys.containerCopy.migrationType.offline.title),
- styles: { root: { width: "33%" } },
- },
- {
- key: CopyJobMigrationType.Online,
- text: t(Keys.containerCopy.migrationType.online.title),
- styles: { root: { width: "33%" } },
- },
-];
-
-const choiceGroupStyles = {
- flexContainer: { display: "flex" as const },
- root: {
- selectors: {
- ".ms-ChoiceField": {
- color: "var(--colorNeutralForeground1)",
- },
- ".ms-ChoiceField-field:hover .ms-ChoiceFieldLabel": {
- color: "var(--colorNeutralForeground1)",
- },
- },
- },
-};
-
const checkPitrEnabled = (account: DataModels.DatabaseAccount): boolean => {
return account?.properties?.backupPolicy?.type === BackupPolicyType.Continuous;
};