Hide menu options for creating objects, if the object type is set to hidden. Includes Jasmine tests. Fixes #2225

This commit is contained in:
Murtuza Zabuawala
2017-05-12 12:10:46 +01:00
committed by Dave Page
parent dd318e679d
commit aea0d93390
4 changed files with 113 additions and 4 deletions

View File

@@ -0,0 +1,32 @@
//////////////////////////////////////////////////////////////////////////
//
// pgAdmin 4 - PostgreSQL Tools
//
// Copyright (C) 2013 - 2017, The pgAdmin Development Team
// This software is released under the PostgreSQL Licence
//
//////////////////////////////////////////////////////////////////////////
define(["sources/check_node_visibility"],
function (checkNodeVisibility, pgBrowser) {
describe("checkNodeVisibility", function () {
var browser;
browser = jasmine.createSpyObj('browser', [
'node_preference_data', 'get_preference']
);
describe("when node is server collection", function () {
it("returns true", function () {
expect(checkNodeVisibility(browser, 'coll-server')).toEqual(true);
});
});
describe("when node is server", function () {
it("returns true", function () {
expect(checkNodeVisibility(browser, 'server')).toEqual(true);
});
});
});
});

View File

@@ -32,6 +32,7 @@ require.config({
'jquery.ui': sourcesDir + 'vendor/jquery-ui/jquery-ui-1.11.3',
'jquery.event.drag': sourcesDir + 'vendor/jquery-ui/jquery.event.drag-2.2',
'underscore': sourcesDir + 'vendor/underscore/underscore',
'underscore.string': sourcesDir + 'vendor/underscore/underscore.string',
'slickgrid': sourcesDir + 'vendor/slickgrid/slick.core',
'slickgrid/slick.grid': sourcesDir + 'vendor/slickgrid/slick.grid',
'slickgrid/slick.rowselectionmodel': sourcesDir + 'vendor/slickgrid/plugins/slick.rowselectionmodel',