cartodb-4.42/lib/assets/test/spec/dashboard/data/visualization-order-model.spec.js
2024-04-06 05:25:13 +00:00

32 lines
788 B
JavaScript

const VisualizationOrderModel = require('dashboard/data/visualization-order-model');
describe('dashboard/data/visualization-order-model', function () {
let model, visualization, url;
beforeEach(function () {
url = 'wadus.com';
visualization = {
id: 1337,
url: () => url
};
model = new VisualizationOrderModel({
visualization
});
});
describe('.initialize', function () {
it('sets this.visualization and unsets it from the attributes', function () {
expect(model.get('visualization')).toBeUndefined();
expect(model.visualization).toEqual(visualization);
});
});
describe('.url', function () {
it('returns the url properly', function () {
expect(model.url()).toEqual(`${url}/next_id`);
});
});
});