mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-15 14:03:27 +00:00
Fix #1190 Use phantom JS to run qunit tests
This commit is contained in:
@@ -63,6 +63,9 @@ matrix:
|
||||
- php: 5.5
|
||||
|
||||
script:
|
||||
- phantomjs www/assets/qunit/addons/phantomjs/runner.js www/include/js/tests/jquery.Upload.js.html
|
||||
- phantomjs www/assets/qunit/addons/phantomjs/runner.js www/include/js/tests/jquery.Edit.js.html
|
||||
- phantomjs www/assets/qunit/addons/phantomjs/runner.js www/include/js/tests/jquery.Selection.js.html
|
||||
- sh tests/js/scripts/run.sh --single-run
|
||||
- mocha-phantomjs www/scripts/tests/index.html
|
||||
- phpunit
|
||||
|
@@ -15,7 +15,7 @@
|
||||
"json3" : "3.2.4",
|
||||
"bootstrap-switch": "https://github.com/nostalgiaz/bootstrap-switch.git",
|
||||
"humane-js": "~3.0.6",
|
||||
"qunit": "~1.11.0",
|
||||
"qunit": "https://github.com/jquery/qunit.git#1.11.0",
|
||||
"mustache": "~0.7.2",
|
||||
"jquery-file-upload": "https://github.com/blueimp/jQuery-File-Upload/archive/75d11179fd9c248c061c8eb428782bb556c8db0a.zip",
|
||||
"blueimp-load-image": "latest",
|
||||
|
@@ -3,10 +3,10 @@
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<script src="http://code.jquery.com/jquery-latest.js"></script>
|
||||
<script src="/include/vendor/qunit/qunit/qunit.js"></script>
|
||||
<script src="../../../assets/jquery/jquery.js"></script>
|
||||
<script src="../../../assets/qunit/qunit/qunit.js"></script>
|
||||
<script src="../jquery.Edit.js"></script>
|
||||
<link type="text/css" rel="stylesheet" href="/assets/qunit/qunit.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="../../../assets/qunit/qunit/qunit.css"/>
|
||||
<script> $(document).ready(function(){
|
||||
|
||||
|
||||
|
@@ -3,13 +3,13 @@
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<script src="http://code.jquery.com/jquery-latest.js"></script>
|
||||
<script src="/include/vendor/qunit/qunit/qunit.js"></script>
|
||||
<script src="../../../assets/jquery/jquery.js"></script>
|
||||
<script src="../../../assets/qunit/qunit/qunit.js"></script>
|
||||
<script src="../jquery.Selection.js"></script>
|
||||
<link type="text/css" rel="stylesheet" href="/assets/qunit/qunit.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="../../../assets/qunit/qunit.css"/>
|
||||
<script> $(document).ready(function(){
|
||||
|
||||
|
||||
|
||||
|
||||
test("Selection instanciation", function() {
|
||||
var sel = new Selectable($('#test_box2'));
|
||||
var array = new Array();
|
||||
@@ -18,26 +18,26 @@
|
||||
});
|
||||
|
||||
module("Add datas");
|
||||
|
||||
|
||||
test("first test within module", function() {
|
||||
var sel = new Selectable($('#test_box3'));
|
||||
sel.push('a');
|
||||
equal( 1, sel.get().length, "We expect the selection to be empty" );
|
||||
equal( 'a', sel.get().pop(), "We expect the selection to be empty" );
|
||||
});
|
||||
|
||||
|
||||
module("Multiple selections");
|
||||
|
||||
|
||||
test("first test within module", function() {
|
||||
var sel1 = new Selectable($('#test_box4'));
|
||||
var sel2 = new Selectable($('#test_box5'));
|
||||
|
||||
|
||||
sel1.push('a');
|
||||
sel2.push('b');
|
||||
|
||||
|
||||
equal( 1, sel1.get().length, "We expect the selection to be empty" );
|
||||
equal( 'a', sel1.get().pop(), "We expect the selection to be empty" );
|
||||
|
||||
|
||||
equal( 1, sel2.get().length, "We expect the selection to be empty" );
|
||||
equal( 'b', sel2.get().pop(), "We expect the selection to be empty" );
|
||||
});
|
||||
@@ -52,16 +52,16 @@
|
||||
, callbackSelection : function(elem){
|
||||
var lst = jQuery('li', $('#test_box1'));
|
||||
var index = jQuery.inArray( elem[0], lst );
|
||||
|
||||
|
||||
return 'item' + index;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
equal(true, $('#test_box1').hasClass('selectionnable'));
|
||||
equal(0, sel1.length(), 'Nothing is selected');
|
||||
equal(0, sel1.size(), 'Nothing is selected');
|
||||
|
||||
|
||||
sel1.selectAll();
|
||||
|
||||
equal(0, $('#test_box li:not(.selected)').length);
|
||||
@@ -76,57 +76,57 @@
|
||||
$('#test_box1 li:not(.selected):first').trigger('click');
|
||||
|
||||
equal(1, sel1.size(), 'First element selection');
|
||||
|
||||
|
||||
var SKevent = jQuery.Event('click', { shiftKey : true });
|
||||
|
||||
|
||||
$('#test_box1 li:not(.selected)').filter(':last').trigger(SKevent);
|
||||
|
||||
|
||||
equal(sel1.length(), 10, 'Shift click selection');
|
||||
equal(sel1.size(), 10);
|
||||
|
||||
|
||||
|
||||
sel1.empty();
|
||||
|
||||
|
||||
equal(0, $('#test_box li:not(.selected)').length);
|
||||
|
||||
|
||||
$('#test_box1 li:not(.selected):last').trigger('click');
|
||||
|
||||
equal(1, sel1.size(), 'Last element selection');
|
||||
|
||||
|
||||
var SKevent = jQuery.Event('click', { shiftKey : true });
|
||||
|
||||
|
||||
$('#test_box1 li:not(.selected)').filter(':first').trigger(SKevent);
|
||||
|
||||
|
||||
equal(sel1.length(), 10, 'Shift click selection reversed');
|
||||
equal(sel1.size(), 10);
|
||||
|
||||
|
||||
$('#test_box1 li:first').trigger('click');
|
||||
|
||||
|
||||
equal(sel1.length(), 1, 'Start new selection');
|
||||
|
||||
|
||||
equal($('#test_box1 li:last').hasClass('selected'), false, 'last item does not have selected class');
|
||||
|
||||
|
||||
var CKevent = jQuery.Event('click', { ctrlKey : true });
|
||||
$('#test_box1 li:last').trigger(CKevent);
|
||||
|
||||
|
||||
equal(sel1.length(), 2, 'Ctrl click');
|
||||
|
||||
|
||||
var CKevent = jQuery.Event('click', { ctrlKey : true });
|
||||
$('#test_box1 li:last').trigger(CKevent);
|
||||
|
||||
|
||||
equal(sel1.length(), 1, 'Ctrl click');
|
||||
|
||||
|
||||
var CKevent = jQuery.Event('click', { ctrlKey : true });
|
||||
$('#test_box1 li:last').trigger(CKevent);
|
||||
|
||||
|
||||
equal(sel1.length(), 2, 'Ctrl click');
|
||||
|
||||
|
||||
|
||||
|
||||
equal(sel1.serialize(), 'item0;item9');
|
||||
equal(sel1.serialize('!u'), 'item0!uitem9');
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
@@ -3,12 +3,12 @@
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<script src="http://code.jquery.com/jquery-latest.js"></script>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.js"></script>
|
||||
<script src="/include/vendor/qunit/qunit/qunit.js"></script>
|
||||
<script src="/include/jslibs/blueimp.load-image.js"></script>
|
||||
<script src="../../../assets/jquery/jquery.js"></script>
|
||||
<script src="../../jslibs/jquery-ui-1.8/js/jquery-ui-1.8.17.custom.min.js"></script>
|
||||
<script src="../../../assets/qunit/qunit/qunit.js"></script>
|
||||
<script src="../../../assets/blueimp-load-image/load-image.js"></script>
|
||||
<script src="../../../skins/prod/jquery.Upload.js"></script>
|
||||
<link type="text/css" rel="stylesheet" href="/assets/qunit/qunit.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="../../../assets/qunit/qunit/qunit.css"/>
|
||||
<script> $(document).ready(function(){
|
||||
|
||||
var getUploadManager = function(){
|
||||
|
Reference in New Issue
Block a user