Update the styling to use the set of grays defined in the WIP style guide.

This commit is contained in:
Shruti B Iyer
2017-06-07 13:57:49 +01:00
committed by Dave Page
parent 495a3cedb0
commit 0d05385585
12 changed files with 257 additions and 16 deletions

View 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();
});
});
});
});
});
});