Skip to content

Commit

Permalink
Moving new tests to bottom of file
Browse files Browse the repository at this point in the history
  • Loading branch information
PrasantJillella committed Aug 14, 2023
1 parent a6a3d72 commit adb0945
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions tests/table/apis/table.entity.issues.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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);
});
});
});

0 comments on commit adb0945

Please sign in to comment.