Skip to content

Commit

Permalink
Add errror views test
Browse files Browse the repository at this point in the history
  • Loading branch information
Gomez committed Sep 20, 2016
1 parent 8886da2 commit a85c515
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
File renamed without changes.
48 changes: 48 additions & 0 deletions js/tests/views_error_spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* @author Steffen Lindner <[email protected]>
*
* Mail
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/


define(['views/errorview', 'handlebars'], function(ErrorView, Handlebars) {

describe('ErrorView', function () {

beforeEach(function () {
errorview = new ErrorView({});
});

afterEach(function () {
errorview.remove();
});

describe('Rendering', function () {

it('produces the correct HTML', function () {
errorview.render();

html = errorview.el.innerHTML.trim()
expected_html = '<div class="">\n\t<div class="icon-mail"></div>\n\t<h2>An unknown error occurred</h2>\n</div>'
expect(html).toContain(expected_html)

});

});

});

});

0 comments on commit a85c515

Please sign in to comment.