|
|
|
@ -40,7 +40,7 @@ describe('cartodb3/data/analyses', function () {
|
|
|
|
|
|
|
|
|
|
describe('data observatory', function () {
|
|
|
|
|
afterEach(function () {
|
|
|
|
|
DataServicesApiCheck.get(this.configModel)._state = 'fetched';
|
|
|
|
|
DataServicesApiCheck.get(this.configModel)._ready = 'ready';
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var findDataObservatory = function (models) {
|
|
|
|
@ -50,14 +50,14 @@ describe('cartodb3/data/analyses', function () {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
it('dataservices api existing', function () {
|
|
|
|
|
DataServicesApiCheck.get(this.configModel)._state = 'fetched';
|
|
|
|
|
DataServicesApiCheck.get(this.configModel)._ready = 'ready';
|
|
|
|
|
var analysisModels = analyses.getAnalysesByModalCategory('create_clean', this.configModel);
|
|
|
|
|
expect(analysisModels.length).toBe(4);
|
|
|
|
|
expect(findDataObservatory(analysisModels).length).toBe(1);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('dataservices api not existing', function () {
|
|
|
|
|
DataServicesApiCheck.get(this.configModel)._state = 'error';
|
|
|
|
|
DataServicesApiCheck.get(this.configModel)._ready = 'notready';
|
|
|
|
|
var analysisModels = analyses.getAnalysesByModalCategory('create_clean', this.configModel);
|
|
|
|
|
expect(analysisModels.length).toBe(3);
|
|
|
|
|
expect(findDataObservatory(analysisModels).length).toBe(0);
|
|
|
|
|