Files
zulip/frontend_tests/node_tests/hashchange.js
Tim Abbott 459421d045 eslint: Update node tests to use new comma-dangle rules.
* In most cases, eslint --fix with the right comma-dangle settings was
  able to update the code correctly.

* The exceptions were cases where the parser incorrectly treated the
  arguments to functions like `assert_equal` as arguments; we fixed
  these manually.  Since this is test code, we can be reasonably
  confident that just fixing the failures suffices to correct any bugs
  introduced by making changes automatically.
2016-12-03 15:00:24 -08:00

21 lines
610 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');
}());