mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 09:20:16 +00:00
Resolve ESlint Errors (#932)
This commit is contained in:
@@ -18,7 +18,7 @@ describe("PricingUtils Tests", () => {
|
||||
});
|
||||
|
||||
it("should return false if passed number is not number", () => {
|
||||
const value = PricingUtils.isLargerThanDefaultMinRU(null);
|
||||
const value = PricingUtils.isLargerThanDefaultMinRU(undefined);
|
||||
expect(value).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -28,7 +28,7 @@ describe("PricingUtils Tests", () => {
|
||||
const value = PricingUtils.computeRUUsagePriceHourly({
|
||||
serverId: "default",
|
||||
requestUnits: 1,
|
||||
numberOfRegions: null,
|
||||
numberOfRegions: undefined,
|
||||
multimasterEnabled: false,
|
||||
isAutoscale: false,
|
||||
});
|
||||
@@ -38,7 +38,7 @@ describe("PricingUtils Tests", () => {
|
||||
const value = PricingUtils.computeRUUsagePriceHourly({
|
||||
serverId: "default",
|
||||
requestUnits: 1,
|
||||
numberOfRegions: null,
|
||||
numberOfRegions: undefined,
|
||||
multimasterEnabled: false,
|
||||
isAutoscale: true,
|
||||
});
|
||||
@@ -264,11 +264,6 @@ describe("PricingUtils Tests", () => {
|
||||
|
||||
describe("getRegionMultiplier()", () => {
|
||||
describe("without multimaster", () => {
|
||||
it("should return 0 for null", () => {
|
||||
const value = PricingUtils.getRegionMultiplier(null, false);
|
||||
expect(value).toBe(0);
|
||||
});
|
||||
|
||||
it("should return 0 for undefined", () => {
|
||||
const value = PricingUtils.getRegionMultiplier(undefined, false);
|
||||
expect(value).toBe(0);
|
||||
@@ -296,11 +291,6 @@ describe("PricingUtils Tests", () => {
|
||||
});
|
||||
|
||||
describe("with multimaster", () => {
|
||||
it("should return 0 for null", () => {
|
||||
const value = PricingUtils.getRegionMultiplier(null, true);
|
||||
expect(value).toBe(0);
|
||||
});
|
||||
|
||||
it("should return 0 for undefined", () => {
|
||||
const value = PricingUtils.getRegionMultiplier(undefined, true);
|
||||
expect(value).toBe(0);
|
||||
@@ -450,11 +440,6 @@ describe("PricingUtils Tests", () => {
|
||||
});
|
||||
|
||||
describe("normalizeNumberOfRegions()", () => {
|
||||
it("should return 0 for null", () => {
|
||||
const value = PricingUtils.normalizeNumber(null);
|
||||
expect(value).toBe(0);
|
||||
});
|
||||
|
||||
it("should return 0 for undefined", () => {
|
||||
const value = PricingUtils.normalizeNumber(undefined);
|
||||
expect(value).toBe(0);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user