*** Settings ***
Documentation    TDD Issue #783 — agents init --yes should not require user input
...              Integration smoke tests verifying that the ``init --yes`` command
...              completes without blocking for user input.  Bug #783 reports that
...              the migration runner still prompts for approval even with ``--yes``.
Resource         ${CURDIR}/common.resource
Suite Setup      Setup Test Environment    auto_apply_migrations=${FALSE}
Suite Teardown   Cleanup Test Environment

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

*** Test Cases ***
TDD Init Yes No Input Completes Without Stdin
    [Documentation]    Verify that ``init --yes`` exits successfully without any
    ...                stdin input.  The helper runs the real CLI init command in
    ...                a fresh directory with stdin closed.
    [Tags]  tdd_issue    tdd_issue_783    tdd_issue_4178
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    init-no-stdin    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-init-yes-no-input-ok

TDD Init Yes No Migration Prompt
    [Documentation]    Verify that ``init --yes`` output does not contain the
    ...                migration approval prompt text.
    [Tags]  tdd_issue    tdd_issue_783    tdd_issue_4178
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    init-no-prompt    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-init-yes-no-prompt-ok
