fix tests

This commit is contained in:
Asier Isayas 2025-03-20 13:09:44 -04:00
parent f9e18cf28c
commit 14db9e819a
6 changed files with 15 additions and 6 deletions

View File

@ -171,7 +171,7 @@ export default class SelfServeExample extends SelfServeBaseClass {
public getSelfServeType = (): SelfServeType => {
return SelfServeType.example;
}
};
@Values({
labelTKey: "DescriptionLabel",

View File

@ -362,7 +362,7 @@ export default class GraphAPICompute extends SelfServeBaseClass {
public getSelfServeType = (): SelfServeType => {
return SelfServeType.graphapicompute;
}
};
@Values({
isDynamicDescription: true,

View File

@ -361,7 +361,7 @@ export default class MaterializedViewsBuilder extends SelfServeBaseClass {
public getSelfServeType = (): SelfServeType => {
return SelfServeType.materializedviewsbuilder;
}
};
@Values({
isDynamicDescription: true,

View File

@ -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();

View File

@ -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'",

View File

@ -398,7 +398,7 @@ export default class SqlX extends SelfServeBaseClass {
public getSelfServeType = (): SelfServeType => {
return SelfServeType.sqlx;
}
};
@Values({
isDynamicDescription: true,