|
@@ -2,6 +2,7 @@ import asyncio
|
|
|
|
|
|
import pytest
|
|
|
from selenium.webdriver.common.by import By
|
|
|
+from typing_extensions import Literal
|
|
|
|
|
|
from nicegui import ui
|
|
|
from nicegui.events import ClickEventArguments
|
|
@@ -161,10 +162,10 @@ def test_throttling_variants(screen: Screen):
|
|
|
assert events == [3]
|
|
|
|
|
|
|
|
|
-@pytest.mark.parametrize('attribue', ['disabled', 'hidden'])
|
|
|
-def test_server_side_validation(screen: Screen, attribue: str):
|
|
|
+@pytest.mark.parametrize('attribute', ['disabled', 'hidden'])
|
|
|
+def test_server_side_validation(screen: Screen, attribute: Literal['disabled', 'hidden']):
|
|
|
b = ui.button('Button', on_click=lambda: ui.label('Success'))
|
|
|
- b.disable() if attribue == 'disabled' else b.set_visibility(False)
|
|
|
+ b.disable() if attribute == 'disabled' else b.set_visibility(False)
|
|
|
ui.button('Hack', on_click=lambda: ui.run_javascript(f'''
|
|
|
getElement({b.id}).$emit("click", {{"id": {b.id}, "listener_id": "{list(b._event_listeners.keys())[0]}"}});
|
|
|
''', respond=False))
|