[Pkg-owncloud-commits] [owncloud] 35/273: Test runner now loads CSS and hides testArea

David Prévot taffit at moszumanska.debian.org
Fri Jul 4 03:12:55 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit a7e7e86df0f8494de253e2d81e1fae13be2c138c
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Tue Jun 24 16:27:39 2014 +0200

    Test runner now loads CSS and hides testArea
    
    - serve CSS and font files properly to make sure that measurements are
      correct for the tests that need them (breadcrumb)
    - added opacity to testArea to make sure nothing is visible during
      testing
---
 core/js/tests/specHelper.js |  2 +-
 tests/karma.config.js       | 18 ++++++++++++------
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/core/js/tests/specHelper.js b/core/js/tests/specHelper.js
index 2af3497..3d208d9 100644
--- a/core/js/tests/specHelper.js
+++ b/core/js/tests/specHelper.js
@@ -85,7 +85,7 @@ window.Snap.prototype = {
 	beforeEach(function() {
 		// test area for elements that need absolute selector access or measure widths/heights
 		// which wouldn't work for detached or hidden elements
-		$testArea = $('<div id="testArea" style="position: absolute; width: 1280px; height: 800px; top: -3000px; left: -3000px;"></div>');
+		$testArea = $('<div id="testArea" style="position: absolute; width: 1280px; height: 800px; top: -3000px; left: -3000px; opacity: 0;"></div>');
 		$('body').append($testArea);
 		// enforce fake XHR, tests should not depend on the server and
 		// must use fake responses for expected calls
diff --git a/tests/karma.config.js b/tests/karma.config.js
index 2907906..14a0d7e 100644
--- a/tests/karma.config.js
+++ b/tests/karma.config.js
@@ -110,15 +110,16 @@ module.exports = function(config) {
 	// core mocks
 	files.push(corePath + 'tests/specHelper.js');
 
+	var srcFile, i;
 	// add core library files
-	for ( var i = 0; i < coreModule.libraries.length; i++ ) {
-		var srcFile = corePath + coreModule.libraries[i];
+	for ( i = 0; i < coreModule.libraries.length; i++ ) {
+		srcFile = corePath + coreModule.libraries[i];
 		files.push(srcFile);
 	}
 
 	// add core modules files
-	for ( var i = 0; i < coreModule.modules.length; i++ ) {
-		var srcFile = corePath + coreModule.modules[i];
+	for ( i = 0; i < coreModule.modules.length; i++ ) {
+		srcFile = corePath + coreModule.modules[i];
 		files.push(srcFile);
 		if (enableCoverage) {
 			preprocessors[srcFile] = 'coverage';
@@ -155,12 +156,15 @@ module.exports = function(config) {
 	}
 
 	// add source files for apps to test
-	for ( var i = 0; i < appsToTest.length; i++ ) {
+	for ( i = 0; i < appsToTest.length; i++ ) {
 		addApp(appsToTest[i]);
 	}
 
 	// serve images to avoid warnings
 	files.push({pattern: 'core/img/**/*', watched: false, included: false, served: true});
+	
+	// include core CSS
+	files.push({pattern: 'core/css/*.css', watched: true, included: true, served: true});
 
 	config.set({
 
@@ -180,7 +184,9 @@ module.exports = function(config) {
 
 		proxies: {
 			// prevent warnings for images
-			'/context.html//core/img/': 'http://localhost:9876/base/core/img/'
+			'/context.html//core/img/': 'http://localhost:9876/base/core/img/',
+			'/context.html//core/css/': 'http://localhost:9876/base/core/css/',
+			'/context.html//core/fonts/': 'http://localhost:9876/base/core/fonts/'
 		},
 
 		// test results reporter to use

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list