mirror of
https://github.com/nasa/openmct.git
synced 2025-03-03 04:49:43 +00:00
[Mobile] Tests/Header
Removes back arrow on desktops. Also added queryService to tests for the context menu action and gesture.
This commit is contained in:
parent
84b9e4d781
commit
7cc14a195b
@ -21,7 +21,7 @@
|
|||||||
-->
|
-->
|
||||||
<div class='object-header object-header-mobile'>
|
<div class='object-header object-header-mobile'>
|
||||||
<span class="label s-label">
|
<span class="label s-label">
|
||||||
<mct-representation key="'back-arrow'"></mct-representation>
|
<mct-representation class="desktop-hide" key="'back-arrow'"></mct-representation>
|
||||||
<span class='type-icon icon ui-symbol'>{{type.getGlyph()}}</span>
|
<span class='type-icon icon ui-symbol'>{{type.getGlyph()}}</span>
|
||||||
<span ng-if="parameters.mode" class='action'>{{parameters.mode}}</span>
|
<span ng-if="parameters.mode" class='action'>{{parameters.mode}}</span>
|
||||||
<span class='type-name'>{{type.getName()}}</span>
|
<span class='type-name'>{{type.getName()}}</span>
|
||||||
|
@ -43,6 +43,7 @@ define(
|
|||||||
mockBody,
|
mockBody,
|
||||||
mockWindow,
|
mockWindow,
|
||||||
mockRootScope,
|
mockRootScope,
|
||||||
|
mockQueryService,
|
||||||
mockScope,
|
mockScope,
|
||||||
mockElement,
|
mockElement,
|
||||||
mockDomainObject,
|
mockDomainObject,
|
||||||
@ -58,6 +59,7 @@ define(
|
|||||||
mockBody = jasmine.createSpyObj("body", JQLITE_FUNCTIONS);
|
mockBody = jasmine.createSpyObj("body", JQLITE_FUNCTIONS);
|
||||||
mockWindow = { innerWidth: MENU_DIMENSIONS[0] * 4, innerHeight: MENU_DIMENSIONS[1] * 4 };
|
mockWindow = { innerWidth: MENU_DIMENSIONS[0] * 4, innerHeight: MENU_DIMENSIONS[1] * 4 };
|
||||||
mockRootScope = jasmine.createSpyObj("$rootScope", ["$new"]);
|
mockRootScope = jasmine.createSpyObj("$rootScope", ["$new"]);
|
||||||
|
mockQueryService = jasmine.createSpyObj("queryService", ["isMobile"]);
|
||||||
mockScope = {};
|
mockScope = {};
|
||||||
mockElement = jasmine.createSpyObj("element", JQLITE_FUNCTIONS);
|
mockElement = jasmine.createSpyObj("element", JQLITE_FUNCTIONS);
|
||||||
mockDomainObject = jasmine.createSpyObj("domainObject", DOMAIN_OBJECT_METHODS);
|
mockDomainObject = jasmine.createSpyObj("domainObject", DOMAIN_OBJECT_METHODS);
|
||||||
@ -77,6 +79,7 @@ define(
|
|||||||
mockDocument,
|
mockDocument,
|
||||||
mockWindow,
|
mockWindow,
|
||||||
mockRootScope,
|
mockRootScope,
|
||||||
|
mockQueryService,
|
||||||
mockActionContext
|
mockActionContext
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -35,7 +35,8 @@ define(
|
|||||||
|
|
||||||
|
|
||||||
describe("The 'context menu' gesture", function () {
|
describe("The 'context menu' gesture", function () {
|
||||||
var mockElement,
|
var mockTimeout,
|
||||||
|
mockElement,
|
||||||
mockQueryService,
|
mockQueryService,
|
||||||
mockDomainObject,
|
mockDomainObject,
|
||||||
mockEvent,
|
mockEvent,
|
||||||
@ -44,11 +45,13 @@ define(
|
|||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
mockElement = jasmine.createSpyObj("element", JQLITE_FUNCTIONS);
|
mockElement = jasmine.createSpyObj("element", JQLITE_FUNCTIONS);
|
||||||
|
mockTimeout = jasmine.createSpy("$timeout");
|
||||||
|
mockQueryService = jasmine.createSpyObj("queryService", ["isMobile"]);
|
||||||
mockDomainObject = jasmine.createSpyObj("domainObject", DOMAIN_OBJECT_METHODS);
|
mockDomainObject = jasmine.createSpyObj("domainObject", DOMAIN_OBJECT_METHODS);
|
||||||
mockEvent = jasmine.createSpyObj("event", ["preventDefault"]);
|
mockEvent = jasmine.createSpyObj("event", ["preventDefault"]);
|
||||||
mockQueryService = jasmine.createSpyObj("queryService", ["isMobile"]);
|
mockQueryService = jasmine.createSpyObj("queryService", ["isMobile"]);
|
||||||
|
|
||||||
gesture = new ContextMenuGesture(mockQueryService, mockElement, mockDomainObject);
|
gesture = new ContextMenuGesture(mockTimeout, mockQueryService, mockElement, mockDomainObject);
|
||||||
|
|
||||||
// Capture the contextmenu callback
|
// Capture the contextmenu callback
|
||||||
fireGesture = mockElement.on.mostRecentCall.args[1];
|
fireGesture = mockElement.on.mostRecentCall.args[1];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user