def test_other_config_visibility(answer_schema_textfield, is_visible,
                                 expected_visibility):
    if is_visible is not None:
        answer_schema_textfield["visible"] = is_visible

    other = OtherConfig(Mock(), answer_schema_textfield)
    assert other.open is expected_visibility
def test_other_config_numeric_input_class(answer_schema_number, max_value,
                                          expected_width):
    if max_value:
        answer_schema_number["maximum"] = {"value": max_value}

    other = OtherConfig(Mock(), answer_schema_number)
    assert other.classes == f"input--w-{expected_width}"
Пример #3
0
def test_other_config_non_dropdown_has_value_attribute(answer_schema_textfield):
    other = OtherConfig(MagicMock(), answer_schema_textfield)
    assert hasattr(other, "value")
    assert not hasattr(other, "options")
Пример #4
0
def test_other_config_dropdown_has_options_attribute(answer_schema_dropdown):
    other = OtherConfig(MagicMock(), answer_schema_dropdown)
    assert hasattr(other, "options")
    assert not hasattr(other, "value")
Пример #5
0
def test_other_config_dropdown_input_type(answer_schema_dropdown):
    other = OtherConfig(MagicMock(), answer_schema_dropdown)
    assert other.otherType == "select"
Пример #6
0
def test_other_config_non_dropdown_input_type(answer_schema_textfield):
    other = OtherConfig(Mock(), answer_schema_textfield)
    assert other.otherType == "input"