mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
#5186 add tests for getQueryParameters()
and fix test description of `urldecode()`
This commit is contained in:
parent
fcd0b78afa
commit
afe46ef74c
@ -2,7 +2,7 @@ var DOCUMENTATION_OPTIONS = {};
|
||||
|
||||
describe('urldecode', function() {
|
||||
|
||||
it('should fail', function() {
|
||||
it('should correctly decode URLs and replace `+`s with a spaces', function() {
|
||||
var test_encoded_string =
|
||||
'%D1%88%D0%B5%D0%BB%D0%BB%D1%8B+%D1%88%D0%B5%D0%BB%D0%BB%D1%8B';
|
||||
var test_decoded_string = 'шеллы шеллы';
|
||||
@ -10,3 +10,23 @@ describe('urldecode', function() {
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('getQueryParameters', function() {
|
||||
var paramString = '?q=test+this&check_keywords=yes&area=default';
|
||||
var queryParamObject = {
|
||||
area: ['default'],
|
||||
check_keywords: ['yes'],
|
||||
q: ['test this']
|
||||
};
|
||||
|
||||
it('should correctly create query parameter object from string', function() {
|
||||
expect(jQuery.getQueryParameters(paramString)).toEqual(queryParamObject);
|
||||
});
|
||||
|
||||
it('should correctly create query param object from URL params', function() {
|
||||
history.pushState({}, '_', window.location + paramString);
|
||||
expect(jQuery.getQueryParameters()).toEqual(queryParamObject);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user