cartodb-4.42/lib/assets/test/spec/dashboard/shared/header-view-model.js
2024-04-06 05:25:13 +00:00

26 lines
712 B
JavaScript

/**
* Shared tests for a dashboard header view model
*
* Expected to be called within the scope of the test, e.g.:
* describe('./my_header_view_model', function() {}
* beforeEach(function() {
* this.viewModel = new MyHeaderViewModel({ ... })
* });
* sharedTests.call(this)
*/
var REQUIRED_FUNCTIONS = [
'breadcrumbTitle',
'isBreadcrumbDropdownEnabled',
'isDisplayingDatasets',
'isDisplayingMaps',
'isDisplayingLockedItems'
];
module.exports = function () {
REQUIRED_FUNCTIONS.forEach(function (functionName) {
it('should have a ' + functionName + 'function', function () {
expect(this.viewModel[functionName]).toEqual(jasmine.any(Function));
});
}, this);
};