()
| 77 | |
| 78 | |
| 79 | async def test_simple_layout(): |
| 80 | set_state_hook = reactpy.Ref() |
| 81 | |
| 82 | @reactpy.component |
| 83 | def SimpleComponent(): |
| 84 | tag, set_state_hook.current = reactpy.hooks.use_state("div") |
| 85 | return reactpy.vdom(tag) |
| 86 | |
| 87 | async with reactpy.Layout(SimpleComponent()) as layout: |
| 88 | update_1 = await layout.render() |
| 89 | assert update_1 == update_message( |
| 90 | path="", |
| 91 | model={"tagName": "", "children": [{"tagName": "div"}]}, |
| 92 | ) |
| 93 | |
| 94 | set_state_hook.current("table") |
| 95 | |
| 96 | update_2 = await layout.render() |
| 97 | assert update_2 == update_message( |
| 98 | path="", |
| 99 | model={"tagName": "", "children": [{"tagName": "table"}]}, |
| 100 | ) |
| 101 | |
| 102 | |
| 103 | async def test_nested_component_layout(): |
nothing calls this directly
no test coverage detected