mirror of
https://github.com/nasa/openmct.git
synced 2025-02-09 20:31:22 +00:00
[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:
parent
2231f8e124
commit
dd84177441
@ -68,7 +68,7 @@ define(
|
|||||||
getCssClass: function () {
|
getCssClass: function () {
|
||||||
return "icon-connectivity";
|
return "icon-connectivity";
|
||||||
},
|
},
|
||||||
getGlyphClass: function () {
|
getCssClass: function () {
|
||||||
return undefined;
|
return undefined;
|
||||||
},
|
},
|
||||||
getText: function () {
|
getText: function () {
|
||||||
|
@ -55,7 +55,7 @@ define(
|
|||||||
|
|
||||||
return {
|
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 ".",
|
* to display in this indicator. This will return ".",
|
||||||
* which should appear as a database icon.
|
* which should appear as a database icon.
|
||||||
* @returns {string} the character of the database icon
|
* @returns {string} the character of the database icon
|
||||||
@ -63,17 +63,6 @@ define(
|
|||||||
getCssClass: function () {
|
getCssClass: function () {
|
||||||
return "icon-database";
|
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.
|
* Get the text that should appear in the indicator.
|
||||||
* @returns {string} brief summary of connection status
|
* @returns {string} brief summary of connection status
|
||||||
|
@ -56,9 +56,6 @@ define(
|
|||||||
getText: function () {
|
getText: function () {
|
||||||
return latest;
|
return latest;
|
||||||
},
|
},
|
||||||
getGlyphClass: function () {
|
|
||||||
return "";
|
|
||||||
},
|
|
||||||
getDescription: function () {
|
getDescription: function () {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ define(
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("provides displayable metadata", function () {
|
it("provides displayable metadata", function () {
|
||||||
expect(action.getMetadata().glyph).toBeDefined();
|
expect(action.getMetadata().cssclass).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -44,10 +44,7 @@ define(
|
|||||||
}
|
}
|
||||||
|
|
||||||
IdentityIndicator.prototype.getCssClass = function () {
|
IdentityIndicator.prototype.getCssClass = function () {
|
||||||
return "icon-person";
|
return this.text && "icon-person";
|
||||||
};
|
|
||||||
IdentityIndicator.prototype.getGlyphClass = function () {
|
|
||||||
return undefined;
|
|
||||||
};
|
};
|
||||||
IdentityIndicator.prototype.getText = function () {
|
IdentityIndicator.prototype.getText = function () {
|
||||||
return this.text;
|
return this.text;
|
||||||
|
@ -47,7 +47,6 @@ define(
|
|||||||
name: "A User"
|
name: "A User"
|
||||||
});
|
});
|
||||||
expect(indicator.getCssClass()).toEqual("icon-person");
|
expect(indicator.getCssClass()).toEqual("icon-person");
|
||||||
expect(indicator.getGlyphClass()).toBeUndefined();
|
|
||||||
expect(indicator.getText()).toEqual("A User");
|
expect(indicator.getText()).toEqual("A User");
|
||||||
expect(indicator.getDescription().indexOf("testuserid"))
|
expect(indicator.getDescription().indexOf("testuserid"))
|
||||||
.not.toEqual(-1);
|
.not.toEqual(-1);
|
||||||
@ -55,7 +54,6 @@ define(
|
|||||||
|
|
||||||
it("shows nothing while no user information is available", function () {
|
it("shows nothing while no user information is available", function () {
|
||||||
expect(indicator.getCssClass()).toBeUndefined();
|
expect(indicator.getCssClass()).toBeUndefined();
|
||||||
expect(indicator.getGlyphClass()).toBeUndefined();
|
|
||||||
expect(indicator.getText()).toBeUndefined();
|
expect(indicator.getText()).toBeUndefined();
|
||||||
expect(indicator.getDescription()).toBeUndefined();
|
expect(indicator.getDescription()).toBeUndefined();
|
||||||
});
|
});
|
||||||
@ -63,7 +61,6 @@ define(
|
|||||||
it("shows nothing when there is no identity information", function () {
|
it("shows nothing when there is no identity information", function () {
|
||||||
mockPromise.then.mostRecentCall.args[0](undefined);
|
mockPromise.then.mostRecentCall.args[0](undefined);
|
||||||
expect(indicator.getCssClass()).toBeUndefined();
|
expect(indicator.getCssClass()).toBeUndefined();
|
||||||
expect(indicator.getGlyphClass()).toBeUndefined();
|
|
||||||
expect(indicator.getText()).toBeUndefined();
|
expect(indicator.getText()).toBeUndefined();
|
||||||
expect(indicator.getDescription()).toBeUndefined();
|
expect(indicator.getDescription()).toBeUndefined();
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user