[Frontend] Updated tests and examples for glyph refactoring

Fixes #1047
WIP: Fixing test cases: fixed test in Timers that was expecting
glyph return;
This commit is contained in:
Charles Hacskaylo 2016-07-22 18:47:45 -07:00
parent 2231f8e124
commit dd84177441
6 changed files with 4 additions and 24 deletions

View File

@ -68,7 +68,7 @@ define(
getCssClass: function () {
return "icon-connectivity";
},
getGlyphClass: function () {
getCssClass: function () {
return undefined;
},
getText: function () {

View File

@ -55,7 +55,7 @@ define(
return {
/**
* Get the glyph CSS class (single character used as an icon)
* Get the CSS class (single character used as an icon)
* to display in this indicator. This will return ".",
* which should appear as a database icon.
* @returns {string} the character of the database icon
@ -63,17 +63,6 @@ define(
getCssClass: function () {
return "icon-database";
},
/**
* Get the name of the CSS class to apply to the glyph.
* This is used to color the glyph to match its
* state (one of ok, caution or err)
* @returns {string} the CSS class to apply to this glyph
*/
getGlyphClass: function () {
return (watches > 2000) ? "caution" :
(watches < 1000) ? "ok" :
undefined;
},
/**
* Get the text that should appear in the indicator.
* @returns {string} brief summary of connection status

View File

@ -56,9 +56,6 @@ define(
getText: function () {
return latest;
},
getGlyphClass: function () {
return "";
},
getDescription: function () {
return "";
}

View File

@ -51,7 +51,7 @@ define(
});
it("provides displayable metadata", function () {
expect(action.getMetadata().glyph).toBeDefined();
expect(action.getMetadata().cssclass).toBeDefined();
});
});

View File

@ -44,10 +44,7 @@ define(
}
IdentityIndicator.prototype.getCssClass = function () {
return "icon-person";
};
IdentityIndicator.prototype.getGlyphClass = function () {
return undefined;
return this.text && "icon-person";
};
IdentityIndicator.prototype.getText = function () {
return this.text;

View File

@ -47,7 +47,6 @@ define(
name: "A User"
});
expect(indicator.getCssClass()).toEqual("icon-person");
expect(indicator.getGlyphClass()).toBeUndefined();
expect(indicator.getText()).toEqual("A User");
expect(indicator.getDescription().indexOf("testuserid"))
.not.toEqual(-1);
@ -55,7 +54,6 @@ define(
it("shows nothing while no user information is available", function () {
expect(indicator.getCssClass()).toBeUndefined();
expect(indicator.getGlyphClass()).toBeUndefined();
expect(indicator.getText()).toBeUndefined();
expect(indicator.getDescription()).toBeUndefined();
});
@ -63,7 +61,6 @@ define(
it("shows nothing when there is no identity information", function () {
mockPromise.then.mostRecentCall.args[0](undefined);
expect(indicator.getCssClass()).toBeUndefined();
expect(indicator.getGlyphClass()).toBeUndefined();
expect(indicator.getText()).toBeUndefined();
expect(indicator.getDescription()).toBeUndefined();
});