PromucFlow_constructor/app/client/src/components/propertyControls/SwitchControl.test.tsx

30 lines
841 B
TypeScript
Raw Normal View History

import SwitchControl from "./SwitchControl";
const requiredParams = {
evaluatedValue: undefined,
widgetProperties: undefined,
parentPropertyName: "",
parentPropertyValue: undefined,
additionalDynamicData: {},
label: "",
propertyName: "",
controlType: "",
isBindProperty: false,
isTriggerProperty: false,
};
const config = { ...requiredParams };
describe("SwitchControl.canDisplayValue", () => {
it("Should return true when 'true' or 'false' is passed", () => {
expect(SwitchControl.canDisplayValueInUI(config, "true")).toEqual(true);
expect(SwitchControl.canDisplayValueInUI(config, "false")).toEqual(true);
});
it("Should return false when a value other than 'true' or 'false' is passed", () => {
expect(SwitchControl.canDisplayValueInUI(config, "{{true}}")).toEqual(
false,
);
});
});