@tsed/formio
Version:
Formio package for Ts.ED framework
26 lines (18 loc) • 670 B
text/typescript
import {JsonParameterStore} from "@tsed/schema";
import {ActionCtx} from "./actionCtx.js";
describe("@ActionCtx", () => {
it("should inject ActionCtx", () => {
class CustomAction {
resolve(() actionCtx: ActionCtx) {}
}
const param = JsonParameterStore.get(CustomAction, "resolve", 0);
expect(param.expression).toEqual("ACTION_CTX");
});
it("should inject ActionCtx (with expression)", () => {
class CustomAction {
resolve(("handler") actionCtx: ActionCtx) {}
}
const param = JsonParameterStore.get(CustomAction, "resolve", 0);
expect(param.expression).toEqual("ACTION_CTX.handler");
});
});