From adb094574a60114dc272a674760f97e5d99019e3 Mon Sep 17 00:00:00 2001 From: PrasantJillella <127192946+PrasantJillella@users.noreply.github.com> Date: Fri, 4 Aug 2023 15:03:46 -0700 Subject: [PATCH] Moving new tests to bottom of file --- tests/table/apis/table.entity.issues.test.ts | 76 ++++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/tests/table/apis/table.entity.issues.test.ts b/tests/table/apis/table.entity.issues.test.ts index a42766748..3cc1b03f6 100644 --- a/tests/table/apis/table.entity.issues.test.ts +++ b/tests/table/apis/table.entity.issues.test.ts @@ -213,44 +213,6 @@ describe("table Entity APIs test : Issues", () => { await tableClient.deleteTable(); }); - //from issue #2013 - it("Malformed Etag when sent as input throws InvalidInput for table operations, ", async() => { - const partitionKey = createUniquePartitionKey("𤭢PK1"); - const malformedEtag = "MalformedEtag"; - const rowKey = "𐐷RK1" - const tableClient = createAzureDataTablesClient( - testLocalAzuriteInstance, - tableName - ); - - await tableClient.createTable(); - await tableClient.createEntity({ - partitionKey: partitionKey, - rowKey: "𐐷RK1" - }); - - tableClient.deleteEntity( - partitionKey, - rowKey, - { - etag: malformedEtag - } - ).catch((reason) => { - assert.strictEqual(reason.details.errorCode, "InvalidInput"); - assert.strictEqual(reason.statusCode, 400); - }); - - tableClient.updateEntity({ - partitionKey: partitionKey, - rowKey: rowKey, - ifMatch: malformedEtag - }).catch((reason) => { - const storageError = reason as StorageError; - assert.strictEqual(storageError.statusCode, "InvalidInput"); - assert.strictEqual(storageError.storageErrorCode, 400); - }); - }); - // from issue #1214 it("should allow continuation tokens with non-ASCII characters, @loki", async () => { const partitionKey1 = createUniquePartitionKey("𤭢PK1"); @@ -455,4 +417,42 @@ describe("table Entity APIs test : Issues", () => { await tableClient.deleteTable(); }); + + //from issue #2013 + it("Malformed Etag when sent as input throws InvalidInput for table operations, ", async() => { + const partitionKey = createUniquePartitionKey("𤭢PK1"); + const malformedEtag = "MalformedEtag"; + const rowKey = "𐐷RK1" + const tableClient = createAzureDataTablesClient( + testLocalAzuriteInstance, + tableName + ); + + await tableClient.createTable(); + await tableClient.createEntity({ + partitionKey: partitionKey, + rowKey: "𐐷RK1" + }); + + tableClient.deleteEntity( + partitionKey, + rowKey, + { + etag: malformedEtag + } + ).catch((reason) => { + assert.strictEqual(reason.details.errorCode, "InvalidInput"); + assert.strictEqual(reason.statusCode, 400); + }); + + tableClient.updateEntity({ + partitionKey: partitionKey, + rowKey: rowKey, + ifMatch: malformedEtag + }).catch((reason) => { + const storageError = reason as StorageError; + assert.strictEqual(storageError.statusCode, "InvalidInput"); + assert.strictEqual(storageError.storageErrorCode, 400); + }); + }); });