async def METHOD_NAME(ModesApp: Type[App]):
    fruits = []
    N = 5
    app = ModesApp()
    async with app.run_test() as pilot:
        # Build the stack up.
        for _ in range(N):
            await pilot.press("p")
            fruits.append(str(app.query_one(Label).renderable))
        assert len(app.screen_stack) == N + 1
        # Switch out and back.
        await pilot.press("2")
        assert len(app.screen_stack) == 1
        await pilot.press("1")
        # Check the stack.
        assert len(app.screen_stack) == N + 1
        for _ in range(N):
            assert str(app.query_one(Label).renderable) == fruits.pop()
            await pilot.press("o")