async def METHOD_NAME():
    """A Widget.remove of a top-level widget should cause bottom-first removal."""
    removals: list[str] = []
    class Removable(Container):
        def on_unmount(self, _):
            removals.append(self.id if self.id is not None else "unknown")
    async with App().run_test() as pilot:
        await pilot.app.mount(
            Removable(Removable(Removable(id="grandchild"), id="child"), id="parent")
        )
        assert len(pilot.app.screen.walk_children(with_self=False)) == 3
        await pilot.app.screen._nodes[0].remove()
        assert len(pilot.app.screen.walk_children(with_self=False)) == 0
        assert removals == ["grandchild", "child", "parent"]