cartodb-4.42/lib/assets/test/spec/builder/data/vis-definition-model.spec.js

29 lines
798 B
JavaScript
Raw Normal View History

2024-04-06 13:25:13 +08:00
var ConfigModel = require('builder/data/config-model');
var VisDefinitionModel = require('builder/data/vis-definition-model');
describe('data/vis-definition-model', function () {
beforeEach(function () {
var configModel = new ConfigModel({
base_url: '/u/pepe'
});
this.model = new VisDefinitionModel({
id: 'v-123',
map_id: 'm-123'
}, {
configModel: configModel
});
});
it('should have a url', function () {
expect(this.model.url()).toEqual('/u/pepe/api/v1/viz/v-123');
});
it('should have an embed url', function () {
expect(this.model.embedURL()).toEqual('/u/pepe/builder/v-123/embed');
});
it('should have a mapcap url', function () {
expect(this.model.mapcapsURL()).toEqual('/u/pepe/api/v3/viz/v-123/mapcaps');
});
});