Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): support custom model json map fn injectionToken #1009

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test(core): import coverage in dynamicFormService
  • Loading branch information
ronherolo committed Aug 18, 2019
commit 23ad5254729665f324287c40ed608b65c4d5d7d5
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,14 @@ describe("DynamicFormService test suite", () => {
expect(formModel[15] instanceof DynamicColorPickerModel).toBe(true);
});


it("should parse dynamic custom control JSON", () => {
const model = { id: 'custom', type: DYNAMIC_FORM_CONTROL_TYPE_CUSTOM },
unknownModel = { id: 'unknownType', type: 'UNKNOWN' };
unknownModel = { id: 'unknownType', type: "UNKNOWN" },
json = JSON.stringify([model]),
formModel = service.fromJSON(json);

expect(formModel[0] instanceof DynamicCustomModel).toBe(true);
expect(service.getCustomComponentModel(model, null)).toBeDefined();
expect(service.getCustomComponentModel(unknownModel, null)).toBeNull();
});
Expand Down