webogram-i2p/test/unit/chatTitleFilterSpec.js
Bart 03bc92006d Added tests for AppImPanelController, DocumentModalController, EmbedModalController and VideoModalController (#1362)
* Added test for AppImPanelControllerSpec, cleaned up style of all tests

All tests give 0 errors when running gulp standard
All credits for those test still go to @Ryuno-Ki, I did not functionaly change the testing code

* add Test for DocumentModalController

* added tests for the EmbedModalController and VideoModalController
2017-04-03 17:01:53 +03:00

34 lines
732 B
JavaScript

/* global describe, it, inject, expect, beforeEach */
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)
})
})