[Mobile] Test

QueryService (mock) added to the
ContextMenuGestureSpec to account
for isMobile call that allows/
disallows use of contextmenu
gesture.
This commit is contained in:
Shivam Dave
2015-07-23 16:55:45 -07:00
parent a89f9eed42
commit 200c6e49fc

View File

@@ -43,6 +43,7 @@ define(
mockBody, mockBody,
mockWindow, mockWindow,
mockRootScope, mockRootScope,
mockQueryService,
mockScope, mockScope,
mockElement, mockElement,
mockDomainObject, mockDomainObject,
@@ -59,12 +60,14 @@ define(
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"]);
mockScope = {}; mockScope = {};
mockQueryService = jasmine.createSpyObj("queryService", ["isMobile"]);
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);
mockEvent = jasmine.createSpyObj("event", ["preventDefault"]); mockEvent = jasmine.createSpyObj("event", ["preventDefault"]);
mockEvent.pageX = 0; mockEvent.pageX = 0;
mockEvent.pageY = 0; mockEvent.pageY = 0;
mockCompile.andReturn(mockCompiledTemplate); mockCompile.andReturn(mockCompiledTemplate);
mockCompiledTemplate.andReturn(mockMenu); mockCompiledTemplate.andReturn(mockMenu);
mockDocument.find.andReturn(mockBody); mockDocument.find.andReturn(mockBody);
@@ -75,6 +78,7 @@ define(
mockDocument, mockDocument,
mockWindow, mockWindow,
mockRootScope, mockRootScope,
mockQueryService,
mockElement, mockElement,
mockDomainObject mockDomainObject
); );