Skip to content

Commit

Permalink
add acceptance test
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcpk committed Nov 13, 2017
1 parent 5238bec commit 84cdf9d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/templates/components/invoice-form.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
</table>
</div>
</div>
<div class="panel panel-default invoice-item-list">
<div class="panel panel-default invoice-item-list invoice-total">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-list"></i> Total List</h3>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/components/models-table/button-edit.hbs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<button {{action (route-action 'editInvoice' record)}} class="btn btn-success btn-block"><i class="fa fa-pencil" aria-hidden="true"></i> Edit</button>
<button {{action (route-action 'editInvoice' record)}} class="btn btn-success btn-block button-edit"><i class="fa fa-pencil" aria-hidden="true"></i> Edit</button>
11 changes: 11 additions & 0 deletions tests/acceptance/invoices-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,14 @@ test("I can view the invoices in the table", function(assert) {
assert.equal(find('.table-footer .table-summary').text().trim(), 'Show 1 - 10 of 25' );
});
});

test("I can click an invoice's edit button to be redirected", function(assert) {
server.createList('invoice', 25);
visit('/invoices');

click('.invoice-row .button-edit');

andThen(function() {
assert.equal(currentPath(), 'invoices.edit');
});
});

0 comments on commit 84cdf9d

Please sign in to comment.