6f8676dd74
* Add karma, Jasmine, deps and karma.conf.js. Fixes #1291 * Improved service worker code * npm start script executes gulp watch task. * Written a gulp task to compile templates AOT. Get rid of loading deps in unit tests and a preprocessor. * PhantomJS package is deprecated. Use phantomjs-prebuilt instead. * Adjust `npm run test`.
32 lines
694 B
JavaScript
32 lines
694 B
JavaScript
describe('chatTitle filter', function () {
|
|
var $filter, _, chatTitleFilter;
|
|
|
|
beforeEach(module('myApp.filters'));
|
|
|
|
beforeEach(inject(function (_$filter_, ___) {
|
|
$filter = _$filter_;
|
|
_ = ___;
|
|
}));
|
|
|
|
beforeEach(function () {
|
|
chatTitleFilter = $filter('chatTitle');
|
|
});
|
|
|
|
it('displays chat title deleted', function () {
|
|
var expected = _('chat_title_deleted');
|
|
var actual = chatTitleFilter(null);
|
|
|
|
expect(actual).toEqual(expected);
|
|
});
|
|
|
|
it('displays the chat title', function () {
|
|
var chat = {
|
|
title: 'Telegraph is hot!'
|
|
};
|
|
var expected = chat.title;
|
|
var actual = chatTitleFilter(chat);
|
|
|
|
expect(actual).toEqual(expected);
|
|
});
|
|
});
|