code: def test_collect_layout(flow, expected_layout, expected_frontends):
      app = _MockApp()
      flow = flow()
      layout = _collect_layout(app, flow)
  
      assert layout == expected_layout
      assert set(app.frontends.keys()) == {
          key for key, _ in expected_frontends
      }
      for key, frontend_type in expected_frontends:
          assert isinstance(app.frontends[key], frontend_type)
  
imports: import pytest
  from lightning.app.core.flow import LightningFlow
  from lightning.app.core.work import LightningWork
  from lightning.app.frontend.web import StaticWebFrontend
  from lightning.app.utilities.layout import _collect_layout
label_desc: Use image node_id 1 for calling a global function with example usage: test_collect_layout(flow, expected_layout, expected_frontends) without return types