Resolve ESlint Errors (#932)

This commit is contained in:
Hardikkumar Nai
2021-07-13 09:08:16 +05:30
committed by GitHub
parent 854bd2c149
commit 71113e403e
13 changed files with 81 additions and 179 deletions

View File

@@ -5,23 +5,19 @@ import * as ViewModels from "../Contracts/ViewModels";
import * as QueryUtils from "./QueryUtils";
describe("Query Utils", () => {
function generatePartitionKeyForPath(path: string): DataModels.PartitionKey {
const generatePartitionKeyForPath = (path: string): DataModels.PartitionKey => {
return {
paths: [path],
kind: "Hash",
version: 2,
};
}
};
describe("buildDocumentsQueryPartitionProjections()", () => {
it("should return empty string if partition key is undefined", () => {
expect(QueryUtils.buildDocumentsQueryPartitionProjections("c", undefined)).toBe("");
});
it("should return empty string if partition key is null", () => {
expect(QueryUtils.buildDocumentsQueryPartitionProjections("c", null)).toBe("");
});
it("should replace slashes and embed projection in square braces", () => {
const partitionKey: DataModels.PartitionKey = generatePartitionKeyForPath("/a");
const partitionProjection: string = QueryUtils.buildDocumentsQueryPartitionProjections("c", partitionKey);