VulpesOS/gaia/apps/verticalhome/test/unit/mock_app.js
OverSu b38dea0597 Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
2026-09-30 23:13:03 +02:00

60 lines
1.2 KiB
JavaScript
Executable file

'use strict';
function MockApp() {
MockApp.initialized = false;
MockApp.mIcons = {};
MockApp.mItems = [];
}
MockApp.prototype = {
HIDDEN_ROLES: [
'system', 'keyboard', 'homescreen', 'search', 'addon', 'langpack'
],
init: function() {
MockApp.initialized = true;
},
mGetInitialized: function () {
return MockApp.initialized;
},
itemStore: {
save: function() {},
deferredSave: function() {}
},
grid: {
add: function(detail) {
if (detail) {
MockApp.mItems.push(detail);
}
},
appendItemToExpandedGroup: function(detail) {
if (detail) {
MockApp.mItems.push(detail);
}
},
removeIconByIdentifier: function(identifier) {
delete MockApp.mIcons[identifier];
},
removeItemByIndex: function(idx) {
MockApp.mItems.splice(idx, 1);
},
getIcons: function() {
return MockApp.mIcons;
},
getItems: function() {
return MockApp.mItems;
},
render: function() {},
_grid: {
dragdrop: {
inEditMode: false
}
}
}
};
MockApp.mTeardown = function mp_mTeardown() {
delete MockApp.initialized;
MockApp.mIcons = {};
MockApp.mItems = [];
};