Added tests for Toggles
This commit is contained in:
1 parent
d23719c2a8
commit
e4cdc6b85a
16 files changed
+309
-160
No files matched your search
+1
-1
@@ -1,2 +1,2 @@
|
||||
/*! For license information please see CookieMonster.js.LICENSE.txt */
|
||||
(()=>{var e={877:function(e){!function(t,o){"use strict";"object"!=typeof e.exports?o(t):e.exports=t.document?o(t):function(e){if(!e.document)throw new Error("jscolor needs a window with document");return o(e)}}("undefined"!=typeof window?window:this,(function(e){"use strict";var t,o,n,i,a=((i={initialized:!1,instances:[],readyQueue:[],register:function(){void 0!==e&&e.document&&e.document.addEventListener("DOMContentLoaded",i.pub.init,!1)},installBySelector:function(t,o){if(!(o=o?i.node(o):e.document))throw new Error("Missing root node");for(var n=o.querySelectorAll(t),a=new RegExp("(^|\\s)("+i.pub.lookupClass+")(\\s*(\\{[^}]*\\})|\\s|$)","i"),r=0;r<n.length;r+=1){var l,s;if(!(n[r].jscolor&&n[r].jscolor instanceof i.pub)&&(void 0===n[r].type||"color"!=n[r].type.toLowerCase()||!i.isColorAttrSupported)&&(null!==(l=i.getDataAttr(n[r],"jscolor"))||n[r].className&&(s=n[r].className.match(a)))){var c=n[r],d="";null!==l?d=l:s&&(console.warn('Installation using class name is DEPRECATED. Use data-jscolor="" attribute instead.'+i.docsRef),s[4]&&(d=s[4]));var p=null;if(d.trim())try{p=i.parseOptionsStr(d)}catch(e){console.warn(e+"\n"+d)}try{new i.pub(c,p)}catch(e){console.warn(e)}}}},parseOptionsStr:function(e){var t=null;try{t=JSON.parse(e)}catch(o){if(!i.pub.looseJSON)throw new Error("Could not parse jscolor options as JSON: "+o);try{t=new Function("var opts = ("+e+'); return typeof opts === "object" ? opts : {};')()}catch(e){throw new Error("Could not evaluate jscolor options: "+e)}}return t},getInstances:function(){for(var e=[],t=0;t<i.instances.length;t+=1)i.instances[t]&&i.instances[t].targetElement&&e.push(i.instances[t]);return e},createEl:function(t){var o=e.document.createElement(t);return i.setData(o,"gui",!0),o},node:function(t){if(!t)return null;if("string"==typeof t){var o=t,n=null;try{n=e.document.querySelector(o)}catch(e){return console.warn(e),null}return n||console.warn("No element matches the selector: %s",o),n}return i.isNode(t)?t:(console.warn("Invalid node of type %s: %s",typeof t,t),null)},isNode:function(e){return"object"==typeof Node?e instanceof Node:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},nodeName:function(e){return!(!e||!e.nodeName)&&e.nodeName.toLowerCase()},removeChildren:function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},isTextInput:function(e){return e&&"input"===i.nodeName(e)&&"text"===e.type.toLowerCase()},isButton:function(e){if(!e)return!1;var t=i.nodeName(e);return"button"===t||"input"===t&&["button","submit","reset"].indexOf(e.type.toLowerCase())>-1},isButtonEmpty:function(e){switch(i.nodeName(e)){case"input":return!e.value||""===e.value.trim();case"button":return""===e.textContent.trim()}return null},isPassiveEventSupported:function(){var t=!1;try{var o=Object.defineProperty({},"passive",{get:function(){t=!0}});e.addEventListener("testPassive",null,o),e.removeEventListener("testPassive",null,o)}catch(e){}return t}(),isColorAttrSupported:(n=e.document.createElement("input"),!(!n.setAttribute||(n.setAttribute("type","color"),"color"!=n.type.toLowerCase()))),dataProp:"_data_jscolor",setData:function(){var e=arguments[0];if(3===arguments.length){var t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={},o=arguments[2];return t[a=arguments[1]]=o,!0}if(2===arguments.length&&"object"==typeof arguments[1]){t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={};var n=arguments[1];for(var a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);return!0}throw new Error("Invalid arguments")},removeData:function(){var e=arguments[0];if(!e.hasOwnProperty(i.dataProp))return!0;for(var t=1;t<arguments.length;t+=1){var o=arguments[t];delete e[i.dataProp][o]}return!0},getData:function(e,t,o){if(!e.hasOwnProperty(i.dataProp)){if(void 0===o)return;e[i.dataProp]={}}var n=e[i.dataProp];return n.hasOwnProperty(t)||void 0===o||(n[t]=o),n[t]},getDataAttr:function(e,t){var o="data-"+t;return e.getAttribute(o)},setDataAttr:function(e,t,o){var n="data-"+t;e.setAttribute(n,o)},_attachedGroupEvents:{},attachGroupEvent:function(e,t,o,n){i._attachedGroupEvents.hasOwnProperty(e)||(i._attachedGroupEvents[e]=[]),i._attachedGroupEvents[e].push([t,o,n]),t.addEventListener(o,n,!1)},detachGroupEvents:function(e){if(i._attachedGroupEvents.hasOwnProperty(e)){for(var t=0;t<i._attachedGroupEvents[e].length;t+=1){var o=i._attachedGroupEvents[e][t];o[0].removeEventListener(o[1],o[2],!1)}delete i._attachedGroupEvents[e]}},preventDefault:function(e){e.preventDefault&&e.preventDefault(),e.returnValue=!1},captureTarget:function(e){e.setCapture&&(i._capturedTarget=e,i._capturedTarget.setCapture())},releaseTarget:function(){i._capturedTarget&&(i._capturedTarget.releaseCapture(),i._capturedTarget=null)},triggerEvent:function(t,o,n,a){if(t){var r=null;return"function"==typeof Event?r=new Event(o,{bubbles:n,cancelable:a}):(r=e.document.createEvent("Event")).initEvent(o,n,a),!!r&&(i.setData(r,"internal",!0),t.dispatchEvent(r),!0)}},triggerInputEvent:function(e,t,o,n){e&&i.isTextInput(e)Line truncated
|
||||
(()=>{var e={877:function(e){!function(t,o){"use strict";"object"!=typeof e.exports?o(t):e.exports=t.document?o(t):function(e){if(!e.document)throw new Error("jscolor needs a window with document");return o(e)}}("undefined"!=typeof window?window:this,(function(e){"use strict";var t,o,n,i,a=((i={initialized:!1,instances:[],readyQueue:[],register:function(){void 0!==e&&e.document&&e.document.addEventListener("DOMContentLoaded",i.pub.init,!1)},installBySelector:function(t,o){if(!(o=o?i.node(o):e.document))throw new Error("Missing root node");for(var n=o.querySelectorAll(t),a=new RegExp("(^|\\s)("+i.pub.lookupClass+")(\\s*(\\{[^}]*\\})|\\s|$)","i"),r=0;r<n.length;r+=1){var l,s;if(!(n[r].jscolor&&n[r].jscolor instanceof i.pub)&&(void 0===n[r].type||"color"!=n[r].type.toLowerCase()||!i.isColorAttrSupported)&&(null!==(l=i.getDataAttr(n[r],"jscolor"))||n[r].className&&(s=n[r].className.match(a)))){var c=n[r],d="";null!==l?d=l:s&&(console.warn('Installation using class name is DEPRECATED. Use data-jscolor="" attribute instead.'+i.docsRef),s[4]&&(d=s[4]));var p=null;if(d.trim())try{p=i.parseOptionsStr(d)}catch(e){console.warn(e+"\n"+d)}try{new i.pub(c,p)}catch(e){console.warn(e)}}}},parseOptionsStr:function(e){var t=null;try{t=JSON.parse(e)}catch(o){if(!i.pub.looseJSON)throw new Error("Could not parse jscolor options as JSON: "+o);try{t=new Function("var opts = ("+e+'); return typeof opts === "object" ? opts : {};')()}catch(e){throw new Error("Could not evaluate jscolor options: "+e)}}return t},getInstances:function(){for(var e=[],t=0;t<i.instances.length;t+=1)i.instances[t]&&i.instances[t].targetElement&&e.push(i.instances[t]);return e},createEl:function(t){var o=e.document.createElement(t);return i.setData(o,"gui",!0),o},node:function(t){if(!t)return null;if("string"==typeof t){var o=t,n=null;try{n=e.document.querySelector(o)}catch(e){return console.warn(e),null}return n||console.warn("No element matches the selector: %s",o),n}return i.isNode(t)?t:(console.warn("Invalid node of type %s: %s",typeof t,t),null)},isNode:function(e){return"object"==typeof Node?e instanceof Node:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},nodeName:function(e){return!(!e||!e.nodeName)&&e.nodeName.toLowerCase()},removeChildren:function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},isTextInput:function(e){return e&&"input"===i.nodeName(e)&&"text"===e.type.toLowerCase()},isButton:function(e){if(!e)return!1;var t=i.nodeName(e);return"button"===t||"input"===t&&["button","submit","reset"].indexOf(e.type.toLowerCase())>-1},isButtonEmpty:function(e){switch(i.nodeName(e)){case"input":return!e.value||""===e.value.trim();case"button":return""===e.textContent.trim()}return null},isPassiveEventSupported:function(){var t=!1;try{var o=Object.defineProperty({},"passive",{get:function(){t=!0}});e.addEventListener("testPassive",null,o),e.removeEventListener("testPassive",null,o)}catch(e){}return t}(),isColorAttrSupported:(n=e.document.createElement("input"),!(!n.setAttribute||(n.setAttribute("type","color"),"color"!=n.type.toLowerCase()))),dataProp:"_data_jscolor",setData:function(){var e=arguments[0];if(3===arguments.length){var t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={},o=arguments[2];return t[a=arguments[1]]=o,!0}if(2===arguments.length&&"object"==typeof arguments[1]){t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={};var n=arguments[1];for(var a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);return!0}throw new Error("Invalid arguments")},removeData:function(){var e=arguments[0];if(!e.hasOwnProperty(i.dataProp))return!0;for(var t=1;t<arguments.length;t+=1){var o=arguments[t];delete e[i.dataProp][o]}return!0},getData:function(e,t,o){if(!e.hasOwnProperty(i.dataProp)){if(void 0===o)return;e[i.dataProp]={}}var n=e[i.dataProp];return n.hasOwnProperty(t)||void 0===o||(n[t]=o),n[t]},getDataAttr:function(e,t){var o="data-"+t;return e.getAttribute(o)},setDataAttr:function(e,t,o){var n="data-"+t;e.setAttribute(n,o)},_attachedGroupEvents:{},attachGroupEvent:function(e,t,o,n){i._attachedGroupEvents.hasOwnProperty(e)||(i._attachedGroupEvents[e]=[]),i._attachedGroupEvents[e].push([t,o,n]),t.addEventListener(o,n,!1)},detachGroupEvents:function(e){if(i._attachedGroupEvents.hasOwnProperty(e)){for(var t=0;t<i._attachedGroupEvents[e].length;t+=1){var o=i._attachedGroupEvents[e][t];o[0].removeEventListener(o[1],o[2],!1)}delete i._attachedGroupEvents[e]}},preventDefault:function(e){e.preventDefault&&e.preventDefault(),e.returnValue=!1},captureTarget:function(e){e.setCapture&&(i._capturedTarget=e,i._capturedTarget.setCapture())},releaseTarget:function(){i._capturedTarget&&(i._capturedTarget.releaseCapture(),i._capturedTarget=null)},triggerEvent:function(t,o,n,a){if(t){var r=null;return"function"==typeof Event?r=new Event(o,{bubbles:n,cancelable:a}):(r=e.document.createEvent("Event")).initEvent(o,n,a),!!r&&(i.setData(r,"internal",!0),t.dispatchEvent(r),!0)}},triggerInputEvent:function(e,t,o,n){e&&i.isTextInput(e)Line truncated
|
||||
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
/*! For license information please see CookieMonster.js.LICENSE.txt */
|
||||
(()=>{var e={877:function(e){!function(t,o){"use strict";"object"!=typeof e.exports?o(t):e.exports=t.document?o(t):function(e){if(!e.document)throw new Error("jscolor needs a window with document");return o(e)}}("undefined"!=typeof window?window:this,(function(e){"use strict";var t,o,n,i,a=((i={initialized:!1,instances:[],readyQueue:[],register:function(){void 0!==e&&e.document&&e.document.addEventListener("DOMContentLoaded",i.pub.init,!1)},installBySelector:function(t,o){if(!(o=o?i.node(o):e.document))throw new Error("Missing root node");for(var n=o.querySelectorAll(t),a=new RegExp("(^|\\s)("+i.pub.lookupClass+")(\\s*(\\{[^}]*\\})|\\s|$)","i"),r=0;r<n.length;r+=1){var l,s;if(!(n[r].jscolor&&n[r].jscolor instanceof i.pub)&&(void 0===n[r].type||"color"!=n[r].type.toLowerCase()||!i.isColorAttrSupported)&&(null!==(l=i.getDataAttr(n[r],"jscolor"))||n[r].className&&(s=n[r].className.match(a)))){var c=n[r],d="";null!==l?d=l:s&&(console.warn('Installation using class name is DEPRECATED. Use data-jscolor="" attribute instead.'+i.docsRef),s[4]&&(d=s[4]));var p=null;if(d.trim())try{p=i.parseOptionsStr(d)}catch(e){console.warn(e+"\n"+d)}try{new i.pub(c,p)}catch(e){console.warn(e)}}}},parseOptionsStr:function(e){var t=null;try{t=JSON.parse(e)}catch(o){if(!i.pub.looseJSON)throw new Error("Could not parse jscolor options as JSON: "+o);try{t=new Function("var opts = ("+e+'); return typeof opts === "object" ? opts : {};')()}catch(e){throw new Error("Could not evaluate jscolor options: "+e)}}return t},getInstances:function(){for(var e=[],t=0;t<i.instances.length;t+=1)i.instances[t]&&i.instances[t].targetElement&&e.push(i.instances[t]);return e},createEl:function(t){var o=e.document.createElement(t);return i.setData(o,"gui",!0),o},node:function(t){if(!t)return null;if("string"==typeof t){var o=t,n=null;try{n=e.document.querySelector(o)}catch(e){return console.warn(e),null}return n||console.warn("No element matches the selector: %s",o),n}return i.isNode(t)?t:(console.warn("Invalid node of type %s: %s",typeof t,t),null)},isNode:function(e){return"object"==typeof Node?e instanceof Node:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},nodeName:function(e){return!(!e||!e.nodeName)&&e.nodeName.toLowerCase()},removeChildren:function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},isTextInput:function(e){return e&&"input"===i.nodeName(e)&&"text"===e.type.toLowerCase()},isButton:function(e){if(!e)return!1;var t=i.nodeName(e);return"button"===t||"input"===t&&["button","submit","reset"].indexOf(e.type.toLowerCase())>-1},isButtonEmpty:function(e){switch(i.nodeName(e)){case"input":return!e.value||""===e.value.trim();case"button":return""===e.textContent.trim()}return null},isPassiveEventSupported:function(){var t=!1;try{var o=Object.defineProperty({},"passive",{get:function(){t=!0}});e.addEventListener("testPassive",null,o),e.removeEventListener("testPassive",null,o)}catch(e){}return t}(),isColorAttrSupported:(n=e.document.createElement("input"),!(!n.setAttribute||(n.setAttribute("type","color"),"color"!=n.type.toLowerCase()))),dataProp:"_data_jscolor",setData:function(){var e=arguments[0];if(3===arguments.length){var t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={},o=arguments[2];return t[a=arguments[1]]=o,!0}if(2===arguments.length&&"object"==typeof arguments[1]){t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={};var n=arguments[1];for(var a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);return!0}throw new Error("Invalid arguments")},removeData:function(){var e=arguments[0];if(!e.hasOwnProperty(i.dataProp))return!0;for(var t=1;t<arguments.length;t+=1){var o=arguments[t];delete e[i.dataProp][o]}return!0},getData:function(e,t,o){if(!e.hasOwnProperty(i.dataProp)){if(void 0===o)return;e[i.dataProp]={}}var n=e[i.dataProp];return n.hasOwnProperty(t)||void 0===o||(n[t]=o),n[t]},getDataAttr:function(e,t){var o="data-"+t;return e.getAttribute(o)},setDataAttr:function(e,t,o){var n="data-"+t;e.setAttribute(n,o)},_attachedGroupEvents:{},attachGroupEvent:function(e,t,o,n){i._attachedGroupEvents.hasOwnProperty(e)||(i._attachedGroupEvents[e]=[]),i._attachedGroupEvents[e].push([t,o,n]),t.addEventListener(o,n,!1)},detachGroupEvents:function(e){if(i._attachedGroupEvents.hasOwnProperty(e)){for(var t=0;t<i._attachedGroupEvents[e].length;t+=1){var o=i._attachedGroupEvents[e][t];o[0].removeEventListener(o[1],o[2],!1)}delete i._attachedGroupEvents[e]}},preventDefault:function(e){e.preventDefault&&e.preventDefault(),e.returnValue=!1},captureTarget:function(e){e.setCapture&&(i._capturedTarget=e,i._capturedTarget.setCapture())},releaseTarget:function(){i._capturedTarget&&(i._capturedTarget.releaseCapture(),i._capturedTarget=null)},triggerEvent:function(t,o,n,a){if(t){var r=null;return"function"==typeof Event?r=new Event(o,{bubbles:n,cancelable:a}):(r=e.document.createEvent("Event")).initEvent(o,n,a),!!r&&(i.setData(r,"internal",!0),t.dispatchEvent(r),!0)}},triggerInputEvent:function(e,t,o,n){e&&i.isTextInput(e)Line truncated
|
||||
(()=>{var e={877:function(e){!function(t,o){"use strict";"object"!=typeof e.exports?o(t):e.exports=t.document?o(t):function(e){if(!e.document)throw new Error("jscolor needs a window with document");return o(e)}}("undefined"!=typeof window?window:this,(function(e){"use strict";var t,o,n,i,a=((i={initialized:!1,instances:[],readyQueue:[],register:function(){void 0!==e&&e.document&&e.document.addEventListener("DOMContentLoaded",i.pub.init,!1)},installBySelector:function(t,o){if(!(o=o?i.node(o):e.document))throw new Error("Missing root node");for(var n=o.querySelectorAll(t),a=new RegExp("(^|\\s)("+i.pub.lookupClass+")(\\s*(\\{[^}]*\\})|\\s|$)","i"),r=0;r<n.length;r+=1){var l,s;if(!(n[r].jscolor&&n[r].jscolor instanceof i.pub)&&(void 0===n[r].type||"color"!=n[r].type.toLowerCase()||!i.isColorAttrSupported)&&(null!==(l=i.getDataAttr(n[r],"jscolor"))||n[r].className&&(s=n[r].className.match(a)))){var c=n[r],d="";null!==l?d=l:s&&(console.warn('Installation using class name is DEPRECATED. Use data-jscolor="" attribute instead.'+i.docsRef),s[4]&&(d=s[4]));var p=null;if(d.trim())try{p=i.parseOptionsStr(d)}catch(e){console.warn(e+"\n"+d)}try{new i.pub(c,p)}catch(e){console.warn(e)}}}},parseOptionsStr:function(e){var t=null;try{t=JSON.parse(e)}catch(o){if(!i.pub.looseJSON)throw new Error("Could not parse jscolor options as JSON: "+o);try{t=new Function("var opts = ("+e+'); return typeof opts === "object" ? opts : {};')()}catch(e){throw new Error("Could not evaluate jscolor options: "+e)}}return t},getInstances:function(){for(var e=[],t=0;t<i.instances.length;t+=1)i.instances[t]&&i.instances[t].targetElement&&e.push(i.instances[t]);return e},createEl:function(t){var o=e.document.createElement(t);return i.setData(o,"gui",!0),o},node:function(t){if(!t)return null;if("string"==typeof t){var o=t,n=null;try{n=e.document.querySelector(o)}catch(e){return console.warn(e),null}return n||console.warn("No element matches the selector: %s",o),n}return i.isNode(t)?t:(console.warn("Invalid node of type %s: %s",typeof t,t),null)},isNode:function(e){return"object"==typeof Node?e instanceof Node:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},nodeName:function(e){return!(!e||!e.nodeName)&&e.nodeName.toLowerCase()},removeChildren:function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},isTextInput:function(e){return e&&"input"===i.nodeName(e)&&"text"===e.type.toLowerCase()},isButton:function(e){if(!e)return!1;var t=i.nodeName(e);return"button"===t||"input"===t&&["button","submit","reset"].indexOf(e.type.toLowerCase())>-1},isButtonEmpty:function(e){switch(i.nodeName(e)){case"input":return!e.value||""===e.value.trim();case"button":return""===e.textContent.trim()}return null},isPassiveEventSupported:function(){var t=!1;try{var o=Object.defineProperty({},"passive",{get:function(){t=!0}});e.addEventListener("testPassive",null,o),e.removeEventListener("testPassive",null,o)}catch(e){}return t}(),isColorAttrSupported:(n=e.document.createElement("input"),!(!n.setAttribute||(n.setAttribute("type","color"),"color"!=n.type.toLowerCase()))),dataProp:"_data_jscolor",setData:function(){var e=arguments[0];if(3===arguments.length){var t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={},o=arguments[2];return t[a=arguments[1]]=o,!0}if(2===arguments.length&&"object"==typeof arguments[1]){t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={};var n=arguments[1];for(var a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);return!0}throw new Error("Invalid arguments")},removeData:function(){var e=arguments[0];if(!e.hasOwnProperty(i.dataProp))return!0;for(var t=1;t<arguments.length;t+=1){var o=arguments[t];delete e[i.dataProp][o]}return!0},getData:function(e,t,o){if(!e.hasOwnProperty(i.dataProp)){if(void 0===o)return;e[i.dataProp]={}}var n=e[i.dataProp];return n.hasOwnProperty(t)||void 0===o||(n[t]=o),n[t]},getDataAttr:function(e,t){var o="data-"+t;return e.getAttribute(o)},setDataAttr:function(e,t,o){var n="data-"+t;e.setAttribute(n,o)},_attachedGroupEvents:{},attachGroupEvent:function(e,t,o,n){i._attachedGroupEvents.hasOwnProperty(e)||(i._attachedGroupEvents[e]=[]),i._attachedGroupEvents[e].push([t,o,n]),t.addEventListener(o,n,!1)},detachGroupEvents:function(e){if(i._attachedGroupEvents.hasOwnProperty(e)){for(var t=0;t<i._attachedGroupEvents[e].length;t+=1){var o=i._attachedGroupEvents[e][t];o[0].removeEventListener(o[1],o[2],!1)}delete i._attachedGroupEvents[e]}},preventDefault:function(e){e.preventDefault&&e.preventDefault(),e.returnValue=!1},captureTarget:function(e){e.setCapture&&(i._capturedTarget=e,i._capturedTarget.setCapture())},releaseTarget:function(){i._capturedTarget&&(i._capturedTarget.releaseCapture(),i._capturedTarget=null)},triggerEvent:function(t,o,n,a){if(t){var r=null;return"function"==typeof Event?r=new Event(o,{bubbles:n,cancelable:a}):(r=e.document.createEvent("Event")).initEvent(o,n,a),!!r&&(i.setData(r,"internal",!0),t.dispatchEvent(r),!0)}},triggerInputEvent:function(e,t,o,n){e&&i.isTextInput(e)Line truncated
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sources":["webpack://cookiemonster-mod/./node_modules/@eastdesire/jscolor/jscolor.js","webpack://cookiemonster-mod/webpack/bootstrap","webpack://cookiemonster-mod/webpack/runtime/compat get default export","webpack://cookiemonster-mod/webpack/runtime/define property getters","webpack://cookiemonster-mod/webpack/runtime/hasOwnProperty shorthand","webpack://cookiemonster-mod/./src/Config/VariablesAndData.js","webpack://cookiemonster-mod/./src/Config/Toggles/ToggleWrinklerButtons.js","webpack://cookiemonster-mod/./src/Data/Scales.ts","webpack://cookiemonster-mod/./src/Main/VariablesAndData.js","webpack://cookiemonster-mod/./src/Disp/BeautifyAndFormatting/Beautify.js","webpack://cookiemonster-mod/./src/Cache/VariablesAndData.js","webpack://cookiemonster-mod/./src/Sim/VariablesAndData.js","webpack://cookiemonster-mod/./src/Disp/VariablesAndData.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimAuraMult.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimGetSellMultiplier.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimEff.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimHas.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimHasGod.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimModifyBuidlingPrice.js","webpack://cookiemonster-mod/./src/Sim/SimulationEvents/SellBuilding.js","webpack://cookiemonster-mod/./src/Disp/BuildingsUpgrades/Buildings.js","webpack://cookiemonster-mod/./src/Disp/BuildingsUpgrades/Upgrades.js","webpack://cookiemonster-mod/./src/Disp/BeautifyAndFormatting/FormatTime.js","webpack://cookiemonster-mod/./src/Disp/BeautifyAndFormatting/GetTimeColour.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/GetCPS.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/GetWrinkConfigBank.js","webpack://cookiemonster-mod/./src/Disp/InfoBars/CreateDOMElements.js","webpack://cookiemonster-mod/./src/Disp/InfoBars/BottomBar.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/UpdateBackground.js","webpack://cookiemonster-mod/./src/Config/SpecificToggles.js","webpack://cookiemonster-mod/./src/Cache/Dragon/CacheDragonAuras.js","webpack://cookiemonster-mod/./src/Sim/InitializeData/InitAchievement.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimGetTieredCpsMult.js","webpack://cookiemonster-mod/./src/Sim/InitializeData/InitialBuildingData.js","webpack://cookiemonster-mod/./src/Sim/InitializeData/InitUpgrade.js","webpack://cookiemonster-mod/./src/Sim/SimulationData/CopyData.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/CreateTooltip.js","webpack://cookiemonster-mod/./src/Cache/PP/ColourOfPP.js","webpack://cookiemonster-mod/./src/Cache/CPS/GetCPSBuffMult.js","webpack://cookiemonster-mod/./src/Sim/SimulationData/SimWin.js","webpack://cookiemonster-mod/./src/Sim/Calculations/CalculateGains.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimGetHeavenlyMultiplier.js","webpack://cookiemonster-mod/./src/Data/Gamedata.ts","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimHasAchiev.js","webpack://cookiemonster-mod/./src/Sim/Calculations/CheckOtherAchiev.js","webpack://cookiemonster-mod/./src/Sim/SimulationEvents/BuyBuildingBonusIncome.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/CalculateGrimoireRefillTime.js","webpack://cookiemonster-mod/./src/Config/Toggles/ToggleToolWarnPos.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/UpdateTooltips.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/Building.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/Upgrade.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/SugarLump.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/GetLumpColour.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/Grimoire.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/GardenPlots.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/HarvestAll.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/WrinklerButton.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/PantheonGods.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/Warnings.js","webpack://cookiemonster-mod/./src/Disp/DrawHook.js","webpack://cookiemonster-mod/./src/Disp/InfoBars/TimerBar.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/WrinklerTooltips.js","webpack://cookiemonster-mod/./src/Disp/MenuSections/Refreshmenu.js","webpack://cookiemonster-mod/./src/Main/ClickHook.js","webpack://cookiemonster-mod/./src/Cache/CPS/AverageQueue.js","webpack://cookiemonster-mod/./src/Cache/CPS/CPS.js","webpack://cookiemonster-mod/./src/Cache/PP/Building.js","webpack://cookiemonster-mod/./src/Cache/PP/PP.js","webpack://cookiemonster-mod/./src/Cache/PP/Upgrade.js","webpack://cookiemonster-mod/./src/Sim/SimulationEvents/BuyBuilding.js","webpack://cookiemonster-mod/./src/Cache/PrLine truncated
|
||||
{"version":3,"sources":["webpack://cookiemonster-mod/./node_modules/@eastdesire/jscolor/jscolor.js","webpack://cookiemonster-mod/webpack/bootstrap","webpack://cookiemonster-mod/webpack/runtime/compat get default export","webpack://cookiemonster-mod/webpack/runtime/define property getters","webpack://cookiemonster-mod/webpack/runtime/hasOwnProperty shorthand","webpack://cookiemonster-mod/./src/Config/VariablesAndData.js","webpack://cookiemonster-mod/./src/Config/Toggles/ToggleWrinklerButtons.js","webpack://cookiemonster-mod/./src/Data/Scales.ts","webpack://cookiemonster-mod/./src/Main/VariablesAndData.js","webpack://cookiemonster-mod/./src/Disp/BeautifyAndFormatting/Beautify.js","webpack://cookiemonster-mod/./src/Cache/VariablesAndData.js","webpack://cookiemonster-mod/./src/Sim/VariablesAndData.js","webpack://cookiemonster-mod/./src/Disp/VariablesAndData.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimAuraMult.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimGetSellMultiplier.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimEff.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimHas.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimHasGod.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimModifyBuidlingPrice.js","webpack://cookiemonster-mod/./src/Sim/SimulationEvents/SellBuilding.js","webpack://cookiemonster-mod/./src/Disp/BuildingsUpgrades/Buildings.js","webpack://cookiemonster-mod/./src/Disp/BuildingsUpgrades/Upgrades.js","webpack://cookiemonster-mod/./src/Disp/BeautifyAndFormatting/FormatTime.js","webpack://cookiemonster-mod/./src/Disp/BeautifyAndFormatting/GetTimeColour.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/GetCPS.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/GetWrinkConfigBank.js","webpack://cookiemonster-mod/./src/Disp/InfoBars/CreateDOMElements.js","webpack://cookiemonster-mod/./src/Disp/InfoBars/BottomBar.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/UpdateBackground.js","webpack://cookiemonster-mod/./src/Config/SpecificToggles.js","webpack://cookiemonster-mod/./src/Cache/Dragon/CacheDragonAuras.js","webpack://cookiemonster-mod/./src/Sim/InitializeData/InitAchievement.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimGetTieredCpsMult.js","webpack://cookiemonster-mod/./src/Sim/InitializeData/InitialBuildingData.js","webpack://cookiemonster-mod/./src/Sim/InitializeData/InitUpgrade.js","webpack://cookiemonster-mod/./src/Sim/SimulationData/CopyData.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/CreateTooltip.js","webpack://cookiemonster-mod/./src/Cache/PP/ColourOfPP.js","webpack://cookiemonster-mod/./src/Cache/CPS/GetCPSBuffMult.js","webpack://cookiemonster-mod/./src/Sim/SimulationData/SimWin.js","webpack://cookiemonster-mod/./src/Sim/Calculations/CalculateGains.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimGetHeavenlyMultiplier.js","webpack://cookiemonster-mod/./src/Data/Gamedata.ts","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimHasAchiev.js","webpack://cookiemonster-mod/./src/Sim/Calculations/CheckOtherAchiev.js","webpack://cookiemonster-mod/./src/Sim/SimulationEvents/BuyBuildingBonusIncome.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/CalculateGrimoireRefillTime.js","webpack://cookiemonster-mod/./src/Config/Toggles/ToggleToolWarnPos.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/UpdateTooltips.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/Building.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/Upgrade.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/SugarLump.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/GetLumpColour.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/Grimoire.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/GardenPlots.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/HarvestAll.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/WrinklerButton.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/PantheonGods.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/Warnings.js","webpack://cookiemonster-mod/./src/Disp/DrawHook.js","webpack://cookiemonster-mod/./src/Disp/InfoBars/TimerBar.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/WrinklerTooltips.js","webpack://cookiemonster-mod/./src/Disp/MenuSections/Refreshmenu.js","webpack://cookiemonster-mod/./src/Main/ClickHook.js","webpack://cookiemonster-mod/./src/Cache/CPS/AverageQueue.js","webpack://cookiemonster-mod/./src/Cache/CPS/CPS.js","webpack://cookiemonster-mod/./src/Cache/PP/Building.js","webpack://cookiemonster-mod/./src/Cache/PP/PP.js","webpack://cookiemonster-mod/./src/Cache/PP/Upgrade.js","webpack://cookiemonster-mod/./src/Sim/SimulationEvents/BuyBuilding.js","webpack://cookiemonster-mod/./src/Cache/PrLine truncated
|
||||
@@ -101,7 +101,7 @@ export let TooltipWrinkler = -1; // eslint-disable-line prefer-const
|
||||
export let TooltipWrinklerBeingShown = []; // eslint-disable-line prefer-const
|
||||
|
||||
export let CMLastAscendState;
|
||||
export let CMSayTime;
|
||||
export let CMSayTime = function () {}; // eslint-disable-line prefer-const
|
||||
|
||||
/**
|
||||
* These are variables used to create various displays when the game is loaded on the "sell all" screen
|
||||
|
||||
@@ -4,7 +4,9 @@ export function l(id) {
|
||||
}
|
||||
|
||||
export const Game = {
|
||||
DrawBackground() {},
|
||||
Background: { canvas: { parentNode: {} } },
|
||||
DrawBackground() {},
|
||||
LeftBackground: { canvas: { parentNode: {} } },
|
||||
RebuildUpgrades() {},
|
||||
UpgradesInStore: {},
|
||||
};
|
||||
@@ -1,106 +0,0 @@
|
||||
import { before, describe, it } from 'mocha';
|
||||
import { assert } from 'chai';
|
||||
|
||||
import FormatTime from '../../src/Disp/BeautifyAndFormatting/FormatTime';
|
||||
import { CMOptions } from '../../src/Config/VariablesAndData';
|
||||
|
||||
describe('FormatTime', function () {
|
||||
it('Format when time is Infinity', function () {
|
||||
assert.equal(FormatTime(Infinity, 0), Infinity);
|
||||
});
|
||||
it('Format when time is negative', function () {
|
||||
assert.equal(FormatTime(-1, 0), 'Negative time period');
|
||||
});
|
||||
describe('TimeFormat = 0', function () {
|
||||
before(function () {
|
||||
CMOptions.TimeFormat = 0;
|
||||
});
|
||||
describe('Longformat = 0', function () {
|
||||
it('Format when time is 0', function () {
|
||||
assert.equal(FormatTime(0, 0), '0s');
|
||||
});
|
||||
it('Format when time is 1 second', function () {
|
||||
assert.equal(FormatTime(1, 0), '1s');
|
||||
});
|
||||
it('Format when time is over 1 minute', function () {
|
||||
assert.equal(FormatTime(61, 0), '1m, 1s');
|
||||
});
|
||||
it('Format when time is over 1 hour', function () {
|
||||
assert.equal(FormatTime(3601, 0), '1h, 0m, 1s');
|
||||
});
|
||||
it('Format when time is over 1 day', function () {
|
||||
assert.equal(FormatTime(86401, 0), '1d, 0h, 0m, 1s');
|
||||
});
|
||||
it('Format when time is over 1 year', function () {
|
||||
assert.equal(FormatTime(31536001, 0), '1y, 0d, 0h, 0m, 1s');
|
||||
});
|
||||
it('Format when time is over >9000 days', function () {
|
||||
assert.equal(FormatTime(777600001, 0), '>9000d');
|
||||
});
|
||||
it('Format when time is over >99.9 years', function () {
|
||||
assert.equal(FormatTime(3155760001, 0), '>9000d');
|
||||
});
|
||||
});
|
||||
describe('Longformat = 1', function () {
|
||||
it('Format when time is 0', function () {
|
||||
assert.equal(FormatTime(0, 1), '0 seconds');
|
||||
});
|
||||
it('Format when time is 1 second', function () {
|
||||
assert.equal(FormatTime(1, 1), '1 second');
|
||||
});
|
||||
it('Format when time is over 1 minute', function () {
|
||||
assert.equal(FormatTime(61, 1), '1 minute, 1 second');
|
||||
});
|
||||
it('Format when time is over 1 hour', function () {
|
||||
assert.equal(FormatTime(3601, 1), '1 hour, 0 minutes, 1 second');
|
||||
});
|
||||
it('Format when time is over 1 day', function () {
|
||||
assert.equal(
|
||||
FormatTime(86401, 1),
|
||||
'1 day, 0 hours, 0 minutes, 1 second',
|
||||
);
|
||||
});
|
||||
it('Format when time is over 1 year', function () {
|
||||
assert.equal(
|
||||
FormatTime(31536001, 1),
|
||||
'1 year, 0 days, 0 hours, 0 minutes, 1 second',
|
||||
);
|
||||
});
|
||||
it('Format when time is over >9000 days', function () {
|
||||
assert.equal(FormatTime(777600001, 1), 'Over 9000 days!');
|
||||
});
|
||||
it('Format when time is over >99.9 years', function () {
|
||||
assert.equal(FormatTime(3155760001, 1), 'Over 9000 days!');
|
||||
});
|
||||
});
|
||||
});
|
||||
describe('TimeFormat = 1', function () {
|
||||
before(function () {
|
||||
CMOptions.TimeFormat = 1;
|
||||
});
|
||||
it('Format when time is 0', function () {
|
||||
assert.equal(FormatTime(0, 0), '00:00:00:00:00');
|
||||
});
|
||||
it('Format when time is 1 second', function () {
|
||||
assert.equal(FormatTime(1, 0), '00:00:00:00:01');
|
||||
});
|
||||
it('Format when time is over 1 minute', function () {
|
||||
assert.equal(FormatTime(61, 0), '00:00:00:01:01');
|
||||
});
|
||||
it('Format when time is over 1 hour', function () {
|
||||
assert.equal(FormatTime(3601, 0), '00:00:01:00:01');
|
||||
});
|
||||
it('Format when time is over 1 day', function () {
|
||||
assert.equal(FormatTime(86401, 0), '00:01:00:00:01');
|
||||
});
|
||||
it('Format when time is over 1 year', function () {
|
||||
assert.equal(FormatTime(31536001, 0), '01:00:00:00:01');
|
||||
});
|
||||
it('Format when time is over >9000 days', function () {
|
||||
assert.equal(FormatTime(777600001, 0), '24:240:00:00:01');
|
||||
});
|
||||
it('Format when time is over >99.9 years', function () {
|
||||
assert.equal(FormatTime(3155760001, 0), 'XX:XX:XX:XX:XX');
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,48 +0,0 @@
|
||||
import { before, describe, it } from 'mocha';
|
||||
import { expect } from 'chai';
|
||||
|
||||
import GetTimeColour from '../../src/Disp/BeautifyAndFormatting/GetTimeColour';
|
||||
import { CMOptions } from '../../src/Config/VariablesAndData';
|
||||
|
||||
describe('GetTimeColour', function () {
|
||||
it('Format when time is less than 60', function () {
|
||||
expect(GetTimeColour(59).color).to.deep.equal('Yellow');
|
||||
});
|
||||
it('Format when time is more than 60', function () {
|
||||
expect(GetTimeColour(61).color).to.deep.equal('Orange');
|
||||
});
|
||||
it('Format when time is more than 300', function () {
|
||||
expect(GetTimeColour(301).color).to.deep.equal('Red');
|
||||
});
|
||||
describe('TimeFormat = 0', function () {
|
||||
before(function () {
|
||||
CMOptions.TimeFormat = 0;
|
||||
});
|
||||
it('Format when time is 0', function () {
|
||||
expect(GetTimeColour(0)).to.deep.equal({ text: 'Done!', color: 'Green' });
|
||||
});
|
||||
it('Format when time is negative', function () {
|
||||
expect(GetTimeColour(-1)).to.deep.equal({
|
||||
text: 'Done!',
|
||||
color: 'Green',
|
||||
});
|
||||
});
|
||||
});
|
||||
describe('TimeFormat = 1', function () {
|
||||
before(function () {
|
||||
CMOptions.TimeFormat = 1;
|
||||
});
|
||||
it('Format when time is 0', function () {
|
||||
expect(GetTimeColour(0)).to.deep.equal({
|
||||
text: '00:00:00:00:00',
|
||||
color: 'Green',
|
||||
});
|
||||
});
|
||||
it('Format when time is negative', function () {
|
||||
expect(GetTimeColour(-1)).to.deep.equal({
|
||||
text: '00:00:00:00:00',
|
||||
color: 'Green',
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,6 +1,6 @@
|
||||
import { before, beforeEach, describe, it } from 'mocha';
|
||||
import { assert } from 'chai';
|
||||
import { l, Game } from '../../GlobalsForTesting'; // eslint-disable-line no-unused-vars
|
||||
import { l, Game } from '../../GlobalsForTesting';
|
||||
|
||||
import ToggleBotBar from '../../../src/Config/Toggles/ToggleBotBar';
|
||||
import { CMOptions } from '../../../src/Config/VariablesAndData';
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
import { before, beforeEach, describe, it } from 'mocha';
|
||||
import { assert } from 'chai';
|
||||
import { Game } from '../../GlobalsForTesting';
|
||||
|
||||
import { CMOptions } from '../../../src/Config/VariablesAndData';
|
||||
import ToggleDetailedTime from '../../../src/Config/Toggles/ToggleDetailedTime';
|
||||
import { BackupFunctions } from '../../../src/Main/VariablesAndData';
|
||||
|
||||
describe('ToggleDetailedTime', function () {
|
||||
global.Game = Game;
|
||||
|
||||
beforeEach(function () {
|
||||
ToggleDetailedTime();
|
||||
});
|
||||
|
||||
describe('DetailedTime = 0', function () {
|
||||
before(function () {
|
||||
CMOptions.DetailedTime = 0;
|
||||
BackupFunctions.sayTime = 'BackupFunctions.sayTime';
|
||||
});
|
||||
it('Set correct time function', function () {
|
||||
assert.equal(Game.sayTime, 'BackupFunctions.sayTime');
|
||||
});
|
||||
});
|
||||
describe('DetailedTime = 1', function () {
|
||||
before(function () {
|
||||
CMOptions.DetailedTime = 1;
|
||||
});
|
||||
it('Set correct time function', function () {
|
||||
assert.equal(Game.sayTime.name, 'CMSayTime');
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,17 @@
|
||||
import { beforeEach, describe, it } from 'mocha';
|
||||
import { assert } from 'chai';
|
||||
|
||||
import ToggleFavouriteSetting from '../../../src/Config/Toggles/ToggleFavourites';
|
||||
import { FavouriteSettings } from '../../../src/Disp/VariablesAndData';
|
||||
|
||||
describe('ToggleFavouriteSetting', function () {
|
||||
beforeEach(function () {
|
||||
global.domids = {};
|
||||
});
|
||||
// TODO: Can't write test for checking existing config due to Babel/Typescript problem
|
||||
it('New config', function () {
|
||||
FavouriteSettings.push('TestConfig');
|
||||
ToggleFavouriteSetting('TestConfig2');
|
||||
assert.deepEqual(FavouriteSettings, ['TestConfig', 'TestConfig2']);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,46 @@
|
||||
import { before, beforeEach, describe, it } from 'mocha';
|
||||
import { assert } from 'chai';
|
||||
import { l } from '../../GlobalsForTesting';
|
||||
|
||||
import { CMOptions } from '../../../src/Config/VariablesAndData';
|
||||
import ToggleGCTimer from '../../../src/Config/Toggles/ToggleGCTimer';
|
||||
import { GCTimers } from '../../../src/Disp/VariablesAndData';
|
||||
import { CacheGoldenShimmersByID } from '../../../src/Cache/VariablesAndData';
|
||||
|
||||
describe('ToggleGCTimer', function () {
|
||||
global.l = l;
|
||||
|
||||
beforeEach(function () {
|
||||
global.domids = {};
|
||||
GCTimers[0] = { style: {} };
|
||||
GCTimers[1] = { style: {} };
|
||||
CacheGoldenShimmersByID[0] = {
|
||||
l: { style: { left: 'Test00', top: 'Test01' } },
|
||||
};
|
||||
CacheGoldenShimmersByID[1] = {
|
||||
l: { style: { left: 'Test10', top: 'Test11' } },
|
||||
};
|
||||
ToggleGCTimer();
|
||||
});
|
||||
|
||||
describe('GCTimer = 0', function () {
|
||||
before(function () {
|
||||
CMOptions.GCTimer = 0;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
assert.equal(GCTimers[0].style.display, 'none');
|
||||
assert.equal(GCTimers[1].style.display, 'none');
|
||||
});
|
||||
});
|
||||
describe('GCTimer = 1', function () {
|
||||
before(function () {
|
||||
CMOptions.GCTimer = 1;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
assert.equal(GCTimers[0].style.display, 'block');
|
||||
assert.equal(GCTimers[0].style.left, 'Test00');
|
||||
assert.equal(GCTimers[0].style.top, 'Test01');
|
||||
assert.equal(GCTimers[1].style.display, 'block');
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,32 @@
|
||||
import { before, beforeEach, describe, it } from 'mocha';
|
||||
import { assert } from 'chai';
|
||||
import { l } from '../../GlobalsForTesting';
|
||||
|
||||
import { CMOptions } from '../../../src/Config/VariablesAndData';
|
||||
import ToggleSectionHideButtons from '../../../src/Config/Toggles/ToggleSectionHideButtons';
|
||||
|
||||
describe('ToggleSectionHideButtons', function () {
|
||||
global.l = l;
|
||||
|
||||
beforeEach(function () {
|
||||
global.domids = {};
|
||||
ToggleSectionHideButtons();
|
||||
});
|
||||
|
||||
describe('HideSectionsButtons = 0', function () {
|
||||
before(function () {
|
||||
CMOptions.HideSectionsButtons = 0;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
assert.equal(domids.CMSectionHidButtons.style.display, 'none'); // eslint-disable-line no-undef
|
||||
});
|
||||
});
|
||||
describe('HideSectionsButtons = 1', function () {
|
||||
before(function () {
|
||||
CMOptions.HideSectionsButtons = 1;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
assert.equal(domids.CMSectionHidButtons.style.display, ''); // eslint-disable-line no-undef
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,36 @@
|
||||
import { before, beforeEach, describe, it } from 'mocha';
|
||||
import { assert } from 'chai';
|
||||
import { l } from '../../GlobalsForTesting';
|
||||
|
||||
import { CMOptions } from '../../../src/Config/VariablesAndData';
|
||||
import ToggleToolWarnPos from '../../../src/Config/Toggles/ToggleToolWarnPos';
|
||||
|
||||
describe('ToggleToolWarnPos', function () {
|
||||
global.l = l;
|
||||
|
||||
beforeEach(function () {
|
||||
global.domids = {};
|
||||
ToggleToolWarnPos();
|
||||
});
|
||||
|
||||
describe('ToolWarnPos = 0', function () {
|
||||
before(function () {
|
||||
CMOptions.ToolWarnPos = 0;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
assert.equal(domids.CMDispTooltipWarningParent.style.top, 'auto'); // eslint-disable-line no-undef
|
||||
assert.equal(domids.CMDispTooltipWarningParent.style.margin, '4px -4px'); // eslint-disable-line no-undef
|
||||
assert.equal(domids.CMDispTooltipWarningParent.style.padding, '3px 4px'); // eslint-disable-line no-undef
|
||||
});
|
||||
});
|
||||
describe('ToolWarnPos = 1', function () {
|
||||
before(function () {
|
||||
CMOptions.ToolWarnPos = 1;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
assert.equal(domids.CMDispTooltipWarningParent.style.right, 'auto'); // eslint-disable-line no-undef
|
||||
assert.equal(domids.CMDispTooltipWarningParent.style.margin, '4px'); // eslint-disable-line no-undef
|
||||
assert.equal(domids.CMDispTooltipWarningParent.style.padding, '4px 3px'); // eslint-disable-line no-undef
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,41 @@
|
||||
import { before, beforeEach, describe, it } from 'mocha';
|
||||
import { assert } from 'chai';
|
||||
import { l, Game } from '../../GlobalsForTesting';
|
||||
|
||||
import { CMOptions } from '../../../src/Config/VariablesAndData';
|
||||
import ToggleUpgradeBarAndColor from '../../../src/Config/Toggles/ToggleUpgradeBarAndColour';
|
||||
|
||||
describe('ToggleUpgradeBarAndColor', function () {
|
||||
global.l = l;
|
||||
global.Game = Game;
|
||||
|
||||
beforeEach(function () {
|
||||
global.domids = {};
|
||||
ToggleUpgradeBarAndColor();
|
||||
});
|
||||
|
||||
describe('UpBarColor = 0', function () {
|
||||
before(function () {
|
||||
CMOptions.UpBarColor = 0;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
assert.equal(domids.CMUpgradeBar.style.display, 'none'); // eslint-disable-line no-undef
|
||||
});
|
||||
});
|
||||
describe('UpBarColor = 1', function () {
|
||||
before(function () {
|
||||
CMOptions.UpBarColor = 1;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
assert.equal(domids.CMUpgradeBar.style.display, ''); // eslint-disable-line no-undef
|
||||
});
|
||||
});
|
||||
describe('UpBarColor = 2', function () {
|
||||
before(function () {
|
||||
CMOptions.UpBarColor = 2;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
assert.equal(domids.CMUpgradeBar.style.display, 'none'); // eslint-disable-line no-undef
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
import { before, beforeEach, describe, it } from 'mocha';
|
||||
import { assert } from 'chai';
|
||||
import { l } from '../../GlobalsForTesting';
|
||||
|
||||
import { CMOptions } from '../../../src/Config/VariablesAndData';
|
||||
import ToggleUpgradeBarFixedPos from '../../../src/Config/Toggles/ToggleUpgradeBarFixedPos';
|
||||
|
||||
describe('ToggleUpgradeBarFixedPos', function () {
|
||||
global.l = l;
|
||||
|
||||
beforeEach(function () {
|
||||
global.domids = {};
|
||||
ToggleUpgradeBarFixedPos();
|
||||
});
|
||||
|
||||
describe('UpgradeBarFixedPos = 0', function () {
|
||||
before(function () {
|
||||
CMOptions.UpgradeBarFixedPos = 0;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
assert.equal(domids.CMUpgradeBar.style.position, ''); // eslint-disable-line no-undef
|
||||
});
|
||||
});
|
||||
describe('UpgradeBarFixedPos = 1', function () {
|
||||
before(function () {
|
||||
CMOptions.UpgradeBarFixedPos = 1;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
assert.equal(domids.CMUpgradeBar.style.position, 'sticky'); // eslint-disable-line no-undef
|
||||
assert.equal(domids.CMUpgradeBar.style.top, '0px'); // eslint-disable-line no-undef
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,63 @@
|
||||
import { before, beforeEach, describe, it } from 'mocha';
|
||||
import { assert } from 'chai';
|
||||
import { l, Game } from '../../GlobalsForTesting';
|
||||
|
||||
import { CMOptions } from '../../../src/Config/VariablesAndData';
|
||||
import ToggleWrinklerButtons from '../../../src/Config/Toggles/ToggleWrinklerButtons';
|
||||
|
||||
describe('ToggleWrinklerButtons', function () {
|
||||
global.l = l;
|
||||
global.Game = Game;
|
||||
|
||||
beforeEach(function () {
|
||||
global.domids = {};
|
||||
ToggleWrinklerButtons();
|
||||
});
|
||||
|
||||
describe('WrinklerButtons = 0', function () {
|
||||
before(function () {
|
||||
CMOptions.WrinklerButtons = 0;
|
||||
});
|
||||
describe('Game.elderWrath = 0', function () {
|
||||
before(function () {
|
||||
Game.elderWrath = 0;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
assert.equal(domids.PopAllNormalWrinklerButton.style.display, 'none'); // eslint-disable-line no-undef
|
||||
assert.equal(domids.PopFattestWrinklerButton.style.display, 'none'); // eslint-disable-line no-undef
|
||||
});
|
||||
});
|
||||
describe('Game.elderWrath = 1', function () {
|
||||
before(function () {
|
||||
Game.elderWrath = 1;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
assert.equal(domids.PopAllNormalWrinklerButton.style.display, 'none'); // eslint-disable-line no-undef
|
||||
assert.equal(domids.PopFattestWrinklerButton.style.display, 'none'); // eslint-disable-line no-undef
|
||||
});
|
||||
});
|
||||
});
|
||||
describe('WrinklerButtons = 1', function () {
|
||||
before(function () {
|
||||
CMOptions.WrinklerButtons = 1;
|
||||
});
|
||||
describe('Game.elderWrath = 0', function () {
|
||||
before(function () {
|
||||
Game.elderWrath = 0;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
assert.equal(domids.PopAllNormalWrinklerButton.style.display, 'none'); // eslint-disable-line no-undef
|
||||
assert.equal(domids.PopFattestWrinklerButton.style.display, 'none'); // eslint-disable-line no-undef
|
||||
});
|
||||
});
|
||||
describe('Game.elderWrath = 1', function () {
|
||||
before(function () {
|
||||
Game.elderWrath = 1;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
assert.equal(domids.PopAllNormalWrinklerButton.style.display, ''); // eslint-disable-line no-undef
|
||||
assert.equal(domids.PopFattestWrinklerButton.style.display, ''); // eslint-disable-line no-undef
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user