Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
75
gaia/apps/email/test/unit/query_string_test.js
Executable file
75
gaia/apps/email/test/unit/query_string_test.js
Executable file
|
|
@ -0,0 +1,75 @@
|
|||
'use strict';
|
||||
/*jshint browser: true */
|
||||
/*global requireApp, suite, testConfig, test, assert,
|
||||
suiteSetup, suiteTeardown */
|
||||
|
||||
requireApp('email/js/alameda.js');
|
||||
requireApp('email/test/config.js');
|
||||
|
||||
suite('query_string', function() {
|
||||
var queryString,
|
||||
string1 = 'type=message_list&accountId=A',
|
||||
object1 = {
|
||||
type: 'message_list',
|
||||
accountId: 'A'
|
||||
},
|
||||
string2 = 'type=message_reader&accountId=B&messageSuid=B%2F1',
|
||||
object2 = {
|
||||
type: 'message_reader',
|
||||
accountId: 'B',
|
||||
messageSuid: 'B/1'
|
||||
};
|
||||
|
||||
suiteSetup(function(done) {
|
||||
testConfig(
|
||||
{
|
||||
suiteTeardown: suiteTeardown,
|
||||
done: done
|
||||
},
|
||||
['query_string'],
|
||||
function(q) {
|
||||
queryString = q;
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
suite('#toObject', function() {
|
||||
|
||||
test('basic use', function() {
|
||||
var result1 = queryString.toObject(string1),
|
||||
result2 = queryString.toObject(string2);
|
||||
|
||||
assert.equal('message_list', result1.type);
|
||||
assert.equal('A', result1.accountId);
|
||||
|
||||
assert.equal('message_reader', result2.type);
|
||||
assert.equal('B', result2.accountId);
|
||||
assert.equal('B/1', result2.messageSuid);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
suite('#fromObject', function() {
|
||||
|
||||
test('basic use', function() {
|
||||
var result1 = queryString.fromObject(object1),
|
||||
result2 = queryString.fromObject(object2);
|
||||
|
||||
assert.equal(string1, result1);
|
||||
assert.equal(string2, result2);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
suite('encodeURIComponent use', function() {
|
||||
|
||||
test('basic use', function() {
|
||||
var result1 = queryString
|
||||
.toObject('url%26type=http%3A%2F%2Fmozilla.com%2F');
|
||||
|
||||
assert.equal('http://mozilla.com/', result1['url&type']);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
Loading…
Reference in a new issue