Fixed Snap mock

Also fixed JSHint errors
This commit is contained in:
Vincent Petry 2014-06-06 09:55:32 +02:00
parent b8ab77a475
commit d764aaa427
1 changed files with 10 additions and 5 deletions

View File

@ -19,15 +19,12 @@
*
*/
/* global OC */
/**
* Simulate the variables that are normally set by PHP code
*/
// from core/js/config.php
window.TESTING = true;
window.oc_debug = true;
window.datepickerFormatDate = 'MM d, yy';
window.dayNames = [
'Sunday',
@ -55,6 +52,8 @@ window.monthNames = [
window.firstDay = 0;
// setup dummy webroots
/* jshint camelcase: false */
window.oc_debug = true;
window.oc_webroot = location.href + '/';
window.oc_appswebroots = {
"files": window.oc_webroot + '/apps/files/'
@ -68,14 +67,20 @@ window.oc_appconfig = {
};
window.oc_defaults = {};
/* jshint camelcase: true */
// mock for Snap.js plugin
window.Snap = function() {};
window.Snap.prototype = {
enable: function() {},
disable: function() {},
close: function() {}
};
// global setup for all tests
(function setupTests() {
var fakeServer = null,
$testArea = null,
routesRequestStub;
$testArea = null;
beforeEach(function() {
// test area for elements that need absolute selector access or measure widths/heights