Example #1
0
def test_delete_by_edit_to_blank():
    todomvc.open_at_all().add('a', 'b', 'c')

    todomvc.edit_by_enter('b', '')

    todomvc.should_have_list('a', 'c')
    todomvc.should_have_items_left(2)
Example #2
0
def test_edit_by_tab():
    todomvc.open_at_all().add('a', 'b', 'c')

    todomvc.edit_by_tab('b', 'b edited')

    todomvc.should_have_list('a', 'b edited', 'c')
    todomvc.should_have_items_left(3)
Example #3
0
def test_cancel_edit_by_esc():
    todomvc.open_at_all().add('a', 'b', 'c')

    todomvc.cancel_edit('b', 'b edited')

    todomvc.should_have_list('a', 'b', 'c')
    todomvc.should_have_items_left(3)
Example #4
0
def test_add_many():
    todomvc.open_at_all()

    todomvc.add('a', 'b', 'c')

    todomvc.should_have_list('a', 'b', 'c')
    todomvc.should_have_items_left(3)
Example #5
0
def test_clear_completed():
    todomvc.open_at_all().add('a', 'b', 'c', 'd')\
        .toggle('b')\
        .toggle('c')

    todomvc.clear_completed()

    todomvc.should_have_list('a', 'd')
    todomvc.should_have_items_left(2)
Example #6
0
def test_add_first():
    todomvc.open_at_all()

    # WHEN nothing
    todomvc.add()

    todomvc.should_have_empty_list()
    todomvc.should_have_hidden_footer()

    # WHEN one
    todomvc.add('a')

    todomvc.should_have_list('a')
    todomvc.should_have_items_left(1)
Example #7
0
def test_delete():
    todomvc.open_at_all()

    # delete one
    todomvc.add('a')\
        .delete('a')

    todomvc.should_have_hidden_footer()
    todomvc.should_have_empty_list()

    # delete many
    todomvc.add('a', 'b', 'c', 'd')\
        .delete('b')\
        .delete('c')

    todomvc.should_have_items_left(2)
    todomvc.should_have_list('a', 'd')
Example #8
0
def test_todos_management():
    todomvc.open()

    todomvc.add('a', 'b', 'c')
    todomvc.should_have_list('a', 'b', 'c')

    todomvc.edit_by_enter('a', 'a edited')

    todomvc.toggle('a edited')

    todomvc.clear_completed()
    todomvc.should_have_list('b', 'c')

    todomvc.cancel_edit('b', 'b edited')

    todomvc.delete('b')
    todomvc.should_have_list('c')