mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-04-22 09:35:10 +01:00
fix tests
This commit is contained in:
parent
f9e18cf28c
commit
14db9e819a
@ -171,7 +171,7 @@ export default class SelfServeExample extends SelfServeBaseClass {
|
|||||||
|
|
||||||
public getSelfServeType = (): SelfServeType => {
|
public getSelfServeType = (): SelfServeType => {
|
||||||
return SelfServeType.example;
|
return SelfServeType.example;
|
||||||
}
|
};
|
||||||
|
|
||||||
@Values({
|
@Values({
|
||||||
labelTKey: "DescriptionLabel",
|
labelTKey: "DescriptionLabel",
|
||||||
|
@ -362,7 +362,7 @@ export default class GraphAPICompute extends SelfServeBaseClass {
|
|||||||
|
|
||||||
public getSelfServeType = (): SelfServeType => {
|
public getSelfServeType = (): SelfServeType => {
|
||||||
return SelfServeType.graphapicompute;
|
return SelfServeType.graphapicompute;
|
||||||
}
|
};
|
||||||
|
|
||||||
@Values({
|
@Values({
|
||||||
isDynamicDescription: true,
|
isDynamicDescription: true,
|
||||||
|
@ -361,7 +361,7 @@ export default class MaterializedViewsBuilder extends SelfServeBaseClass {
|
|||||||
|
|
||||||
public getSelfServeType = (): SelfServeType => {
|
public getSelfServeType = (): SelfServeType => {
|
||||||
return SelfServeType.materializedviewsbuilder;
|
return SelfServeType.materializedviewsbuilder;
|
||||||
}
|
};
|
||||||
|
|
||||||
@Values({
|
@Values({
|
||||||
isDynamicDescription: true,
|
isDynamicDescription: true,
|
||||||
|
@ -122,7 +122,7 @@ export abstract class SelfServeBaseClass {
|
|||||||
public abstract onRefresh: () => Promise<RefreshResult>;
|
public abstract onRefresh: () => Promise<RefreshResult>;
|
||||||
|
|
||||||
public abstract getSelfServeType: () => SelfServeType;
|
public abstract getSelfServeType: () => SelfServeType;
|
||||||
test: string = "hello"
|
|
||||||
/**@internal */
|
/**@internal */
|
||||||
public toSelfServeDescriptor(): SelfServeDescriptor {
|
public toSelfServeDescriptor(): SelfServeDescriptor {
|
||||||
const className: string = this.getSelfServeType();
|
const className: string = this.getSelfServeType();
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
import { NumberUiType, OnSaveResult, RefreshResult, SelfServeBaseClass, SmartUiInput } from "./SelfServeTypes";
|
import { NumberUiType, OnSaveResult, RefreshResult, SelfServeBaseClass, SmartUiInput } from "./SelfServeTypes";
|
||||||
import { DecoratorProperties, mapToSmartUiDescriptor, updateContextWithDecorator } from "./SelfServeUtils";
|
import {
|
||||||
|
DecoratorProperties,
|
||||||
|
mapToSmartUiDescriptor,
|
||||||
|
SelfServeType,
|
||||||
|
updateContextWithDecorator,
|
||||||
|
} from "./SelfServeUtils";
|
||||||
|
|
||||||
describe("SelfServeUtils", () => {
|
describe("SelfServeUtils", () => {
|
||||||
it("initialize should be declared for self serve classes", () => {
|
it("initialize should be declared for self serve classes", () => {
|
||||||
@ -7,6 +12,7 @@ describe("SelfServeUtils", () => {
|
|||||||
public initialize: () => Promise<Map<string, SmartUiInput>>;
|
public initialize: () => Promise<Map<string, SmartUiInput>>;
|
||||||
public onSave: (currentValues: Map<string, SmartUiInput>) => Promise<OnSaveResult>;
|
public onSave: (currentValues: Map<string, SmartUiInput>) => Promise<OnSaveResult>;
|
||||||
public onRefresh: () => Promise<RefreshResult>;
|
public onRefresh: () => Promise<RefreshResult>;
|
||||||
|
public getSelfServeType: () => SelfServeType;
|
||||||
}
|
}
|
||||||
expect(() => new Test().toSelfServeDescriptor()).toThrow("initialize() was not declared for the class 'Test'");
|
expect(() => new Test().toSelfServeDescriptor()).toThrow("initialize() was not declared for the class 'Test'");
|
||||||
});
|
});
|
||||||
@ -16,6 +22,7 @@ describe("SelfServeUtils", () => {
|
|||||||
public initialize = jest.fn();
|
public initialize = jest.fn();
|
||||||
public onSave: () => Promise<OnSaveResult>;
|
public onSave: () => Promise<OnSaveResult>;
|
||||||
public onRefresh: () => Promise<RefreshResult>;
|
public onRefresh: () => Promise<RefreshResult>;
|
||||||
|
public getSelfServeType: () => SelfServeType;
|
||||||
}
|
}
|
||||||
expect(() => new Test().toSelfServeDescriptor()).toThrow("onSave() was not declared for the class 'Test'");
|
expect(() => new Test().toSelfServeDescriptor()).toThrow("onSave() was not declared for the class 'Test'");
|
||||||
});
|
});
|
||||||
@ -25,6 +32,7 @@ describe("SelfServeUtils", () => {
|
|||||||
public initialize = jest.fn();
|
public initialize = jest.fn();
|
||||||
public onSave = jest.fn();
|
public onSave = jest.fn();
|
||||||
public onRefresh: () => Promise<RefreshResult>;
|
public onRefresh: () => Promise<RefreshResult>;
|
||||||
|
public getSelfServeType: () => SelfServeType;
|
||||||
}
|
}
|
||||||
expect(() => new Test().toSelfServeDescriptor()).toThrow("onRefresh() was not declared for the class 'Test'");
|
expect(() => new Test().toSelfServeDescriptor()).toThrow("onRefresh() was not declared for the class 'Test'");
|
||||||
});
|
});
|
||||||
@ -34,6 +42,7 @@ describe("SelfServeUtils", () => {
|
|||||||
public initialize = jest.fn();
|
public initialize = jest.fn();
|
||||||
public onSave = jest.fn();
|
public onSave = jest.fn();
|
||||||
public onRefresh = jest.fn();
|
public onRefresh = jest.fn();
|
||||||
|
public getSelfServeType = jest.fn();
|
||||||
}
|
}
|
||||||
expect(() => new Test().toSelfServeDescriptor()).toThrow(
|
expect(() => new Test().toSelfServeDescriptor()).toThrow(
|
||||||
"@IsDisplayable decorator was not declared for the class 'Test'",
|
"@IsDisplayable decorator was not declared for the class 'Test'",
|
||||||
|
@ -398,7 +398,7 @@ export default class SqlX extends SelfServeBaseClass {
|
|||||||
|
|
||||||
public getSelfServeType = (): SelfServeType => {
|
public getSelfServeType = (): SelfServeType => {
|
||||||
return SelfServeType.sqlx;
|
return SelfServeType.sqlx;
|
||||||
}
|
};
|
||||||
|
|
||||||
@Values({
|
@Values({
|
||||||
isDynamicDescription: true,
|
isDynamicDescription: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user