2
0
Эх сурвалжийг харах

Move test pages into the tests folder

JC Brand 7 жил өмнө
parent
commit
e7aed050b4

+ 1 - 1
Makefile

@@ -218,7 +218,7 @@ eslint: stamp-npm
 
 .PHONY: check
 check: eslint
-	LOG_CR_VERBOSITY=INFO $(CHROMIUM) --no-sandbox http://localhost:$(HTTPSERVE_PORT)/tests.html
+	LOG_CR_VERBOSITY=INFO $(CHROMIUM) --no-sandbox http://localhost:$(HTTPSERVE_PORT)/tests/index.html
 
 ########################################################################
 ## Documentation

+ 7 - 7
tests.html → tests/index.html

@@ -4,15 +4,15 @@
 <head>
     <title>Converse.js Tests</title>
     <meta name="description" content="Converse.js: A chat client for your website" />
-    <link rel="shortcut icon" type="image/png" href="node_modules/jasmine-core/images/jasmine_favicon.png">
+    <link rel="shortcut icon" type="image/png" href="../node_modules/jasmine-core/images/jasmine_favicon.png">
 
-    <link rel="stylesheet" type="text/css" media="screen" href="node_modules/jasmine-core/lib/jasmine-core/jasmine.css">
-    <link rel="stylesheet" type="text/css" media="screen" href="css/jasmine.css">
-    <link type="text/css" rel="stylesheet" media="screen" href="css/theme.css" />
-    <link type="text/css" rel="stylesheet" media="screen" href="css/converse.css" />
+    <link rel="stylesheet" type="text/css" media="screen" href="../node_modules/jasmine-core/lib/jasmine-core/jasmine.css">
+    <link rel="stylesheet" type="text/css" media="screen" href="../css/jasmine.css">
+    <link type="text/css" rel="stylesheet" media="screen" href="../css/theme.css" />
+    <link type="text/css" rel="stylesheet" media="screen" href="../css/converse.css" />
 
-    <script src="src/config.js"></script>
-    <script data-main="tests/runner" src="node_modules/requirejs/require.js"></script>
+    <script src="../src/config.js"></script>
+    <script data-main="runner" src="../node_modules/requirejs/require.js"></script>
 
     <style>
         .tests-brand-heading {

+ 17 - 0
tests/inverse.html

@@ -0,0 +1,17 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+  "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+    <title>Converse.js Tests</title>
+    <meta name="description" content="Converse.js: A chat client for your website" />
+    <link rel="shortcut icon" type="image/png" href="../node_modules/jasmine-core/images/jasmine_favicon.png">
+
+    <link rel="stylesheet" type="text/css" media="screen" href="../node_modules/jasmine-core/lib/jasmine-core/jasmine.css">
+    <link type="text/css" rel="stylesheet" media="screen" href="../css/inverse.css" />
+
+    <script src="../src/config.js"></script>
+    <script type="text/javascript">config.view_mode = 'fullscreen';</script>
+    <script data-main="runner" src="../node_modules/requirejs/require.js"></script>
+</head>
+<body></body>
+</html>

+ 4 - 0
tests/mock.js

@@ -6,6 +6,9 @@
     var Strophe = converse.env.Strophe;
     var $iq = converse.env.$iq;
     var mock = {};
+
+    mock.view_mode = 'overlayed';
+
     // Names from http://www.fakenamegenerator.com/
     mock.req_names = [
         'Louw Spekman', 'Mohamad Stet', 'Dominik Beyer'
@@ -110,6 +113,7 @@
             'no_trimming': true,
             'auto_login': true,
             'jid': 'dummy@localhost',
+            'view_mode': mock.view_mode,
             'password': 'secret',
             'debug': false
         }, settings || {}));

+ 1 - 0
tests/runner-transpiled.js

@@ -1,6 +1,7 @@
 /*global config */
 
 // Extra test dependencies
+config.baseUrl = '../';
 config.paths.jquery = "node_modules/jquery/dist/jquery";
 config.paths.mock = "tests/mock";
 config.paths['wait-until-promise'] = "node_modules/wait-until-promise/index";

+ 5 - 0
tests/runner.js

@@ -1,6 +1,7 @@
 /*global config */
 
 // Extra test dependencies
+config.baseUrl = '../';
 config.paths.jquery = "node_modules/jquery/dist/jquery";
 config.paths.mock = "tests/mock";
 config.paths['wait-until-promise'] = "node_modules/wait-until-promise/index";
@@ -58,6 +59,10 @@ var specs = [
 
 require(['console-reporter', 'mock', 'sinon', 'wait-until-promise', 'pluggable'],
         function(ConsoleReporter, mock, sinon, waitUntilPromise, pluggable) {
+
+    if (config.view_mode) {
+        mock.view_mode = config.view_mode;
+    }
     window.sinon = sinon;
     window.waitUntilPromise = waitUntilPromise.default;
     window.localStorage.clear();

+ 0 - 0
transpiled_tests.html → tests/transpiled.html