/**
 * Rule: form-shows-required-indicators
 *
 * For every attribute marked `required`, the model's form view
 * should expose a visible input or field label. v1 uses a loose
 * text-presence check; the harness helper can be tightened later
 * to verify a specific required marker (asterisk, aria-required,
 * "required" text, etc.).
 *
 * One TestCase per (model, required-attribute) pair.
 */
export const RULE_ID = 'form-shows-required-indicators';
export const formShowsRequiredIndicators = (spec) => {
    const cases = [];
    for (const model of spec.models) {
        const attrs = model.attributes || [];
        for (const attr of attrs) {
            if (!attr.required)
                continue;
            // Skip metadata attributes — they're system-managed (id, createdAt)
            // and shouldn't appear in a user-facing form.
            if (attr.category === 'metadata')
                continue;
            cases.push({
                ruleId: RULE_ID,
                specElement: `${model.name}.${attr.name}`,
                name: `[${RULE_ID}] ${model.name}.${attr.name} is shown as a required input`,
                steps: [
                    { action: 'bootRuntime' },
                    { action: 'navigateToModelForm', modelName: model.name },
                    { action: 'expectFormInput', modelName: model.name, attributeName: attr.name, required: true },
                ],
            });
        }
    }
    return cases;
};
//# sourceMappingURL=form-shows-required-indicators.js.map