import pytest

from src.domain.prompt_suggestions.service import PromptSuggestionService


@pytest.mark.asyncio
async def test_prompt_suggestion_matching_supports_full_request_text():
    class FakeRepo:
        async def list(self, *, active_only=False):
            from types import SimpleNamespace

            return [
                SimpleNamespace(
                    project_types=["nuxt_app"],
                    excluded_keywords=[],
                    required_keywords=[],
                    is_fallback=False,
                    matching_keywords=["ecommerce"],
                )
            ]

    service = PromptSuggestionService.__new__(PromptSuggestionService)
    service.repo = FakeRepo()
    result = await service.suggest_for_text(
        "Build an ecommerce shop with checkout", "nuxt_app"
    )
    assert len(result) == 1
