Move test pages into the tests folder

This commit is contained in:
JC Brand 2018-02-07 13:26:39 +01:00
parent 9c3e9233e4
commit e7aed050b4
7 changed files with 35 additions and 8 deletions

View File

@ -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

View File

@ -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
tests/inverse.html Normal file
View File

@ -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>

View File

@ -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 || {}));

View File

@ -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";

View File

@ -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();