"""Tests for help text epilogs."""

from __future__ import annotations

import pytest
from typer.testing import CliRunner

from ilum.cli.main import app


@pytest.fixture()
def runner() -> CliRunner:
    return CliRunner()


class TestHelpEpilogs:
    def test_quickstart_help_shows_examples(self, runner: CliRunner) -> None:
        result = runner.invoke(app, ["quickstart", "--help"])
        assert result.exit_code == 0
        assert "Examples" in result.output
        assert "--provider k3d" in result.output

    def test_install_help_shows_examples(self, runner: CliRunner) -> None:
        result = runner.invoke(app, ["install", "--help"])
        assert result.exit_code == 0
        assert "Examples" in result.output
        assert "--preset tiny" in result.output

    def test_upgrade_help_shows_examples(self, runner: CliRunner) -> None:
        result = runner.invoke(app, ["upgrade", "--help"])
        assert result.exit_code == 0
        assert "Examples" in result.output
        assert "--force-rollback" in result.output

    def test_status_help_shows_examples(self, runner: CliRunner) -> None:
        result = runner.invoke(app, ["status", "--help"])
        assert result.exit_code == 0
        assert "Examples" in result.output
        assert "--wait" in result.output

    def test_module_enable_help_shows_examples(self, runner: CliRunner) -> None:
        result = runner.invoke(app, ["module", "enable", "--help"])
        assert result.exit_code == 0
        assert "Examples" in result.output
        assert "ilum module enable jupyter" in result.output

    def test_module_disable_help_shows_examples(self, runner: CliRunner) -> None:
        result = runner.invoke(app, ["module", "disable", "--help"])
        assert result.exit_code == 0
        assert "Examples" in result.output
        assert "ilum module disable jupyter" in result.output

    def test_access_open_help_shows_examples(self, runner: CliRunner) -> None:
        result = runner.invoke(app, ["access", "open", "--help"])
        assert result.exit_code == 0
        assert "Examples" in result.output
        assert "--no-browser" in result.output
