From 30e106f6003d9c09fb4bf30c0455ab74b3346555 Mon Sep 17 00:00:00 2001 From: Asier Isayas Date: Fri, 5 Dec 2025 10:00:17 -0800 Subject: [PATCH] clean up tests --- src/Common/dataAccess/createCollection.ts | 10 ---- .../dataAccess/createMaterializedView.ts | 3 -- .../CommandBarComponentButtonFactory.test.ts | 52 ------------------- 3 files changed, 65 deletions(-) diff --git a/src/Common/dataAccess/createCollection.ts b/src/Common/dataAccess/createCollection.ts index 7f531211c..d2a845efc 100644 --- a/src/Common/dataAccess/createCollection.ts +++ b/src/Common/dataAccess/createCollection.ts @@ -95,9 +95,6 @@ const createSqlContainer = async (params: DataModels.CreateCollectionParams): Pr const resource: ARMTypes.SqlContainerResource = { id: params.collectionId, }; - if (params.analyticalStorageTtl) { - resource.analyticalStorageTtl = params.analyticalStorageTtl; - } if (params.indexingPolicy) { resource.indexingPolicy = params.indexingPolicy; } @@ -138,9 +135,6 @@ const createMongoCollection = async (params: DataModels.CreateCollectionParams): const resource: ARMTypes.MongoDBCollectionResource = { id: params.collectionId, }; - if (params.analyticalStorageTtl) { - resource.analyticalStorageTtl = params.analyticalStorageTtl; - } if (params.partitionKey) { const partitionKeyPath: string = params.partitionKey.paths[0]; resource.shardKey = { [partitionKeyPath]: "Hash" }; @@ -179,9 +173,6 @@ const createCassandraTable = async (params: DataModels.CreateCollectionParams): const resource: ARMTypes.CassandraTableResource = { id: params.collectionId, }; - if (params.analyticalStorageTtl) { - resource.analyticalStorageTtl = params.analyticalStorageTtl; - } const rpPayload: ARMTypes.CassandraTableCreateUpdateParameters = { properties: { @@ -282,7 +273,6 @@ const createCollectionWithSDK = async (params: DataModels.CreateCollectionParams partitionKey: params.partitionKey || undefined, indexingPolicy: params.indexingPolicy || undefined, uniqueKeyPolicy: params.uniqueKeyPolicy || undefined, - analyticalStorageTtl: params.analyticalStorageTtl, vectorEmbeddingPolicy: params.vectorEmbeddingPolicy, fullTextPolicy: params.fullTextPolicy, } as ContainerRequest; // TODO: remove cast when https://github.com/Azure/azure-cosmos-js/issues/423 is fixed diff --git a/src/Common/dataAccess/createMaterializedView.ts b/src/Common/dataAccess/createMaterializedView.ts index 659da9c14..71f5869c9 100644 --- a/src/Common/dataAccess/createMaterializedView.ts +++ b/src/Common/dataAccess/createMaterializedView.ts @@ -23,9 +23,6 @@ export const createGlobalSecondaryIndex = async (params: CreateGlobalSecondaryIn if (params.materializedViewDefinition) { resource.materializedViewDefinition = params.materializedViewDefinition; } - if (params.analyticalStorageTtl) { - resource.analyticalStorageTtl = params.analyticalStorageTtl; - } if (params.indexingPolicy) { resource.indexingPolicy = params.indexingPolicy; } diff --git a/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.test.ts b/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.test.ts index 5c0aa7290..73b494190 100644 --- a/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.test.ts +++ b/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.test.ts @@ -14,58 +14,6 @@ describe("CommandBarComponentButtonFactory tests", () => { afterEach(() => useSelectedNode.getState().setSelectedNode(undefined)); - describe("Enable Azure Synapse Link Button", () => { - const enableAzureSynapseLinkBtnLabel = "Enable Azure Synapse Link"; - const selectedNodeState = useSelectedNode.getState(); - - beforeAll(() => { - mockExplorer = {} as Explorer; - updateUserContext({ - databaseAccount: { - properties: { - capabilities: [{ name: "EnableMongo" }], - }, - } as DatabaseAccount, - }); - }); - - // TODO: Now that Tables API supports dataplane RBAC, calling createStaticCommandBarButtons will enable the - // Entra ID Login button, which causes this test to fail due to "Invalid hook call.". This seems to be - // unsupported in jest and needs to be tested with react-hooks-testing-library. - // - // it("Button should not be visible for Tables API", () => { - // updateUserContext({ - // databaseAccount: { - // properties: { - // capabilities: [{ name: "EnableTable" }], - // }, - // } as DatabaseAccount, - // }); - // - // const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer, selectedNodeState); - // const enableAzureSynapseLinkBtn = buttons.find( - // (button) => button.commandButtonLabel === enableAzureSynapseLinkBtnLabel, - // ); - // expect(enableAzureSynapseLinkBtn).toBeUndefined(); - //}); - - it("Button should not be visible for Cassandra API", () => { - updateUserContext({ - databaseAccount: { - properties: { - capabilities: [{ name: "EnableCassandra" }], - }, - } as DatabaseAccount, - }); - - const buttons = CommandBarComponentButtonFactory.createStaticCommandBarButtons(mockExplorer, selectedNodeState); - const enableAzureSynapseLinkBtn = buttons.find( - (button) => button.commandButtonLabel === enableAzureSynapseLinkBtnLabel, - ); - expect(enableAzureSynapseLinkBtn).toBeUndefined(); - }); - }); - describe("Open Cassandra shell button", () => { const openCassandraShellBtnLabel = "Open Cassandra shell"; const selectedNodeState = useSelectedNode.getState();