| 140 | |
| 141 | |
| 142 | async def test_snake_case_attributes(display: DisplayFixture): |
| 143 | @reactpy.component |
| 144 | def SomeComponent(): |
| 145 | return reactpy.html.h1( |
| 146 | { |
| 147 | "id": "my-title", |
| 148 | "style": {"background_color": "blue"}, |
| 149 | "class_name": "hello", |
| 150 | "data_some_thing": "some-data", |
| 151 | "aria_some_thing": "some-aria", |
| 152 | }, |
| 153 | "title with some attributes", |
| 154 | ) |
| 155 | |
| 156 | await display.show(SomeComponent) |
| 157 | |
| 158 | title = await display.page.wait_for_selector("#my-title") |
| 159 | |
| 160 | assert await title.get_attribute("class") == "hello" |
| 161 | assert await title.get_attribute("style") == "background-color: blue;" |
| 162 | assert await title.get_attribute("data-some-thing") == "some-data" |
| 163 | assert await title.get_attribute("aria-some-thing") == "some-aria" |