Files
zulip/zerver/tests/frontend/node/message_tour.js
Tim Abbott e111a2f9a5 [manual] Rename Django app from zephyr to zerver.
This needs to be deployed to both staging and prod at the same
off-peak time (and the schema migration run).

At the time it is deployed, we need to make a few changes directly in
the database:

(1) UPDATE django_content_type set app_label='zerver' where app_label='zephyr';
(2) UPDATE south_migrationhistory set app_name='zerver' where app_name='zephyr';

(imported from commit eb3fd719571740189514ef0b884738cb30df1320)
2013-08-06 07:39:36 -04:00

24 lines
814 B
JavaScript

// This is a framework-free unit test for the message_tour.js
// module. There's a long comment there explaining the module's
// purpose, but, briefly, it provides an API to keep track of
// messages that you visit on a "tour."
var message_tour = require('js/message_tour.js');
var assert = require('assert');
(function test_basic_tour() {
message_tour.start_tour(5);
message_tour.visit(3); // too small
message_tour.visit(7);
message_tour.visit(6);
message_tour.visit(4); // too small
assert.deepEqual(message_tour.get_tour(), [7,6]);
message_tour.finish_tour();
assert.deepEqual(message_tour.get_tour(), []);
message_tour.visit(7); // should be ignored
message_tour.start_tour(5);
message_tour.visit(13);
assert.deepEqual(message_tour.get_tour(), [13]);
}());