Esempio n. 1
0
def test_breadcrumbs():
    links = [
        ("Home", "/"),
        ("Previous", "/previous/"),
        ("Current", None),
    ]
    template = '{% include "gds/layout/breadcrumbs.html" %}'
    assert parse_template(template, crumbs=links) == parse_contents(
        RESULT_DIR, "breadcrumbs.html")
Esempio n. 2
0
def test_extra_attributes():
    button = Button.primary("name", "Title", key="value")
    assert parse_template(TEMPLATE, input=button) == parse_contents(
        RESULT_DIR, "attributes.html"
    )
Esempio n. 3
0
def test_css_id():
    button = Button.primary("name", "Title", css_id="new_id")
    assert parse_template(TEMPLATE, input=button) == parse_contents(
        RESULT_DIR, "css_id.html"
    )
Esempio n. 4
0
def test_css_class():
    button = Button.primary("name", "Title", css_class="extra-css-class")
    assert parse_template(TEMPLATE, input=button) == parse_contents(
        RESULT_DIR, "css_class.html"
    )
Esempio n. 5
0
def test_disabled_button():
    button = Button.primary("name", "Title", disabled=True)
    assert parse_template(TEMPLATE, input=button) == parse_contents(
        RESULT_DIR, "disabled.html"
    )
Esempio n. 6
0
def test_warning_button():
    button = Button.warning("name", "Title")
    assert parse_template(TEMPLATE, input=button) == parse_contents(
        RESULT_DIR, "warning.html"
    )
Esempio n. 7
0
def test_secondary_button():
    button = Button.secondary("name", "Title")
    assert parse_template(TEMPLATE, input=button) == parse_contents(
        RESULT_DIR, "secondary.html"
    )