/
templates.js
835 lines (707 loc) · 24.7 KB
/
templates.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
add_dependencies({
Handlebars: 'handlebars',
templates: 'js/templates',
i18n: 'i18next'
});
var i18n = global.i18n;
i18n.init({
nsSeparator: false,
keySeparator: false,
interpolation: {
prefix: "__",
suffix: "__"
},
lng: 'en'
});
var jsdom = require("jsdom");
var window = jsdom.jsdom().defaultView;
global.$ = require('jquery')(window);
var _ = global._;
// When writing these tests, the following command might be helpful:
// ./tools/get-handlebar-vars static/templates/*.handlebars
function render(template_name, args) {
global.use_template(template_name);
return global.templates.render(template_name, args);
}
(function test_handlebars_bug () {
// There was a bug in 1.0.9 where identically structured
// blocks get confused, so when foo is false, it still
// renders the foo-is-true block.
var s = '';
s += '{{#if foo}}';
s += '{{#if bar}}';
s += 'a';
s += '{{else}}';
s += 'b';
s += '{{/if}}';
s += '{{else}}';
s += '{{#if bar}}';
s += 'c';
s += '{{else}}';
s += 'd';
s += '{{/if}}';
s += '{{/if}}';
var template = global.Handlebars.compile(s);
var output = template({});
assert.equal(output, 'd'); // the buggy version would return 'b'
}());
(function actions_popover_content() {
var args = {
"message": {
is_stream: true,
id: "99",
stream: "devel",
subject: "testing",
sender_full_name: "King Lear"
},
"can_edit_message": true,
"can_mute_topic": true,
"narrowed": true
};
var html = '<div style="height: 250px">';
html += render('actions_popover_content', args);
html += "</div>";
var link = $(html).find("a.respond_button");
assert.equal(link.text().trim(), 'Reply');
global.write_handlebars_output("actions_popover_content", html);
}());
(function admin_default_streams_list() {
var html = '<table>';
var streams = ['devel', 'trac', 'zulip'];
_.each(streams, function (stream) {
var args = {stream: {name: stream, invite_only: false}};
html += render('admin_default_streams_list', args);
});
html += "</table>";
var span = $(html).find(".default_stream_name:first");
assert.equal(span.text(), "devel");
global.write_handlebars_output("admin_default_streams_list", html);
}());
(function admin_emoji_list() {
global.use_template('admin_emoji_list');
var args = {
emoji: {
"name": "MouseFace",
"display_url": "http://emojipedia-us.s3.amazonaws.com/cache/46/7f/467fe69069c408e07517621f263ea9b5.png",
"source_url": "http://emojipedia-us.s3.amazonaws.com/cache/46/7f/467fe69069c408e07517621f263ea9b5.png"
}
};
var html = '';
html += '<tbody id="admin_emoji_table">';
html += render('admin_emoji_list', args);
html += '</tbody>';
global.write_handlebars_output('admin_emoji_list', html);
var emoji_name = $(html).find('tr.emoji_row:first span.emoji_name');
var emoji_url = $(html).find('tr.emoji_row:first span.emoji_image img');
assert.equal(emoji_name.text(), 'MouseFace');
assert.equal(emoji_url.attr('src'), 'http://emojipedia-us.s3.amazonaws.com/cache/46/7f/467fe69069c408e07517621f263ea9b5.png');
}());
(function admin_streams_list() {
var html = '<table>';
var streams = ['devel', 'trac', 'zulip'];
_.each(streams, function (stream) {
var args = {stream: {name: stream, invite_only: false}};
html += render('admin_streams_list', args);
});
html += "</table>";
var span = $(html).find(".stream_name:first");
assert.equal(span.text(), "devel");
global.write_handlebars_output("admin_streams_list", html);
}());
(function admin_tab() {
var args = {
realm_name: 'Zulip'
};
var html = render('admin_tab', args);
var admin_features = ["admin_users_table", "admin_bots_table",
"admin_streams_table", "admin_deactivated_users_table"];
_.each(admin_features, function (admin_feature) {
assert.notEqual($(html).find("#" + admin_feature).length, 0);
});
assert.equal($(html).find("input.admin-realm-name").val(), 'Zulip');
global.write_handlebars_output("admin_tab", html);
}());
(function admin_user_list() {
var html = '<table>';
var users = ['alice', 'bob', 'carl'];
_.each(users, function (user) {
var args = {
"user": {
"is_active": true,
"is_active_human": true,
"email": user + '@zulip.com',
"full_name": user
}
};
html += render('admin_user_list', args);
});
html += "</table>";
var button = $(html).find("button:first");
assert.equal(button.text().trim(), "Deactivate");
assert(button.hasClass("deactivate"));
button = $(html).find("button:last");
assert.equal(button.text().trim(), "Make admin");
assert(button.hasClass("make-admin"));
global.write_handlebars_output("admin_user_list", html);
}());
(function alert_word_settings_item() {
var html = '<ul id="alert-words">';
var words = ['lunch', 'support'];
_.each(words, function (word) {
var args = {
word: word
};
html += render('alert_word_settings_item', args);
});
html += "</ul>";
global.write_handlebars_output("alert_word_settings_item", html);
var li = $(html).find("li.alert-word-item:first");
assert.equal(li.attr('data-word'),'lunch');
}());
(function announce_stream_docs() {
var html = render('announce_stream_docs');
global.write_handlebars_output("announce_stream_docs", html);
}());
(function bankruptcy_modal() {
var args = {
unread_count: 99
};
var html = render('bankruptcy_modal', args);
global.write_handlebars_output("bankruptcy_modal", html);
var count = $(html).find("p b");
assert.equal(count.text(), 99);
}());
(function bookend() {
// Do subscribed/unsubscribed cases here.
var args = {
bookend_content: "subscribed to stream",
trailing: true,
subscribed: true
};
var html;
var all_html = '';
html = render('bookend', args);
assert.equal($(html).text().trim(), "subscribed to stream\n \n \n \n Unsubscribe");
all_html += html;
args = {
bookend_content: "Not subscribed to stream",
trailing: true,
subscribed: false
};
html = render('bookend', args);
assert.equal($(html).text().trim(), 'Not subscribed to stream\n \n \n \n Subscribe');
all_html += '<hr />';
all_html += html;
global.write_handlebars_output("bookend", all_html);
}());
(function bot_avatar_row() {
var html = '';
html += '<div id="settings">';
html += '<div id="bot-settings" class="settings-section">';
html += '<div class="bot-settings-form">';
html += '<ol id="bots_list" style="display: block">';
var args = {
"email": "hamlet@zulip.com",
"api_key": "123456ABCD",
"name": "Hamlet",
"avatar_url": "/hamlet/avatar/url"
};
html += render('bot_avatar_row', args);
html += '</ol>';
html += '</div>';
html += '</div>';
html += '</div>';
global.write_handlebars_output("bot_avatar_row", html);
var img = $(html).find("img");
assert.equal(img.attr('src'), '/hamlet/avatar/url');
}());
(function compose_invite_users() {
var args = {
email: 'hamlet@zulip.com',
name: 'Hamlet'
};
var html = render('compose-invite-users', args);
global.write_handlebars_output("compose-invite-users", html);
var button = $(html).find("button:first");
assert.equal(button.text(), "Subscribe");
}());
(function compose_all_everyone() {
var args = {
count: '101',
name: 'all'
};
var html = render('compose_all_everyone', args);
global.write_handlebars_output("compose_all_everyone", html);
var button = $(html).find("button:first");
assert.equal(button.text(), "YES");
var error_msg = $(html).find('span.compose-all-everyone-msg').text().trim();
assert.equal(error_msg, "Are you sure you want to message all 101 people in this stream?");
}());
(function compose_notification() {
var args = {
"note": "You sent a message to a muted topic.",
"link_text": "Narrow to here",
"link_msg_id": "99",
"link_class": "compose_notification_narrow_by_subject"
};
var html = '<div id="out-of-view-notification" class="notification-alert">';
html += render('compose_notification', args);
html += '</div>';
global.write_handlebars_output("compose_notification", html);
var a = $(html).find("a.compose_notification_narrow_by_subject");
assert.equal(a.text(), "Narrow to here");
}());
(function email_address_hint() {
var html = render('email_address_hint');
global.write_handlebars_output("email_address_hint", html);
var li = $(html).find("li:first");
assert.equal(li.text(), 'The email will be forwarded to this stream');
}());
(function group_pms() {
var args = {
"group_pms": [
{
"fraction_present": 0.1,
"emails": "alice@zulip.com,bob@zulip.com",
"short_name": "Alice and Bob",
"name": "Alice and Bob"
}
]
};
var html = render('group_pms', args);
global.write_handlebars_output("group_pms", html);
var a = $(html).find("a:first");
assert.equal(a.text(), 'Alice and Bob');
}());
(function invite_subscription() {
var args = {
streams: [
{
name: "devel"
},
{
name: "social"
}
]
};
var html = render('invite_subscription', args);
global.write_handlebars_output("invite_subscription", html);
var input = $(html).find("label:first");
assert.equal(input.text().trim(), "devel");
}());
(function single_message() {
var message = {
msg: {
include_recipient: true,
display_recipient: 'devel',
subject: 'testing',
is_stream: true,
content: 'This is message one.',
last_edit_timestr: '11:00',
starred: true
}
};
var html = render('single_message', message);
html = '<div class="message_table focused_table" id="zfilt">' + html + '</div>';
global.write_handlebars_output("message", html);
var first_message = $(html).find("div.messagebox:first");
var first_message_text = first_message.find(".message_content").text().trim();
assert.equal(first_message_text, "This is message one.");
var starred_title = first_message.find(".star span").attr("title");
assert.equal(starred_title, "Unstar this message");
}());
(function message_edit_form() {
var args = {
"topic": "lunch",
"content": "Let's go to lunch!",
"is_stream": true
};
var html = render('message_edit_form', args);
global.write_handlebars_output("message_edit_form", html);
var textarea = $(html).find("textarea.message_edit_content");
assert.equal(textarea.text(), "Let's go to lunch!");
}());
(function message_group() {
var messages = [
{
msg: {
id: 1,
match_content: 'This is message one.',
starred: true,
is_stream: true,
content: 'This is message one.'
},
include_recipient: true,
display_recipient: 'devel',
last_edit_timestr: '11:00'
},
{
msg: {
content: 'This is message two.',
match_content: 'This is message <span class="highlight">two</span>.',
is_stream: true,
unread: true,
id: 2
}
}
];
var groups = [
{
display_recipient: "support",
is_stream: true,
message_ids: [1, 2],
message_containers: messages,
show_date: '"<span id="timerender82">Jan 07</span>"',
subject: 'two messages',
match_subject: '<span class="highlight">two</span> messages'
}
];
global.use_template('single_message'); // partial
global.use_template('recipient_row'); // partial
global.use_template('bookend'); // partial
var html = render('message_group', {message_groups: groups, use_match_properties: true});
var first_message_text = $(html).next('.recipient_row').find('div.messagebox:first .message_content').text().trim();
assert.equal(first_message_text, "This is message one.");
var last_message_html = $(html).next('.recipient_row').find('div.messagebox:last .message_content').html().trim();
assert.equal(last_message_html, 'This is message <span class="highlight">two</span>.');
var highlighted_subject_word = $(html).find('a.narrows_by_subject .highlight').text();
assert.equal(highlighted_subject_word, 'two');
global.write_handlebars_output("message_group", html);
}());
(function message_info_popover_content() {
var args = {
message: {
full_date_str: 'Monday',
full_time_str: '12:00',
sender_full_name: 'Alice Smith',
sender_email: 'alice@zulip.com'
},
sent_by_uri: '/sent_by/uri',
pm_with_uri: '/pm_with/uri'
};
var html = render('message_info_popover_content', args);
global.write_handlebars_output("message_info_popover_content", html);
var a = $(html).find("a.respond_personal_button");
assert.equal(a.text().trim(), 'Send Alice Smith a private message');
}());
(function message_info_popover_title() {
var args = {
message: {
is_stream: true,
stream: 'devel'
}
};
var html = render('message_info_popover_title', args);
global.write_handlebars_output("message_info_popover_title", html);
html = '<div>' + html + '</div>';
assert($(html).text().trim(), "Message to stream devel");
}());
(function new_stream_users() {
var args = {
users: [
{
email: 'lear@zulip.com',
full_name: 'King Lear'
},
{
email: 'othello@zulip.com',
full_name: 'Othello the Moor'
}
]
};
var html = render('new_stream_users', args);
global.write_handlebars_output("new_stream_users", html);
var label = $(html).find("label:first");
assert.equal(label.text().trim(), 'King Lear (lear@zulip.com)');
}());
(function notification() {
var args = {
"content": "Hello",
"gravatar_url": "/gravatar/url",
"title": "You have a notification"
};
var html = render('notification', args);
global.write_handlebars_output("notification", html);
var title = $(html).find(".title");
assert.equal(title.text().trim(), 'You have a notification');
}());
(function propagate_notification_change() {
var html = render('propagate_notification_change');
global.write_handlebars_output("propagate_notification_change", html);
var button_area = $(html).find(".propagate-notifications-controls");
assert.equal(button_area.find(".yes_propagate_notifications").text().trim(), 'Yes');
assert.equal(button_area.find(".no_propagate_notifications").text().trim(), 'No');
}());
(function settings_tab() {
var page_param_checkbox_options = {
stream_desktop_notifications_enabled: true,
stream_sounds_enabled: true, desktop_notifications_enabled: true,
sounds_enabled: true, enable_offline_email_notifications: true,
enable_offline_push_notifications: true, enable_digest_emails: true,
autoscroll_forever: true, default_desktop_notifications: true
};
var page_params = $.extend(page_param_checkbox_options, {
fullname: "Alyssa P. Hacker", password_auth_enabled: true,
avatar_url: "https://google.com",
domain: "zulip.com"
});
var checkbox_ids = ["enable_stream_desktop_notifications",
"enable_stream_sounds", "enable_desktop_notifications",
"enable_sounds", "enable_offline_push_notifications",
"enable_digest_emails", "autoscroll_forever",
"default_desktop_notifications"];
// Render with all booleans set to true.
var html = render('settings_tab', {page_params: page_params});
global.write_handlebars_output("settings_tab", html);
// All checkboxes should be checked.
_.each(checkbox_ids, function (checkbox) {
assert.equal($(html).find("#" + checkbox).is(":checked"), true);
});
// Re-render with checkbox booleans set to false.
_.each(page_param_checkbox_options, function (value, option) {
page_params[option] = false;
});
html = render('settings_tab', {page_params: page_params});
// All checkboxes should be unchecked.
_.each(checkbox_ids, function (checkbox) {
assert.equal($(html).find("#" + checkbox).is(":checked"), false);
});
}());
(function sidebar_private_message_list() {
var args = {
want_show_more_messages_links: true,
messages: [
{
recipients: "alice,bob"
}
]
};
var html = '';
html += render('sidebar_private_message_list', args);
global.write_handlebars_output("sidebar_private_message_list", html);
}());
(function sidebar_subject_list() {
var args = {
want_show_more_topics_links: true,
subjects: [
{
is_muted: false,
topic_name: 'lunch',
url: '/lunch/url',
unread: 5
},
{
is_muted: true,
topic_name: 'dinner',
url: '/dinner/url',
is_zero: true
}
]
};
var html = '';
html += '<ul class="filters">';
html += '<li>';
html += '<ul class="expanded_subjects">';
html += render('sidebar_subject_list', args);
html += '</ul>';
html += '</li>';
html += '</ul>';
global.write_handlebars_output("sidebar_subject_list", html);
var li = $(html).find("li.expanded_subject:first");
assert.equal(li.attr('data-name'), 'lunch');
}());
(function stream_member_list_entry() {
var everyone_items = ["subscriber-name", "subscriber-email"];
var admin_items = ["remove-subscriber-button"];
// First, as non-admin.
var html = render('stream_member_list_entry',
{name: "King Hamlet", email: "hamlet@zulip.com"});
_.each(everyone_items, function (item) {
assert.equal($(html).find("." + item).length, 1);
});
_.each(admin_items, function (item) {
assert.equal($(html).find("." + item).length, 0);
});
// Now, as admin.
html = render('stream_member_list_entry',
{name: "King Hamlet", email: "hamlet@zulip.com",
displaying_for_admin: true});
_.each(everyone_items, function (item) {
assert.equal($(html).find("." + item).length, 1);
});
_.each(admin_items, function (item) {
assert.equal($(html).find("." + item).length, 1);
});
global.write_handlebars_output("stream_member_list_entry", html);
}());
(function stream_sidebar_actions() {
var args = {
stream: {
color: 'red',
name: 'devel',
in_home_view: true,
id: 55
}
};
var html = render('stream_sidebar_actions', args);
global.write_handlebars_output("stream_sidebar_actions", html);
var li = $(html).find("li:first");
assert.equal(li.text().trim(), 'Narrow to stream devel');
}());
(function stream_sidebar_row() {
global.use_template('stream_privacy'); // partial
var args = {
name: "devel",
color: "red",
dark_background: "maroon",
uri: "/devel/uri",
id: 999
};
var html = '<ul id="stream_filters">';
html += render('stream_sidebar_row', args);
html += '</ul>';
global.write_handlebars_output("stream_sidebar_row", html);
var swatch = $(html).find(".streamlist_swatch");
assert.equal(swatch.attr('id'), 'stream_sidebar_swatch_999');
}());
(function subscription_table_body() {
var args = {
subscriptions: [
{
name: 'devel',
subscribed: true,
notifications: true,
is_admin: true,
render_subscribers: true,
color: 'purple',
invite_only: true,
can_make_public: true,
can_make_private: true, /* not logical, but that's ok */
email_address: 'xxxxxxxxxxxxxxx@zulip.com',
id: 888,
in_home_view: true
},
{
name: 'social',
color: 'green',
id: 999
}
]
};
global.use_template('subscription'); // partial
global.use_template('subscription_type'); // partial
global.use_template('subscription_setting_icon'); // partial
global.use_template('change_stream_privacy'); // partial
var html = '';
html += '<div id="subscriptions_table">';
html += render('subscription_table_body', args);
html += '</div>';
global.write_handlebars_output("subscription_table_body", html);
var span = $(html).find(".subscription_name:first");
assert.equal(span.text(), 'devel');
span = $(html).find(".admin-settings .sub_settings_title");
assert.equal(span.text(), 'Administrator settings');
var div = $(html).find(".subscription-type");
assert(div.text().indexOf('invite-only stream') > 0);
}());
(function tab_bar() {
var args = {
tabs: [
{
cls: 'root',
title: 'Home',
hash: '#',
data: 'home'
},
{
cls: 'stream',
title: 'Devel',
hash: '/stream/uri',
data: 'devel'
}
]
};
var html = render('tab_bar', args);
global.write_handlebars_output("tab_bar", html);
var a = $(html).find("li:first");
assert.equal(a.text().trim(), 'Home');
}());
(function topic_edit_form() {
var html = render('topic_edit_form');
global.write_handlebars_output("topic_edit_form", html);
var button = $(html).find("button:first");
assert.equal(button.find("i").attr("class"), 'icon-vector-ok');
}());
(function topic_sidebar_actions() {
var args = {
stream_name: 'social',
topic_name: 'lunch',
can_mute_topic: true
};
var html = render('topic_sidebar_actions', args);
global.write_handlebars_output("topic_sidebar_actions", html);
var a = $(html).find("a.narrow_to_topic");
assert.equal(a.text().trim(), 'Narrow to topic lunch');
}());
(function tutorial() {
var tutorials = [
'tutorial_home',
'tutorial_message',
'tutorial_reply',
'tutorial_stream',
'tutorial_subject',
'tutorial_title'
];
var html = '';
_.each(tutorials, function (tutorial) {
var args = {
placement: 'left',
title: 'Title'
};
html = render(tutorial, args);
global.write_handlebars_output(tutorial, html);
});
}());
(function user_presence_rows() {
global.use_template('user_presence_row'); // partial
var args = {
users: [
{
"my_fullname": true,
"type_desc": "Active",
"type": "active",
"num_unread": 0,
"email": "lear@zulip.com",
"name": "King Lear"
},
{
"type_desc": "Away",
"type": "away",
"num_unread": 5,
"email": "othello@zulip.com",
"name": "Othello"
}
]
};
var html = '';
html += '<ul class="filters">';
html += render('user_presence_rows', args);
html += '</ul>';
global.write_handlebars_output("user_presence_rows", html);
var a = $(html).find("a.my_fullname:first");
assert.equal(a.text(), 'King Lear');
}());
(function user_sidebar_actions() {
var args = {
email: 'hamlet@zulip.com',
name: 'Hamlet'
};
var html = render('user_sidebar_actions', args);
global.write_handlebars_output("user_sidebar_actions", html);
var a = $(html).find("a.narrow_to_private_messages");
assert.equal(a.text().trim(), 'Narrow to private messages with Hamlet');
}());
// By the end of this test, we should have compiled all our templates. Ideally,
// we will also have exercised them to some degree, but that's a little trickier
// to enforce.
global.make_sure_all_templates_have_been_compiled();