2016-05-13 12:44:03 +02:00
add _dependencies ( {
Handlebars : 'handlebars' ,
templates : 'js/templates' ,
2016-12-03 23:17:57 +01:00
i18n : 'i18next' ,
2016-05-13 12:44:03 +02:00
} ) ;
var i18n = global . i18n ;
i18n . init ( {
nsSeparator : false ,
keySeparator : false ,
interpolation : {
prefix : "__" ,
2016-12-03 23:17:57 +01:00
suffix : "__" ,
2016-05-13 12:44:03 +02:00
} ,
lng : 'fr' ,
resources : {
fr : {
translation : {
2016-12-03 03:08:47 +01:00
Reply : "French" ,
2016-12-03 23:17:57 +01:00
"You'll receive notifications when a message arrives and __page_params.product_name__ isn't in focus or the message is offscreen." : "Some French text with __page_params.product_name__" ,
} ,
} ,
} ,
2016-05-13 12:44:03 +02:00
} ) ;
2016-08-24 21:49:53 +02:00
var jsdom = require ( "jsdom" ) ;
var window = jsdom . jsdom ( ) . defaultView ;
global . $ = require ( 'jquery' ) ( window ) ;
2016-05-13 12:44:03 +02:00
( function test _t _tag ( ) {
var args = {
2016-12-03 03:08:47 +01:00
message : {
2016-05-13 12:44:03 +02:00
is _stream : true ,
id : "99" ,
stream : "devel" ,
subject : "testing" ,
2016-12-03 23:17:57 +01:00
sender _full _name : "King Lear" ,
2016-05-13 12:44:03 +02:00
} ,
2016-12-03 03:08:47 +01:00
can _edit _message : true ,
can _mute _topic : true ,
2016-12-03 23:17:57 +01:00
narrowed : true ,
2016-05-13 12:44:03 +02:00
} ;
var html = '<div style="height: 250px">' ;
2016-11-04 16:34:27 +01:00
html += global . render _template ( 'actions_popover_content' , args ) ;
2016-05-13 12:44:03 +02:00
html += "</div>" ;
var link = $ ( html ) . find ( "a.respond_button" ) ;
assert . equal ( link . text ( ) . trim ( ) , 'French' ) ;
global . write _test _output ( "actions_popover_content.handlebars" , html ) ;
} ( ) ) ;
( function test _tr _tag ( ) {
var args = {
2016-12-03 03:08:47 +01:00
page _params : {
fullname : "John Doe" ,
product _name : "Zulip" ,
password _auth _enabled : false ,
avatar _url : "http://example.com" ,
left _side _userlist : false ,
twenty _four _hour _time : false ,
stream _desktop _notifications _enabled : false ,
stream _sounds _enabled : false ,
desktop _notifications _enabled : false ,
sounds _enabled : false ,
enable _offline _email _notifications : false ,
enable _offline _push _notifications : false ,
enable _online _push _notifications : false ,
enable _digest _emails : false ,
domain : "zulip.com" ,
autoscroll _forever : false ,
2016-12-03 23:17:57 +01:00
default _desktop _notifications : false ,
} ,
2016-05-13 12:44:03 +02:00
} ;
2016-11-04 16:34:27 +01:00
var html = global . render _template ( 'settings_tab' , args ) ;
2016-05-13 12:44:03 +02:00
var div = $ ( html ) . find ( "div.notification-reminder" ) ;
assert . equal ( div . text ( ) . trim ( ) , 'Some French text with Zulip' ) ;
2016-07-30 06:18:55 +02:00
global . write _test _output ( "test_tr_tag settings" , html ) ;
2016-05-13 12:44:03 +02:00
} ( ) ) ;