cartodb-4.42/lib/assets/test/spec/fixtures/builder/query-rows-collection.fixture.js
2024-04-06 05:25:13 +00:00

22 lines
771 B
JavaScript

var QueryRowsCollection = require('builder/data/query-rows-collection');
var getConfigModelFixture = require('fixtures/builder/config-model.fixture.js');
function getQueryRowsCollectionFixture (opts) {
opts = opts || {};
if (!opts.querySchemaModel) {
throw new Error('querySchemaModel is required for QueryRowsCollection fixture.');
}
var configModel = opts.configModel || getConfigModelFixture();
var initialStatus = opts.initialStatus || 'unfetched';
var queryRowsCollection = new QueryRowsCollection({}, {
configModel: configModel,
querySchemaModel: opts.querySchemaModel
});
queryRowsCollection.statusModel.set('status', initialStatus, { silent: true });
return queryRowsCollection;
}
module.exports = getQueryRowsCollectionFixture;