From 289a1d7e973681d1fa234b9efec5b370fab670ff Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Mon, 1 Dec 2014 10:09:56 -0500 Subject: [PATCH] Rename param & remove warnings from test --- cycledash/static/js/examine/RecordStore.js | 7 ++++--- tests/js/DataUtils.js | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cycledash/static/js/examine/RecordStore.js b/cycledash/static/js/examine/RecordStore.js index 7691f99..dcdb409 100644 --- a/cycledash/static/js/examine/RecordStore.js +++ b/cycledash/static/js/examine/RecordStore.js @@ -25,8 +25,9 @@ var DEFAULT_SORT_BYS = [{columnName: 'contig', order: 'asc'}, var ENTIRE_GENOME = {start: null, end: null, contig: types.ALL_CHROMOSOMES}; -// opt_dataSource is provided for testing. Its type is function(url, done_callback). -function createRecordStore(vcfId, dispatcher, opt_dataSource) { +// opt_testDataSource is provided for testing. +// Its type is function(url, done_callback). +function createRecordStore(vcfId, dispatcher, opt_testDataSource) { // Initial state of the store. This is mutable. There be monsters. var hasLoaded = false, loadError = null, @@ -54,7 +55,7 @@ function createRecordStore(vcfId, dispatcher, opt_dataSource) { // Token identifying this store within the dispatcher. var dispatcherToken = null; - var dataSource = opt_dataSource || networkDataSource; + var dataSource = opt_testDataSource || networkDataSource; function receiver(action) { switch(action.actionType) { diff --git a/tests/js/DataUtils.js b/tests/js/DataUtils.js index f3fe071..8169923 100644 --- a/tests/js/DataUtils.js +++ b/tests/js/DataUtils.js @@ -82,9 +82,9 @@ function makeFakeServer(vcfPath) { var genotypesUrl = '/runs/1/genotypes'; var get = function(path, callback) { if (path == '/runs/1/spec') { - callback([spec]); + callback(spec); } else if (path == '/runs/1/contigs') { - callback([{contigs: contigs}]); + callback({contigs: contigs}); } else if (path.slice(0, genotypesUrl.length) == genotypesUrl) { callback({ records: records,