def test_view(): textinput = FastTextAreaInput(name="Be Fast!", placeholder="Write something!") app = create_fast_test_app( component=textinput, parameters=[ "name", "value", "placeholder", "max_length", "disabled", "appearance", "autofocus", "resize", "cols", "rows", "spellcheck", "min_length", "required", "readonly", ], ) return app
# assert literal_input.type_of_text=="text" if __name__.startswith("bokeh"): textinput = FastLiteralInput( name="Be Fast!", placeholder="Write a list. For example ['a']!", type=(type, list)) app = create_fast_test_app( component=textinput, parameters=[ "name", "value", # "type", "disabled", "placeholder", "appearance", "autofocus", # "type_of_text", # Constant "serializer", # Some attributes do not work. See https://github.com/microsoft/fast/issues/3852 # "maxlength", # "minlength", # "pattern", # "size", # "spellcheck", # "required", "readonly", ], ) app.servable()
# assert literal_input.type_of_text=="text" if __name__.startswith("bokeh"): textinput = FastLiteralAreaInput( name="List Value!", placeholder="Write a list. For example ['a']!", type=list ) app = create_fast_test_app( component=textinput, parameters=[ "appearance", "autofocus", "cols", "disabled", "max_length", "min_length", "name", "placeholder", "readonly", "required", "resize", "rows", "serializer", "spellcheck", "value", # "type" does not work # Some attributes do not work. See https://github.com/microsoft/fast/issues/3852 ], ) app.servable()
# pylint: disable=redefined-outer-name,protected-access # pylint: disable=missing-function-docstring,missing-module-docstring,missing-class-docstring from awesome_panel_extensions.frameworks.fast import FastCheckbox from tests.frameworks.fast.fast_test_app import create_fast_test_app def test_constructor(): # When checkbox = FastCheckbox(name="Check Me") # Then assert checkbox.disabled is False assert checkbox.name == "Check Me" assert checkbox.value is False if __name__ == "__main__": checkbox = FastCheckbox(name="Hello Fast Design World") app = create_fast_test_app( component=checkbox, parameters=["disabled", "readonly", "value", ""]) app.show(port=5007)
switch = FastSwitch(name="Notify by Email", value=False, checked_message="On", unchecked_message="Off") # Then assert switch.name=="Notify by Email" assert switch.value is False assert switch.checked_message=="On" assert switch.unchecked_message=="Off" assert switch.disabled is False assert switch.readonly is False if __name__.startswith("bokeh"): switch = FastSwitch( name="Notify by Email", value=False, checked_message="On", unchecked_message="Off", ) app = create_fast_test_app( component=switch, parameters=[ "name", "value", "checked_message", "unchecked_message", "required", "disabled", "readonly" ], ) app.servable()
# Then assert anchor.height == 20 if __name__.startswith("bokeh"): anchor = FastAnchor( name="Be Fast!", value="https://fast.design", appearance="neutral", rel="help", target="_blank", ) app = create_fast_test_app( component=anchor, parameters=[ "name", "value", "appearance", "download", "href", "hreflang", "ping", "referrerpolicy", "referrer", "rel", "target", "mimetype", ], ) app.servable()
assert textinput.rows == 2 assert textinput.spellcheck is False assert textinput.min_length == 0 assert textinput.required is False assert textinput.readonly is False if __name__.startswith("bokeh"): textinput = FastTextAreaInput(name="Be Fast!", placeholder="Write something!") app = create_fast_test_app( component=textinput, parameters=[ "name", "value", "placeholder", "max_length", "disabled", "appearance", "autofocus", "resize", "cols", "rows", "spellcheck", "min_length", "required", "readonly", ], ) app.servable()