ONOS-6726: UI-Lion: Quick Help.
Change-Id: I4725ae58c3c8fea6b8cb9c50593bd40b51d13e1b
diff --git a/web/gui/src/main/webapp/tests/app/fw/layer/quickhelp-spec.js b/web/gui/src/main/webapp/tests/app/fw/layer/quickhelp-spec.js
index 6a86329..8f79e5c 100644
--- a/web/gui/src/main/webapp/tests/app/fw/layer/quickhelp-spec.js
+++ b/web/gui/src/main/webapp/tests/app/fw/layer/quickhelp-spec.js
@@ -15,7 +15,7 @@
*/
/*
- ONOS GUI -- Layer -- Flash Service - Unit Tests
+ ONOS GUI -- Layer -- Quick Help Service - Unit Tests
*/
describe('factory: fw/layer/quickhelp.js', function () {
var $log, fs, qhs, d3Elem,
@@ -39,7 +39,7 @@
'globalKeys', 'globalFormat', 'viewKeys', 'viewGestures'
];
- beforeEach(module('onosUtil', 'onosSvg', 'onosLayer'));
+ beforeEach(module('onosUtil', 'onosSvg', 'onosLayer', 'onosRemote'));
beforeEach(inject(function (_$log_, FnService, QuickHelpService) {
$log = _$log_;
@@ -115,12 +115,16 @@
expect($log.warn).toHaveBeenCalledWith(warning, neededBindings);
});
- it('should not warn if bindings are provided', function () {
+ it('should not warn if bindings are provided (except lion)', function () {
spyOn($log, 'warn');
expect(qhs.showQuickHelp(mockBindings)).toBe(undefined);
- expect($log.warn).not.toHaveBeenCalled();
+ expect($log.warn).toHaveBeenCalledWith(
+ 'No lion bundle registered:', 'core.fw.QuickHelp'
+ );
});
+ // TODO: consider testing localization of text
+
it('should append an svg', function () {
var svg = d3Elem.select('svg');
expect(d3Elem.empty()).toBe(false);
@@ -149,7 +153,8 @@
expect(rect.attr('rx')).toBe('8');
text = g.select('text');
- expect(text.text()).toBe('Quick Help');
+ // NOTE: we aren't mocking localization, so should get %...% key tag
+ expect(text.text()).toBe('%qh_title%');
expect(text.classed('title')).toBe(true);
expect(text.attr('dy')).toBe('1.2em');
expect(text.attr('transform')).toBeTruthy();