"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ValueTableTester = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const XExecutableTester_1 = require("../XExecutableTester");
const TestDataSetup_1 = require("../../../Rule/Table/ValueTable/Testing/TestDataSetup");
const StoryData_1 = require("../../StoryBook/StoryData");
const LogicData_1 = require("../../../Expressions/Testing/LogicData");
const DataTestData_1 = require("@appglue/common/dist/Common/Data/DataTestData");
const BooleanDataDefinition_1 = require("@appglue/common/dist/Common/Data/Definitions/BooleanDataDefinition");
exports.ValueTableTester = [
    new StoryData_1.StoryNode(() => {
        let ruleDefinition = (0, TestDataSetup_1.getValueTableWithDeferentType)();
        return (0, jsx_runtime_1.jsx)(XExecutableTester_1.XExecutableTester, { executable: ruleDefinition });
    }, "Test UI", "Value Table", "Default"),
    new StoryData_1.StoryNode(() => {
        let ruleDefinition = (0, TestDataSetup_1.getValueTableWithDeferentType)();
        return (0, jsx_runtime_1.jsx)(XExecutableTester_1.XExecutableTester, { executable: ruleDefinition });
    }, "Test UI", "Value Table", "Default"),
    new StoryData_1.StoryNode(() => {
        let ruleDefinition = (0, TestDataSetup_1.getValueTableWithDeferentType)();
        ruleDefinition.rows[1].cells[0].values = ["James Bond", "Jose Chachin", "Fred Williams"];
        return (0, jsx_runtime_1.jsx)(XExecutableTester_1.XExecutableTester, { executable: ruleDefinition });
    }, "Test UI", "Value Table", "Multiple Values"),
    new StoryData_1.StoryNode(() => {
        let ruleDefinition = (0, TestDataSetup_1.getValueTableWithDeferentType)();
        ruleDefinition.columns[1].columnName = "isMarried";
        ruleDefinition.columns[1].expression.expression = (0, LogicData_1.getIfElseSimpleRule)().expression;
        let idatadef = (0, DataTestData_1.getFilledDataDefinition)();
        idatadef.fields.push(new BooleanDataDefinition_1.BooleanDataDefinition("isEmployee"));
        ruleDefinition.columns[1].expression.expression.ifBranches[1].ifExpression.elements[0].variableName = "cellValue";
        ruleDefinition.inputData = () => idatadef;
        return (0, jsx_runtime_1.jsx)(XExecutableTester_1.XExecutableTester, { executable: ruleDefinition });
    }, "Test UI", "Value Table", "If Then"),
];
//# sourceMappingURL=XExecutableTester.ValueTable-stories.js.map