"""Tests for visual-only nodes (Group, Comment)."""

import pytest

from fw_nodes_core.nodes.comment import CommentNode
from fw_nodes_core.nodes.group import GroupNode


class TestGroupNode:
    """Test Group node metadata and skip behavior."""

    def test_skip_execution_flag(self):
        """Group node should be marked as skip_execution."""
        node = GroupNode()
        assert node.metadata.skip_execution is True

    def test_no_handles(self):
        """Group node should have no input or output handles."""
        node = GroupNode()
        assert node.metadata.handles.inputs == []
        assert node.metadata.handles.outputs == []

    def test_display_component(self):
        """Group node should use the group display component."""
        node = GroupNode()
        assert node.metadata.display_component == "group"

    def test_metadata(self):
        """Group node should have correct metadata."""
        node = GroupNode()
        assert node.metadata.name == "Group"
        assert node.metadata.category == "utility"

    @pytest.mark.asyncio
    async def test_execute_returns_empty(self, node_execution_context):
        """Group node execute should return empty dict (no-op)."""
        node = GroupNode()
        result = await node.execute({}, node_execution_context)
        assert result is not None


class TestCommentNode:
    """Test Comment node metadata and skip behavior."""

    def test_skip_execution_flag(self):
        """Comment node should be marked as skip_execution."""
        node = CommentNode()
        assert node.metadata.skip_execution is True

    def test_no_handles(self):
        """Comment node should have no input or output handles."""
        node = CommentNode()
        assert node.metadata.handles.inputs == []
        assert node.metadata.handles.outputs == []

    def test_display_component(self):
        """Comment node should use the comment display component."""
        node = CommentNode()
        assert node.metadata.display_component == "comment"

    def test_metadata(self):
        """Comment node should have correct metadata."""
        node = CommentNode()
        assert node.metadata.name == "Comment"
        assert node.metadata.category == "utility"

    @pytest.mark.asyncio
    async def test_execute_returns_empty(self, node_execution_context):
        """Comment node execute should return empty dict (no-op)."""
        node = CommentNode()
        result = await node.execute({}, node_execution_context)
        assert result is not None
