2017-06-08 06:41:56 -05:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// pgAdmin 4 - PostgreSQL Tools
|
|
|
|
//
|
|
|
|
// Copyright (C) 2013 - 2017, The pgAdmin Development Team
|
|
|
|
// This software is released under the PostgreSQL Licence
|
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2017-06-12 10:55:14 -05:00
|
|
|
define(['sources/sqleditor_utils'],
|
2017-06-08 06:41:56 -05:00
|
|
|
function (SqlEditorUtils) {
|
2017-06-12 10:55:14 -05:00
|
|
|
describe('SqlEditorUtils', function () {
|
2017-06-08 06:41:56 -05:00
|
|
|
|
2017-06-12 10:55:14 -05:00
|
|
|
describe('Generate a random string of size 10', function () {
|
|
|
|
it('returns string of length 10', function () {
|
2017-06-08 06:41:56 -05:00
|
|
|
expect(SqlEditorUtils.epicRandomString(10).length).toEqual(10);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2017-06-12 10:55:14 -05:00
|
|
|
describe('Generate a unique hash for given string', function () {
|
|
|
|
it('returns unique hash', function () {
|
2017-06-08 06:41:56 -05:00
|
|
|
expect(SqlEditorUtils.getHash('select * from test')).toEqual(403379630);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2017-06-15 06:19:47 -05:00
|
|
|
describe('Capitalize the first letter of given string', function () {
|
|
|
|
it('returns string with First letter Capital', function () {
|
|
|
|
expect(SqlEditorUtils.capitalizeFirstLetter('create script')).toEqual('Create script');
|
|
|
|
});
|
|
|
|
});
|
2017-06-08 06:41:56 -05:00
|
|
|
});
|
|
|
|
});
|