mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-07-22 06:28:46 -04:00
ensuring internal variables of common module are not changed by providing getter functions, splitting out I18n tests
This commit is contained in:
parent
dfd906900b
commit
3fed63ce28
3 changed files with 174 additions and 42 deletions
|
@ -53,7 +53,7 @@ describe('Helper', function () {
|
|||
this.timeout(30000);
|
||||
jsc.property(
|
||||
'selection contains content of given ID',
|
||||
jsc.nearray(jsc.nearray(jsc.elements(common.alnumString))),
|
||||
jsc.nearray(jsc.nearray(common.jscAlnumString())),
|
||||
'nearray string',
|
||||
function (ids, contents) {
|
||||
var html = '',
|
||||
|
@ -90,9 +90,9 @@ describe('Helper', function () {
|
|||
'replaces URLs with anchors',
|
||||
'string',
|
||||
jsc.elements(['http', 'https', 'ftp']),
|
||||
jsc.nearray(jsc.elements(common.a2zString)),
|
||||
jsc.array(jsc.elements(common.queryString)),
|
||||
jsc.array(jsc.elements(common.queryString)),
|
||||
jsc.nearray(common.jscA2zString()),
|
||||
jsc.array(common.jscQueryString()),
|
||||
jsc.array(common.jscQueryString()),
|
||||
'string',
|
||||
function (prefix, schema, address, query, fragment, postfix) {
|
||||
var query = query.join(''),
|
||||
|
@ -117,7 +117,7 @@ describe('Helper', function () {
|
|||
jsc.property(
|
||||
'replaces magnet links with anchors',
|
||||
'string',
|
||||
jsc.array(jsc.elements(common.queryString)),
|
||||
jsc.array(common.jscQueryString()),
|
||||
'string',
|
||||
function (prefix, query, postfix) {
|
||||
var url = 'magnet:?' + query.join('').replace(/^&+|&+$/gm,''),
|
||||
|
@ -244,9 +244,9 @@ describe('Helper', function () {
|
|||
|
||||
jsc.property(
|
||||
'returns the URL without query & fragment',
|
||||
jsc.elements(common.schemas),
|
||||
jsc.nearray(jsc.elements(common.a2zString)),
|
||||
jsc.array(jsc.elements(common.queryString)),
|
||||
common.jscSchemas(),
|
||||
jsc.nearray(common.jscA2zString()),
|
||||
jsc.array(common.jscQueryString()),
|
||||
'string',
|
||||
function (schema, address, query, fragment) {
|
||||
var expected = schema + '://' + address.join('') + '/',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue