Repository: plotly/dash
File: tests/integration/multi_page/test_pages_order.py (Python)

Code before:
            f"multi_layout{order_int + 1}",
            layout=html.Div(
                f"text for multi_layout{order_int + 1}",
                id=f"text_multi_layout{order_int + 1}",
            ),
            order=order_int,
            id=f"multi_layout{order_int + 1}",
        )
    # Test fractional ordering
    dash.register_page(
        "multi_layout3.5",
        layout=html.Div("text for multi_layout3.5", id="text_multi_layout3.5"),
        order=3.5,
        id="multi_layout3.5",
    )
    # Test no order given
    dash.register_page(
        "multi_layout14",
        layout=html.Div("text for multi_layout14", id="text_multi_layout14"),
        id="multi_layout14",
    )
    dash.register_page(
        "multi_layout15",
        layout=html.Div("text for multi_layout15", id="text_multi_layout15"),
        id="multi_layout15",
    )

    app.layout = html.Div(
        [
            html.Div(
                [
                    html.Div(
                        dcc.Link(
                            f"{page['name']} - {page['path']}",
                            id=page["id"],
                            href=page["path"],
                        )
                    )
                    for page in dash.page_registry.values()
                ]
            ),
            dash.page_container,
            dcc.Location(id="url", refresh=True),
        ]
    )

    modules = [
        "multi_layout3",
        "multi_layout2",
        "multi_layout1",
        "multi_layout4",

Review comment (bug):
This is great, thanks for adding these test pages. Just two tweaks to ensure we're covering all the edge cases we've identified:
- Provide a string for `order`, that would have come before some of the numbers using the previous "stringify everything" sort. Perhaps `order="2a"`?
- Provide a `module` for a page with no `order` that would have come before another page with a string `order`. I don't know if you can have a `module` that's not a valid Python identifier (ie starting with a number), maybe safer to do this by adding two more pages, one with `module="yyy", order="zzz"` and another with just `module="aaa"`

Code after:
            f"multi_layout{order_int + 1}",
            layout=html.Div(
                f"text for multi_layout{order_int + 1}",
                id=f"text_multi_layout{order_int + 1}",
            ),
            order=order_int,
            id=f"multi_layout{order_int + 1}",
        )
    # Test fractional ordering
    dash.register_page(
        "multi_layout3.5",
        layout=html.Div("text for multi_layout3.5", id="text_multi_layout3.5"),
        order=3.5,
        id="multi_layout3.5",
    )
    # Test no order given
    dash.register_page(
        "multi_layout14",
        layout=html.Div("text for multi_layout14", id="text_multi_layout14"),
        id="multi_layout14",
    )
    dash.register_page(
        "multi_layout15",
        layout=html.Div("text for multi_layout15", id="text_multi_layout15"),
        id="multi_layout15",
    )
    # Test string for order
    dash.register_page(
        "first_string_order",
        layout=html.Div("text for string_order", id="text_string_order"),
        order="2a",
        id="first_string_order",
    )
    dash.register_page(
        "aaa_first_with_no_order",
        layout=html.Div("text for aaa", id="text_aaa"),
        id="aaa_first_with_no_order",
    )
    dash.register_page(
        "yyy_last_string_order",
        layout=html.Div("text for yyy", id="text_yyy"),
        order="zzz",
        id="yyy_last_string_order",
    )

    app.layout = html.Div(
        [
            html.Div(
                [
                    html.Div(
                        dcc.Link(