mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Tests, qunit: galaxy_config.root->Galaxy.root, correct locations and shims of underscore and backbone in qunit tests
This commit is contained in:
@@ -22,7 +22,7 @@ var HistoryDatasetAssociation = _super.extend( BASE_MVC.mixin( hcontentMixin,
|
||||
constructor : function( attrs, options ){
|
||||
hcontentMixin.constructor.call( this, attrs, options );
|
||||
},
|
||||
|
||||
|
||||
/** default attributes for a model */
|
||||
defaults : _.extend( {}, _super.prototype.defaults, hcontentMixin.defaults, {
|
||||
model_class : 'HistoryDatasetAssociation'
|
||||
|
||||
@@ -22,7 +22,7 @@ define([
|
||||
window.Galaxy.currHistoryPanel = { model: new Backbone.Model() }
|
||||
window.fakeserver = sinon.fakeServer.create();
|
||||
for (var route in serverdata) {
|
||||
window.fakeserver.respondWith('GET', galaxy_config.root + route, [ 200, { 'Content-Type': 'application/json' }, serverdata[ route ].data ]);
|
||||
window.fakeserver.respondWith('GET', Galaxy.root + route, [ 200, { 'Content-Type': 'application/json' }, serverdata[ route ].data ]);
|
||||
}
|
||||
},
|
||||
destroy: function() {
|
||||
|
||||
@@ -8,7 +8,7 @@ require.config({
|
||||
paths: {
|
||||
// Custom paths for Galaxy dependencies...
|
||||
"jquery": "libs/jquery/jquery",
|
||||
"backbone": "libs/backbone/backbone",
|
||||
"backbone": "libs/backbone",
|
||||
// Custom paths for qunit testing dependencies...
|
||||
"QUnit": qunit_absolute_directory + "test-libs/qunit-1.14.0", // .. because baseUrl is scripts to match Galaxy.
|
||||
"sinon": qunit_absolute_directory + "test-libs/sinon-1.9.1",
|
||||
@@ -44,12 +44,16 @@ require.config({
|
||||
"backbone": {
|
||||
deps: [ 'libs/underscore', 'jquery' ],
|
||||
exports: "Backbone"
|
||||
},
|
||||
"libs/backbone": {
|
||||
deps: [ 'libs/underscore', 'jquery' ],
|
||||
exports: "Backbone"
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
// Mock out Galaxy globals.
|
||||
var galaxy_config = {
|
||||
var Galaxy = {
|
||||
root: '/'
|
||||
};
|
||||
|
||||
@@ -64,7 +68,7 @@ require( [ "jquery", "QUnit" ], function( $, QUnit ) {
|
||||
|
||||
// underscore + backbone loaded here because they are assumed globals by
|
||||
// much of the Galaxy client code.
|
||||
require( [ "libs/underscore", "backbone" ], function( _, Backbone ) {
|
||||
require( [ "libs/underscore", "libs/backbone" ], function( _, Backbone ) {
|
||||
require( [ test_module_path ], function( ) {
|
||||
QUnit.load();
|
||||
QUnit.start();
|
||||
|
||||
@@ -36,7 +36,7 @@ define([
|
||||
// build app
|
||||
return new App({
|
||||
id : null,
|
||||
urls : { get_datatypes : galaxy_config.root + 'api/datatypes/mapping' }
|
||||
urls : { get_datatypes : Galaxy.root + 'api/datatypes/mapping' }
|
||||
});
|
||||
};
|
||||
|
||||
@@ -480,7 +480,7 @@ define([
|
||||
|
||||
var outputTerminal = new Terminals.OutputTerminal( { name: "TestOuptut", datatypes: [ outputType ] } );
|
||||
outputTerminal.node = { markChanged: function() {}, post_job_actions: [], hasMappedOverInputTerminals: function() { return false; }, hasConnectedOutputTerminals: function() { return true; } };
|
||||
outputTerminal.terminalMapping = { disableMapOver: function() {}, mapOver: Terminals.NULL_COLLECTION_TYPE_DESCRIPTION };
|
||||
outputTerminal.terminalMapping = { disableMapOver: function() {}, mapOver: Terminals.NULL_COLLECTION_TYPE_DESCRIPTION };
|
||||
var c = new Connector( outputTerminal, terminal );
|
||||
|
||||
return c;
|
||||
@@ -860,7 +860,7 @@ define([
|
||||
}
|
||||
|
||||
ok( inputTerminal.attachable( outputTerminal ) );
|
||||
|
||||
|
||||
// Go further... make sure datatypes are being enforced
|
||||
inputTerminal.datatypes = [ "bam" ];
|
||||
outputTerminal.datatypes = [ "txt" ];
|
||||
|
||||
Reference in New Issue
Block a user