Skip to content

Commit

Permalink
update older tests to reflect clear-completed count in footer #48
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Sep 7, 2018
1 parent c40a583 commit b1f895b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/todo-list/todo-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ function render_footer (model, signal) {
])
]), // </ul>
button(["class=clear-completed", "style=display:" + display_clear,
signal('CLEAR_COMPLETED')
typeof signal === 'function' ? signal('CLEAR_COMPLETED') : ''
],
[
text("Clear completed ["),
Expand Down
6 changes: 4 additions & 2 deletions test/todo-app.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ test('render_footer view using (elmish) HTML DOM functions', function (t) {

// check for "Clear completed" button in footer:
const clear = document.querySelectorAll('.clear-completed')[0].textContent;
t.equal(clear, 'Clear completed', '<button> in <footer> "Clear completed"');
t.equal(clear, 'Clear completed [1]',
'<button> in <footer> "Clear completed [1]"');

elmish.empty(document.getElementById(id)); // clear DOM ready for next test
t.end();
Expand Down Expand Up @@ -545,6 +546,7 @@ test('5.5 CANCEL should cancel edits on escape', function (t) {
// confirm the item.title is still the original title:
t.equal(document.querySelectorAll('.view > label')[1].textContent,
model.todos[1].title, 'todo id 1 has title: ' + model.todos[1].title);
localStorage.removeItem('todos-elmish_' + id);
t.end();
});

Expand All @@ -570,7 +572,7 @@ test('6. Counter > should display the current number of todo items',
t.end();
});

test.only('7. Clear Completed > should display the number of completed items',
test('7. Clear Completed > should display the number of completed items',
function (t) {
elmish.empty(document.getElementById(id));
const model = {
Expand Down

0 comments on commit b1f895b

Please sign in to comment.