diff --git a/src/fastapi_cloud_cli/commands/ci/print_workflow.py b/src/fastapi_cloud_cli/commands/ci/print_workflow.py index 89d212c2..8e593cb7 100644 --- a/src/fastapi_cloud_cli/commands/ci/print_workflow.py +++ b/src/fastapi_cloud_cli/commands/ci/print_workflow.py @@ -20,7 +20,7 @@ class CIWorkflowOutput(BaseModel): def _render_workflow_output(data: CIWorkflowOutput, toolkit: RichToolkit) -> None: - toolkit.console.print(data.content, markup=False, end="") + toolkit.console.print(data.content, markup=False, end="", soft_wrap=True) @ci_app.command("print-workflow") diff --git a/tests/test_cli_ci.py b/tests/test_cli_ci.py index 10cff5a4..fa44453f 100644 --- a/tests/test_cli_ci.py +++ b/tests/test_cli_ci.py @@ -42,11 +42,14 @@ def test_print_workflow_uses_default_branch() -> None: assert result.stderr == "" -def test_print_workflow_uses_branch_option() -> None: - result = runner.invoke(app, ["ci", "print-workflow", "--branch", "main"]) +@pytest.mark.parametrize("branch", ["main", "feature/" + "long-branch-name-" * 8]) +def test_print_workflow_uses_branch_option(branch: str) -> None: + result = runner.invoke( + app, ["ci", "print-workflow", "--branch", branch], env={"COLUMNS": "80"} + ) assert result.exit_code == 0 - assert result.stdout == _get_workflow_content("main") + assert result.stdout == _get_workflow_content(branch) assert result.stderr == ""