def test_add_page_component_returning_tuple():
    """Test that a component or render method returning a
    tuple is unpacked in a Fragment.
    """
    app = App()

    def index():
        return rx.text("first"), rx.text("second")

    def page2():
        return (rx.text("third"),)

    app.add_page(index)
    app.add_page(page2)

    app._compile_page("index")
    app._compile_page("page2")

    fragment_wrapper = app._pages["index"].children[0]
    assert isinstance(fragment_wrapper, Fragment)
    first_text = fragment_wrapper.children[0]
    assert isinstance(first_text, Text)
    assert isinstance(first_text.children[0], Bare)
    assert str(first_text.children[0].contents) == '"first"'
    second_text = fragment_wrapper.children[1]
    assert isinstance(second_text, Text)
    assert isinstance(second_text.children[0], Bare)
    assert str(second_text.children[0].contents) == '"second"'

    # Test page with trailing comma.
    page2_fragment_wrapper = app._pages["page2"].children[0]
    assert isinstance(page2_fragment_wrapper, Fragment)
    third_text = page2_fragment_wrapper.children[0]
    assert isinstance(third_text, Text)
    assert isinstance(third_text.children[0], Bare)
    assert str(third_text.children[0].contents) == '"third"'
Test that a component or render method returning a
    tuple is unpacked in a Fragment.
    
tests/units/test_app.py