code: def test_state_transitions(current_state, desired_state, expected):
      actual = _AppList._textualize_state_transitions(
          current_state=current_state, desired_state=desired_state
      )
      assert actual == expected
  
file_path: pytorch-lightning/tests/tests_app/cli/test_cmd_apps.py
imports: from unittest import mock
  from unittest.mock import MagicMock
  import pytest
  from lightning.app.cli.cmd_apps import _AppList, _AppManager
  from lightning_cloud.openapi import Externalv1LightningappInstance, V1LightningappInstanceSpec, V1LightningappInstanceState, V1LightningappInstanceStatus, V1LightningworkState, V1ListLightningappInstancesResponse, V1ListLightningworkResponse, V1ListMembershipsResponse, V1Membership
  from rich.text import Text
label_desc: Use image node_id 1 for calling a global function with example usage: test_state_transitions(current_state, desired_state, expected) without return types