Ghost/test/unit/frontend/helpers/encode.test.js
Hannah Wolfe 95d27e7f58
Moved frontend unit tests into their own folder
- this is a small part of a bit of cleanup of our test files
- the goal is to make the existing tests clearer with a view to making it easier to write more tests
- this makes the test structure follow the codebase structure more closely
- eventually we will colocate the frontend tests with the frontend code
2021-10-06 11:58:29 +01:00

16 lines
475 B
JavaScript

const should = require('should');
// Stuff we are testing
const encode = require('../../../../core/frontend/helpers/encode');
describe('{{encode}} helper', function () {
it('can escape URI', function () {
const uri = '$pecial!Charact3r(De[iver]y)Foo #Bar';
const expected = '%24pecial!Charact3r(De%5Biver%5Dy)Foo%20%23Bar';
const escaped = encode(uri);
should.exist(escaped);
String(escaped).should.equal(expected);
});
});