cartodb-4.42/lib/assets/test/spec/fixtures/builder/query-rows-collection.fixture.js

22 lines
771 B
JavaScript
Raw Normal View History

2024-04-06 13:25:13 +08:00
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;