cartodb-4.42/lib/assets/test/spec/dashboard/shared/header-view-model.js

26 lines
712 B
JavaScript
Raw Normal View History

2024-04-06 13:25:13 +08:00
/**
* 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);
};