*** Settings ***
Documentation    TDD Issue #932 — plan apply missing --yes flag
...              Integration smoke tests verifying that the apply
...              command accepts the --yes / -y flag required by the
...              specification.  The spec mandates
...              ``agents plan apply [--yes|-y] <PLAN_ID>`` to skip the
...              confirmation prompt.
Resource         ${CURDIR}/common.resource
Suite Setup      Setup Test Environment
Suite Teardown   Cleanup Test Environment

*** Variables ***
${HELPER}    ${CURDIR}/helper_tdd_plan_apply_yes_flag.py

*** Test Cases ***
TDD Plan Apply Yes Long Flag Via CLI
    [Documentation]    Verify that ``apply --yes`` is recognised
    [Tags]  tdd_issue    tdd_issue_932    tdd_issue_4178
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    check-yes-long    cwd=${WORKSPACE}    timeout=120s    on_timeout=kill
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    tdd-plan-apply-yes-flag-long-ok

TDD Plan Apply Yes Short Flag Via CLI
    [Documentation]    Verify that ``apply -y`` is recognised
    [Tags]  tdd_issue    tdd_issue_932    tdd_issue_4178
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    check-yes-short    cwd=${WORKSPACE}    timeout=120s    on_timeout=kill
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    tdd-plan-apply-yes-flag-short-ok
