Use CookieMonsterFramework for save/load, infoMenu
This commit is contained in:
@@ -9,4 +9,5 @@ export const Game = {
|
||||
LeftBackground: { canvas: { parentNode: {} } },
|
||||
RebuildUpgrades() {},
|
||||
UpgradesInStore: {},
|
||||
mods: { cookieMonsterFramework: { saveData: { cookieMonsterMod: { settings: {} } } } },
|
||||
};
|
||||
|
||||
@@ -3,7 +3,6 @@ import { assert } from 'chai';
|
||||
import { l, Game } from '../../GlobalsForTesting';
|
||||
|
||||
import ToggleBotBar from '../../../src/Config/Toggles/ToggleBotBar';
|
||||
import { CMOptions } from '../../../src/Config/VariablesAndData';
|
||||
|
||||
describe('ToggleBotBar', () => {
|
||||
global.l = l;
|
||||
@@ -16,7 +15,7 @@ describe('ToggleBotBar', () => {
|
||||
|
||||
describe('BotBar = 0', () => {
|
||||
before(() => {
|
||||
CMOptions.BotBar = 0;
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.BotBar = 0;
|
||||
});
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(domids.CMBotBar.style.display, 'none'); // eslint-disable-line no-undef
|
||||
@@ -24,7 +23,7 @@ describe('ToggleBotBar', () => {
|
||||
});
|
||||
describe('BotBar = 1', () => {
|
||||
before(() => {
|
||||
CMOptions.BotBar = 1;
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.BotBar = 1;
|
||||
});
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(domids.CMBotBar.style.display, ''); // eslint-disable-line no-undef
|
||||
|
||||
@@ -2,7 +2,6 @@ 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';
|
||||
|
||||
@@ -15,7 +14,7 @@ describe('ToggleDetailedTime', () => {
|
||||
|
||||
describe('DetailedTime = 0', () => {
|
||||
before(() => {
|
||||
CMOptions.DetailedTime = 0;
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.DetailedTime = 0;
|
||||
BackupFunctions.sayTime = 'BackupFunctions.sayTime';
|
||||
});
|
||||
it('Set correct time function', () => {
|
||||
@@ -24,7 +23,7 @@ describe('ToggleDetailedTime', () => {
|
||||
});
|
||||
describe('DetailedTime = 1', () => {
|
||||
before(() => {
|
||||
CMOptions.DetailedTime = 1;
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.DetailedTime = 1;
|
||||
});
|
||||
it('Set correct time function', () => {
|
||||
assert.equal(Game.sayTime.name, 'CMSayTime');
|
||||
|
||||
@@ -2,7 +2,6 @@ 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';
|
||||
@@ -25,7 +24,7 @@ describe('ToggleGCTimer', () => {
|
||||
|
||||
describe('GCTimer = 0', () => {
|
||||
before(() => {
|
||||
CMOptions.GCTimer = 0;
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.GCTimer = 0;
|
||||
});
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(GCTimers[0].style.display, 'none');
|
||||
@@ -34,7 +33,7 @@ describe('ToggleGCTimer', () => {
|
||||
});
|
||||
describe('GCTimer = 1', () => {
|
||||
before(() => {
|
||||
CMOptions.GCTimer = 1;
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.GCTimer = 1;
|
||||
});
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(GCTimers[0].style.display, 'block');
|
||||
|
||||
@@ -2,7 +2,6 @@ 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', () => {
|
||||
@@ -15,7 +14,7 @@ describe('ToggleSectionHideButtons', () => {
|
||||
|
||||
describe('HideSectionsButtons = 0', () => {
|
||||
before(() => {
|
||||
CMOptions.HideSectionsButtons = 0;
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.HideSectionsButtons = 0;
|
||||
});
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(domids.CMSectionHidButtons.style.display, 'none'); // eslint-disable-line no-undef
|
||||
@@ -23,7 +22,7 @@ describe('ToggleSectionHideButtons', () => {
|
||||
});
|
||||
describe('HideSectionsButtons = 1', () => {
|
||||
before(() => {
|
||||
CMOptions.HideSectionsButtons = 1;
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.HideSectionsButtons = 1;
|
||||
});
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(domids.CMSectionHidButtons.style.display, ''); // eslint-disable-line no-undef
|
||||
|
||||
@@ -2,7 +2,6 @@ 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', () => {
|
||||
@@ -15,7 +14,7 @@ describe('ToggleToolWarnPos', () => {
|
||||
|
||||
describe('ToolWarnPos = 0', () => {
|
||||
before(() => {
|
||||
CMOptions.ToolWarnPos = 0;
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.ToolWarnPos = 0;
|
||||
});
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(domids.CMDispTooltipWarningParent.style.top, 'auto'); // eslint-disable-line no-undef
|
||||
@@ -25,7 +24,7 @@ describe('ToggleToolWarnPos', () => {
|
||||
});
|
||||
describe('ToolWarnPos = 1', () => {
|
||||
before(() => {
|
||||
CMOptions.ToolWarnPos = 1;
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.ToolWarnPos = 1;
|
||||
});
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(domids.CMDispTooltipWarningParent.style.right, 'auto'); // eslint-disable-line no-undef
|
||||
|
||||
@@ -2,7 +2,6 @@ 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', () => {
|
||||
@@ -16,7 +15,7 @@ describe('ToggleUpgradeBarAndColor', () => {
|
||||
|
||||
describe('UpBarColor = 0', () => {
|
||||
before(() => {
|
||||
CMOptions.UpBarColor = 0;
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.UpBarColor = 0;
|
||||
});
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(domids.CMUpgradeBar.style.display, 'none'); // eslint-disable-line no-undef
|
||||
@@ -24,7 +23,7 @@ describe('ToggleUpgradeBarAndColor', () => {
|
||||
});
|
||||
describe('UpBarColor = 1', () => {
|
||||
before(() => {
|
||||
CMOptions.UpBarColor = 1;
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.UpBarColor = 1;
|
||||
});
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(domids.CMUpgradeBar.style.display, ''); // eslint-disable-line no-undef
|
||||
@@ -32,7 +31,7 @@ describe('ToggleUpgradeBarAndColor', () => {
|
||||
});
|
||||
describe('UpBarColor = 2', () => {
|
||||
before(() => {
|
||||
CMOptions.UpBarColor = 2;
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.UpBarColor = 2;
|
||||
});
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(domids.CMUpgradeBar.style.display, 'none'); // eslint-disable-line no-undef
|
||||
|
||||
@@ -2,7 +2,6 @@ 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', () => {
|
||||
@@ -15,7 +14,7 @@ describe('ToggleUpgradeBarFixedPos', () => {
|
||||
|
||||
describe('UpgradeBarFixedPos = 0', () => {
|
||||
before(() => {
|
||||
CMOptions.UpgradeBarFixedPos = 0;
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.UpgradeBarFixedPos = 0;
|
||||
});
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(domids.CMUpgradeBar.style.position, ''); // eslint-disable-line no-undef
|
||||
@@ -23,7 +22,7 @@ describe('ToggleUpgradeBarFixedPos', () => {
|
||||
});
|
||||
describe('UpgradeBarFixedPos = 1', () => {
|
||||
before(() => {
|
||||
CMOptions.UpgradeBarFixedPos = 1;
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.UpgradeBarFixedPos = 1;
|
||||
});
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(domids.CMUpgradeBar.style.position, 'sticky'); // eslint-disable-line no-undef
|
||||
|
||||
@@ -2,7 +2,6 @@ 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', () => {
|
||||
@@ -16,7 +15,7 @@ describe('ToggleWrinklerButtons', () => {
|
||||
|
||||
describe('WrinklerButtons = 0', () => {
|
||||
before(() => {
|
||||
CMOptions.WrinklerButtons = 0;
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.WrinklerButtons = 0;
|
||||
});
|
||||
describe('Game.elderWrath = 0', () => {
|
||||
before(() => {
|
||||
@@ -39,7 +38,7 @@ describe('ToggleWrinklerButtons', () => {
|
||||
});
|
||||
describe('WrinklerButtons = 1', () => {
|
||||
before(() => {
|
||||
CMOptions.WrinklerButtons = 1;
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.WrinklerButtons = 1;
|
||||
});
|
||||
describe('Game.elderWrath = 0', () => {
|
||||
before(() => {
|
||||
|
||||
@@ -2,7 +2,6 @@ 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', () => {
|
||||
it('Format when time is Infinity', () => {
|
||||
@@ -13,7 +12,7 @@ describe('FormatTime', () => {
|
||||
});
|
||||
describe('TimeFormat = 0', () => {
|
||||
before(() => {
|
||||
CMOptions.TimeFormat = 0;
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimeFormat = 0;
|
||||
});
|
||||
describe('Longformat = 0', () => {
|
||||
it('Format when time is 0', () => {
|
||||
@@ -70,7 +69,7 @@ describe('FormatTime', () => {
|
||||
});
|
||||
describe('TimeFormat = 1', () => {
|
||||
before(() => {
|
||||
CMOptions.TimeFormat = 1;
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimeFormat = 1;
|
||||
});
|
||||
it('Format when time is 0', () => {
|
||||
assert.equal(FormatTime(0, 0), '00:00:00:00:00');
|
||||
|
||||
@@ -2,7 +2,6 @@ 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', () => {
|
||||
it('Format when time is less than 60', () => {
|
||||
@@ -16,7 +15,7 @@ describe('GetTimeColour', () => {
|
||||
});
|
||||
describe('TimeFormat = 0', () => {
|
||||
before(() => {
|
||||
CMOptions.TimeFormat = 0;
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimeFormat = 0;
|
||||
});
|
||||
it('Format when time is 0', () => {
|
||||
expect(GetTimeColour(0)).to.deep.equal({ text: 'Done!', color: 'Green' });
|
||||
@@ -30,7 +29,7 @@ describe('GetTimeColour', () => {
|
||||
});
|
||||
describe('TimeFormat = 1', () => {
|
||||
before(() => {
|
||||
CMOptions.TimeFormat = 1;
|
||||
Game.mods.cookieMonsterFramework.saveData.cookieMonsterMod.settings.TimeFormat = 1;
|
||||
});
|
||||
it('Format when time is 0', () => {
|
||||
expect(GetTimeColour(0)).to.deep.equal({
|
||||
|
||||
Reference in New Issue
Block a user