Files
cartodb/lib/assets/test/spec/dashboard/data/dataset-url-model.spec.js
2020-06-15 10:58:47 +08:00

32 lines
1.0 KiB
JavaScript

const DatasetUrlModel = require('dashboard/data/dataset-url-model');
describe('dashboard/data/dataset-url-model', function () {
beforeEach(function () {
this.url = new DatasetUrlModel({
base_url: 'http://team.carto.com/u/pepe/tables/awesome_data'
});
});
describe('.edit', function () {
beforeEach(function () {
this.newUrl = this.url.edit();
});
it('should return a new URL pointing at the page where the map can be edited', function () {
expect(this.newUrl).not.toBe(this.url);
expect(this.newUrl.get('base_url')).toEqual('http://team.carto.com/u/pepe/tables/awesome_data');
});
});
describe('.public', function () {
beforeEach(function () {
this.newUrl = this.url.public();
});
it('should return a new URL pointing at the page where the map can be seen publically', function () {
expect(this.newUrl).not.toBe(this.url);
expect(this.newUrl.get('base_url')).toEqual('http://team.carto.com/u/pepe/tables/awesome_data/public');
});
});
});