mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Update the styling to use the set of grays defined in the WIP style guide.
This commit is contained in:
83
web/regression/javascript/browser/menu_spec.js
Normal file
83
web/regression/javascript/browser/menu_spec.js
Normal file
@@ -0,0 +1,83 @@
|
||||
/////////////////////////////////////////////////////////////
|
||||
//
|
||||
// pgAdmin 4 - PostgreSQL Tools
|
||||
//
|
||||
// Copyright (C) 2013 - 2017, The pgAdmin Development Team
|
||||
// This software is released under the PostgreSQL Licence
|
||||
//
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
define(["browser/menu"
|
||||
], function () {
|
||||
describe("MenuItem", function () {
|
||||
var MenuItem = pgAdmin.Browser.MenuItem;
|
||||
var menuItem;
|
||||
|
||||
describe("when we create a menu item", function () {
|
||||
describe('and it is disabled', function () {
|
||||
beforeEach(function () {
|
||||
menuItem = new MenuItem({enable: false, icon: 'fa fa-car'});
|
||||
menuItem.create_el({}, {});
|
||||
});
|
||||
|
||||
it('should change the text color to gray', function () {
|
||||
expect(menuItem.$el.find('span').hasClass('font-gray-4')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should change the icon to gray', function () {
|
||||
expect(menuItem.$el.find('i').hasClass('font-gray-4')).toBeTruthy();
|
||||
});
|
||||
|
||||
describe('when becomes enabled', function () {
|
||||
beforeEach(function () {
|
||||
menuItem.enable = true;
|
||||
menuItem.update({},{});
|
||||
});
|
||||
|
||||
it('should change the text color to white', function () {
|
||||
expect(menuItem.$el.find('span').hasClass('font-gray-4')).toBeFalsy();
|
||||
expect(menuItem.$el.find('span').hasClass('font-white')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should change the icon color to white', function () {
|
||||
expect(menuItem.$el.find('i').hasClass('font-gray-4')).toBeFalsy();
|
||||
expect(menuItem.$el.find('i').hasClass('font-white')).toBeTruthy();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('and it is enabled', function () {
|
||||
beforeEach(function () {
|
||||
menuItem = new MenuItem({enable: true, icon: 'fa fa-car'});
|
||||
menuItem.create_el({}, {});
|
||||
});
|
||||
|
||||
it('should change the text color to white', function () {
|
||||
expect(menuItem.$el.find('span').hasClass('font-white')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should change the icon to white', function () {
|
||||
expect(menuItem.$el.find('i').hasClass('font-white')).toBeTruthy();
|
||||
});
|
||||
|
||||
describe('when becomes disabled', function () {
|
||||
beforeEach(function () {
|
||||
menuItem.enable = false;
|
||||
menuItem.update({},{});
|
||||
});
|
||||
|
||||
it('should change the text color to gray', function () {
|
||||
expect(menuItem.$el.find('span').hasClass('font-gray-4')).toBeTruthy();
|
||||
expect(menuItem.$el.find('span').hasClass('font-white')).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should change the icon color to gray', function () {
|
||||
expect(menuItem.$el.find('i').hasClass('font-gray-4')).toBeTruthy();
|
||||
expect(menuItem.$el.find('i').hasClass('font-white')).toBeFalsy();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user