Files
zulip/zerver/tests/frontend/node/hashchange.js
Steve Howell 2a5dd139c8 Add node tests for hashchange.js
(imported from commit 20309e13dfea28400341e30a42e8f775479de773)
2014-02-19 16:19:16 -05: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');
}());