* Updated Typescript types. * Typefixes after merge with release. * chore: GenericApiResponse Removed alltogether. * chore: resolved ApiResponse unknown errors removed PageListPayload. * Added shouldBeDefined. * fix: Resolved type errors. * fix: Typescript upgrade to 4.5 and type fixes. * feat: upgrade to cra 5 * feat: uncomment service worker registeration * force secure websocket protocol * jest test fixes * fix: react function lint rule removed * fix: klona test case. * fix: typescirpt issues resolved * fix: timeout for colorpicker test and change env. * feat: update client-build.yml file * fix: remove brotliplugin use compression plugin * fix: build config fixed * fix: upgrade webpack plugin * fix: add branchbutton test to todo. * fix: remove branch button test. * fix: Add tailwind theme values, fix cypress tests * fix: Typescript type fixes. * feat: run jest tests in silent mode * fix: cypress rgb values add branchbutton jest test * fix: review comments, fixes for error.message * fix: increase cache size for the workbox * fix: remove OrgApi.ts file * fix: cypress.json file remove credentials * fix: downgrade react and react-dom packages Co-authored-by: rahulramesha <rahul@appsmith.com>
61 lines
2.6 KiB
TypeScript
61 lines
2.6 KiB
TypeScript
import StepControl from "./StepControl";
|
|
|
|
const requiredParams = {
|
|
evaluatedValue: undefined,
|
|
widgetProperties: undefined,
|
|
parentPropertyName: "",
|
|
parentPropertyValue: undefined,
|
|
additionalDynamicData: {},
|
|
label: "",
|
|
propertyName: "",
|
|
controlType: "",
|
|
isBindProperty: false,
|
|
isTriggerProperty: false,
|
|
};
|
|
|
|
const config = { ...requiredParams };
|
|
|
|
describe("StepControl.canDisplayValue", () => {
|
|
it("Checks for true cases for default value of stepType", () => {
|
|
// @ts-expect-error: config does not have all keys
|
|
expect(StepControl.canDisplayValueInUI(config, 1)).toEqual(true);
|
|
// @ts-expect-error: config does not have all keys
|
|
expect(StepControl.canDisplayValueInUI(config, 9)).toEqual(true);
|
|
// @ts-expect-error: config does not have all keys
|
|
expect(StepControl.canDisplayValueInUI(config, 5)).toEqual(true);
|
|
// @ts-expect-error: config does not have all keys
|
|
expect(StepControl.canDisplayValueInUI(config, 75)).toEqual(true);
|
|
// @ts-expect-error: config does not have all keys
|
|
expect(StepControl.canDisplayValueInUI(config, 25)).toEqual(true);
|
|
});
|
|
|
|
it("Checks for false cases for default value of stepType", () => {
|
|
// @ts-expect-error: config does not have all keys
|
|
expect(StepControl.canDisplayValueInUI(config, -4)).toEqual(false);
|
|
// @ts-expect-error: config does not have all keys
|
|
expect(StepControl.canDisplayValueInUI(config, 105)).toEqual(false);
|
|
});
|
|
|
|
it("Checks for true cases for 'ZOOM_PERCENTAGE' value of stepType", () => {
|
|
const config = { ...requiredParams, stepType: "ZOOM_PERCENTAGE" };
|
|
// @ts-expect-error: config does not have all keys
|
|
expect(StepControl.canDisplayValueInUI(config, 5)).toEqual(true);
|
|
// @ts-expect-error: config does not have all keys
|
|
expect(StepControl.canDisplayValueInUI(config, 75)).toEqual(true);
|
|
// @ts-expect-error: config does not have all keys
|
|
expect(StepControl.canDisplayValueInUI(config, 25)).toEqual(true);
|
|
});
|
|
|
|
it("Checks for false cases for 'ZOOM_PERCENTAGE' value of stepType", () => {
|
|
const config = { ...requiredParams, stepType: "ZOOM_PERCENTAGE" };
|
|
// @ts-expect-error: config does not have all keys
|
|
expect(StepControl.canDisplayValueInUI(config, 1)).toEqual(false);
|
|
// @ts-expect-error: config does not have all keys
|
|
expect(StepControl.canDisplayValueInUI(config, 9)).toEqual(false);
|
|
// @ts-expect-error: config does not have all keys
|
|
expect(StepControl.canDisplayValueInUI(config, -4)).toEqual(false);
|
|
// @ts-expect-error: config does not have all keys
|
|
expect(StepControl.canDisplayValueInUI(config, 105)).toEqual(false);
|
|
});
|
|
});
|