From dd84177441e449f1534b3f528101be221059b11e Mon Sep 17 00:00:00 2001 From: Charles Hacskaylo Date: Fri, 22 Jul 2016 18:47:45 -0700 Subject: [PATCH] [Frontend] Updated tests and examples for glyph refactoring Fixes #1047 WIP: Fixing test cases: fixed test in Timers that was expecting glyph return; --- example/profiling/src/DigestIndicator.js | 2 +- example/profiling/src/WatchIndicator.js | 13 +------------ example/worker/src/FibonacciIndicator.js | 3 --- .../browse/test/windowing/FullscreenActionSpec.js | 2 +- platform/identity/src/IdentityIndicator.js | 5 +---- platform/identity/test/IdentityIndicatorSpec.js | 3 --- 6 files changed, 4 insertions(+), 24 deletions(-) diff --git a/example/profiling/src/DigestIndicator.js b/example/profiling/src/DigestIndicator.js index fe0bba400a..10909e9a20 100644 --- a/example/profiling/src/DigestIndicator.js +++ b/example/profiling/src/DigestIndicator.js @@ -68,7 +68,7 @@ define( getCssClass: function () { return "icon-connectivity"; }, - getGlyphClass: function () { + getCssClass: function () { return undefined; }, getText: function () { diff --git a/example/profiling/src/WatchIndicator.js b/example/profiling/src/WatchIndicator.js index 07f7b40a2f..1e9ef5e386 100644 --- a/example/profiling/src/WatchIndicator.js +++ b/example/profiling/src/WatchIndicator.js @@ -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 diff --git a/example/worker/src/FibonacciIndicator.js b/example/worker/src/FibonacciIndicator.js index e2b516f27a..777fb3d2f5 100644 --- a/example/worker/src/FibonacciIndicator.js +++ b/example/worker/src/FibonacciIndicator.js @@ -56,9 +56,6 @@ define( getText: function () { return latest; }, - getGlyphClass: function () { - return ""; - }, getDescription: function () { return ""; } diff --git a/platform/commonUI/browse/test/windowing/FullscreenActionSpec.js b/platform/commonUI/browse/test/windowing/FullscreenActionSpec.js index bf2d520b3a..913535fa59 100644 --- a/platform/commonUI/browse/test/windowing/FullscreenActionSpec.js +++ b/platform/commonUI/browse/test/windowing/FullscreenActionSpec.js @@ -51,7 +51,7 @@ define( }); it("provides displayable metadata", function () { - expect(action.getMetadata().glyph).toBeDefined(); + expect(action.getMetadata().cssclass).toBeDefined(); }); }); diff --git a/platform/identity/src/IdentityIndicator.js b/platform/identity/src/IdentityIndicator.js index befc220307..9a03df5f51 100644 --- a/platform/identity/src/IdentityIndicator.js +++ b/platform/identity/src/IdentityIndicator.js @@ -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; diff --git a/platform/identity/test/IdentityIndicatorSpec.js b/platform/identity/test/IdentityIndicatorSpec.js index aed7094fc7..3fd75e6cff 100644 --- a/platform/identity/test/IdentityIndicatorSpec.js +++ b/platform/identity/test/IdentityIndicatorSpec.js @@ -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(); });