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