"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.prepopulateConditionalClause = prepopulateConditionalClause;
const EchoStep_1 = __importDefault(require("../../sharedUtils/mablscript/canonical/EchoStep"));
const AssertVariableStep_1 = __importDefault(require("../../sharedUtils/mablscript/canonical/AssertVariableStep"));
const ConditionDescriptor_1 = require("@mablhq/test-model/types/ConditionDescriptor");
const PLACEHOLDER_VARIABLE = {
    name: 'app.test_run_id',
    humanizedName: 'app.test_run_id',
};
async function prepopulateConditionalClause(description, eventHandler) {
    if (!eventHandler.isCurrentBranchInactive()) {
        return;
    }
    const echoStep = new EchoStep_1.default(description);
    echoStep.generateStepId();
    const placeholderStep = new AssertVariableStep_1.default({
        selectionType: 'variable',
        assertionType: ConditionDescriptor_1.AssertionConditionField.Equals,
        expectedValue: 'If branch must be implemented',
        variable: PLACEHOLDER_VARIABLE,
    });
    placeholderStep.generateStepId();
    await eventHandler.dispatchSteps([echoStep, placeholderStep], {
        skipExecution: true,
    });
}
