Files
zulip/frontend_tests/node/hashchange.js
Tim Abbott f1074aa491 Move frontend tests out of zerver/tests/.
This fixes an unfortunate bug where the backend tests in
zerver/tests.py were not being run automatically, and also makes these
a bit easier to find.
2015-10-28 10:11:47 -07:00

21 lines
608 B
JavaScript

var hashchange = require('js/hashchange.js');
(function test_basics() {
var operators;
var hash;
operators = [
{operator: 'stream', operand: 'devel'},
{operator: 'topic', operand: 'algol'}
];
hash = hashchange.operators_to_hash(operators);
assert.equal(hash, '#narrow/stream/devel/topic/algol');
operators = [
{operator: 'stream', operand: 'devel'},
{operator: 'topic', operand: 'visual c++', negated: true}
];
hash = hashchange.operators_to_hash(operators);
assert.equal(hash, '#narrow/stream/devel/-topic/visual.20c.2B.2B');
}());