Linting in tests
This commit is contained in:
@@ -5,28 +5,28 @@ import { l, Game } from '../../GlobalsForTesting';
|
||||
import ToggleBotBar from '../../../src/Config/Toggles/ToggleBotBar';
|
||||
import { CMOptions } from '../../../src/Config/VariablesAndData';
|
||||
|
||||
describe('ToggleBotBar', function () {
|
||||
describe('ToggleBotBar', () => {
|
||||
global.l = l;
|
||||
global.Game = Game;
|
||||
|
||||
beforeEach(function () {
|
||||
beforeEach(() => {
|
||||
global.domids = {};
|
||||
ToggleBotBar();
|
||||
});
|
||||
|
||||
describe('BotBar = 0', function () {
|
||||
before(function () {
|
||||
describe('BotBar = 0', () => {
|
||||
before(() => {
|
||||
CMOptions.BotBar = 0;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(domids.CMBotBar.style.display, 'none'); // eslint-disable-line no-undef
|
||||
});
|
||||
});
|
||||
describe('BotBar = 1', function () {
|
||||
before(function () {
|
||||
describe('BotBar = 1', () => {
|
||||
before(() => {
|
||||
CMOptions.BotBar = 1;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(domids.CMBotBar.style.display, ''); // eslint-disable-line no-undef
|
||||
});
|
||||
});
|
||||
|
||||
@@ -6,27 +6,27 @@ import { CMOptions } from '../../../src/Config/VariablesAndData';
|
||||
import ToggleDetailedTime from '../../../src/Config/Toggles/ToggleDetailedTime';
|
||||
import { BackupFunctions } from '../../../src/Main/VariablesAndData';
|
||||
|
||||
describe('ToggleDetailedTime', function () {
|
||||
describe('ToggleDetailedTime', () => {
|
||||
global.Game = Game;
|
||||
|
||||
beforeEach(function () {
|
||||
beforeEach(() => {
|
||||
ToggleDetailedTime();
|
||||
});
|
||||
|
||||
describe('DetailedTime = 0', function () {
|
||||
before(function () {
|
||||
describe('DetailedTime = 0', () => {
|
||||
before(() => {
|
||||
CMOptions.DetailedTime = 0;
|
||||
BackupFunctions.sayTime = 'BackupFunctions.sayTime';
|
||||
});
|
||||
it('Set correct time function', function () {
|
||||
it('Set correct time function', () => {
|
||||
assert.equal(Game.sayTime, 'BackupFunctions.sayTime');
|
||||
});
|
||||
});
|
||||
describe('DetailedTime = 1', function () {
|
||||
before(function () {
|
||||
describe('DetailedTime = 1', () => {
|
||||
before(() => {
|
||||
CMOptions.DetailedTime = 1;
|
||||
});
|
||||
it('Set correct time function', function () {
|
||||
it('Set correct time function', () => {
|
||||
assert.equal(Game.sayTime.name, 'CMSayTime');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -4,12 +4,12 @@ import { assert } from 'chai';
|
||||
import ToggleFavouriteSetting from '../../../src/Config/Toggles/ToggleFavourites';
|
||||
import { FavouriteSettings } from '../../../src/Disp/VariablesAndData';
|
||||
|
||||
describe('ToggleFavouriteSetting', function () {
|
||||
beforeEach(function () {
|
||||
describe('ToggleFavouriteSetting', () => {
|
||||
beforeEach(() => {
|
||||
global.domids = {};
|
||||
});
|
||||
// TODO: Can't write test for checking existing config due to Babel/Typescript problem
|
||||
it('New config', function () {
|
||||
it('New config', () => {
|
||||
FavouriteSettings.push('TestConfig');
|
||||
ToggleFavouriteSetting('TestConfig2');
|
||||
assert.deepEqual(FavouriteSettings, ['TestConfig', 'TestConfig2']);
|
||||
|
||||
@@ -7,10 +7,10 @@ import ToggleGCTimer from '../../../src/Config/Toggles/ToggleGCTimer';
|
||||
import { GCTimers } from '../../../src/Disp/VariablesAndData';
|
||||
import { CacheGoldenShimmersByID } from '../../../src/Cache/VariablesAndData';
|
||||
|
||||
describe('ToggleGCTimer', function () {
|
||||
describe('ToggleGCTimer', () => {
|
||||
global.l = l;
|
||||
|
||||
beforeEach(function () {
|
||||
beforeEach(() => {
|
||||
global.domids = {};
|
||||
GCTimers[0] = { style: {} };
|
||||
GCTimers[1] = { style: {} };
|
||||
@@ -23,20 +23,20 @@ describe('ToggleGCTimer', function () {
|
||||
ToggleGCTimer();
|
||||
});
|
||||
|
||||
describe('GCTimer = 0', function () {
|
||||
before(function () {
|
||||
describe('GCTimer = 0', () => {
|
||||
before(() => {
|
||||
CMOptions.GCTimer = 0;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(GCTimers[0].style.display, 'none');
|
||||
assert.equal(GCTimers[1].style.display, 'none');
|
||||
});
|
||||
});
|
||||
describe('GCTimer = 1', function () {
|
||||
before(function () {
|
||||
describe('GCTimer = 1', () => {
|
||||
before(() => {
|
||||
CMOptions.GCTimer = 1;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(GCTimers[0].style.display, 'block');
|
||||
assert.equal(GCTimers[0].style.left, 'Test00');
|
||||
assert.equal(GCTimers[0].style.top, 'Test01');
|
||||
|
||||
@@ -5,27 +5,27 @@ import { l } from '../../GlobalsForTesting';
|
||||
import { CMOptions } from '../../../src/Config/VariablesAndData';
|
||||
import ToggleSectionHideButtons from '../../../src/Config/Toggles/ToggleSectionHideButtons';
|
||||
|
||||
describe('ToggleSectionHideButtons', function () {
|
||||
describe('ToggleSectionHideButtons', () => {
|
||||
global.l = l;
|
||||
|
||||
beforeEach(function () {
|
||||
beforeEach(() => {
|
||||
global.domids = {};
|
||||
ToggleSectionHideButtons();
|
||||
});
|
||||
|
||||
describe('HideSectionsButtons = 0', function () {
|
||||
before(function () {
|
||||
describe('HideSectionsButtons = 0', () => {
|
||||
before(() => {
|
||||
CMOptions.HideSectionsButtons = 0;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(domids.CMSectionHidButtons.style.display, 'none'); // eslint-disable-line no-undef
|
||||
});
|
||||
});
|
||||
describe('HideSectionsButtons = 1', function () {
|
||||
before(function () {
|
||||
describe('HideSectionsButtons = 1', () => {
|
||||
before(() => {
|
||||
CMOptions.HideSectionsButtons = 1;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(domids.CMSectionHidButtons.style.display, ''); // eslint-disable-line no-undef
|
||||
});
|
||||
});
|
||||
|
||||
@@ -5,29 +5,29 @@ import { l } from '../../GlobalsForTesting';
|
||||
import { CMOptions } from '../../../src/Config/VariablesAndData';
|
||||
import ToggleToolWarnPos from '../../../src/Config/Toggles/ToggleToolWarnPos';
|
||||
|
||||
describe('ToggleToolWarnPos', function () {
|
||||
describe('ToggleToolWarnPos', () => {
|
||||
global.l = l;
|
||||
|
||||
beforeEach(function () {
|
||||
beforeEach(() => {
|
||||
global.domids = {};
|
||||
ToggleToolWarnPos();
|
||||
});
|
||||
|
||||
describe('ToolWarnPos = 0', function () {
|
||||
before(function () {
|
||||
describe('ToolWarnPos = 0', () => {
|
||||
before(() => {
|
||||
CMOptions.ToolWarnPos = 0;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
it('Toggle style correctly', () => {
|
||||
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 () {
|
||||
describe('ToolWarnPos = 1', () => {
|
||||
before(() => {
|
||||
CMOptions.ToolWarnPos = 1;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
it('Toggle style correctly', () => {
|
||||
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
|
||||
|
||||
@@ -5,36 +5,36 @@ import { l, Game } from '../../GlobalsForTesting';
|
||||
import { CMOptions } from '../../../src/Config/VariablesAndData';
|
||||
import ToggleUpgradeBarAndColor from '../../../src/Config/Toggles/ToggleUpgradeBarAndColour';
|
||||
|
||||
describe('ToggleUpgradeBarAndColor', function () {
|
||||
describe('ToggleUpgradeBarAndColor', () => {
|
||||
global.l = l;
|
||||
global.Game = Game;
|
||||
|
||||
beforeEach(function () {
|
||||
beforeEach(() => {
|
||||
global.domids = {};
|
||||
ToggleUpgradeBarAndColor();
|
||||
});
|
||||
|
||||
describe('UpBarColor = 0', function () {
|
||||
before(function () {
|
||||
describe('UpBarColor = 0', () => {
|
||||
before(() => {
|
||||
CMOptions.UpBarColor = 0;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(domids.CMUpgradeBar.style.display, 'none'); // eslint-disable-line no-undef
|
||||
});
|
||||
});
|
||||
describe('UpBarColor = 1', function () {
|
||||
before(function () {
|
||||
describe('UpBarColor = 1', () => {
|
||||
before(() => {
|
||||
CMOptions.UpBarColor = 1;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(domids.CMUpgradeBar.style.display, ''); // eslint-disable-line no-undef
|
||||
});
|
||||
});
|
||||
describe('UpBarColor = 2', function () {
|
||||
before(function () {
|
||||
describe('UpBarColor = 2', () => {
|
||||
before(() => {
|
||||
CMOptions.UpBarColor = 2;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(domids.CMUpgradeBar.style.display, 'none'); // eslint-disable-line no-undef
|
||||
});
|
||||
});
|
||||
|
||||
@@ -5,27 +5,27 @@ import { l } from '../../GlobalsForTesting';
|
||||
import { CMOptions } from '../../../src/Config/VariablesAndData';
|
||||
import ToggleUpgradeBarFixedPos from '../../../src/Config/Toggles/ToggleUpgradeBarFixedPos';
|
||||
|
||||
describe('ToggleUpgradeBarFixedPos', function () {
|
||||
describe('ToggleUpgradeBarFixedPos', () => {
|
||||
global.l = l;
|
||||
|
||||
beforeEach(function () {
|
||||
beforeEach(() => {
|
||||
global.domids = {};
|
||||
ToggleUpgradeBarFixedPos();
|
||||
});
|
||||
|
||||
describe('UpgradeBarFixedPos = 0', function () {
|
||||
before(function () {
|
||||
describe('UpgradeBarFixedPos = 0', () => {
|
||||
before(() => {
|
||||
CMOptions.UpgradeBarFixedPos = 0;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(domids.CMUpgradeBar.style.position, ''); // eslint-disable-line no-undef
|
||||
});
|
||||
});
|
||||
describe('UpgradeBarFixedPos = 1', function () {
|
||||
before(function () {
|
||||
describe('UpgradeBarFixedPos = 1', () => {
|
||||
before(() => {
|
||||
CMOptions.UpgradeBarFixedPos = 1;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
it('Toggle style correctly', () => {
|
||||
assert.equal(domids.CMUpgradeBar.style.position, 'sticky'); // eslint-disable-line no-undef
|
||||
assert.equal(domids.CMUpgradeBar.style.top, '0px'); // eslint-disable-line no-undef
|
||||
});
|
||||
|
||||
@@ -5,56 +5,56 @@ import { l, Game } from '../../GlobalsForTesting';
|
||||
import { CMOptions } from '../../../src/Config/VariablesAndData';
|
||||
import ToggleWrinklerButtons from '../../../src/Config/Toggles/ToggleWrinklerButtons';
|
||||
|
||||
describe('ToggleWrinklerButtons', function () {
|
||||
describe('ToggleWrinklerButtons', () => {
|
||||
global.l = l;
|
||||
global.Game = Game;
|
||||
|
||||
beforeEach(function () {
|
||||
beforeEach(() => {
|
||||
global.domids = {};
|
||||
ToggleWrinklerButtons();
|
||||
});
|
||||
|
||||
describe('WrinklerButtons = 0', function () {
|
||||
before(function () {
|
||||
describe('WrinklerButtons = 0', () => {
|
||||
before(() => {
|
||||
CMOptions.WrinklerButtons = 0;
|
||||
});
|
||||
describe('Game.elderWrath = 0', function () {
|
||||
before(function () {
|
||||
describe('Game.elderWrath = 0', () => {
|
||||
before(() => {
|
||||
Game.elderWrath = 0;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
it('Toggle style correctly', () => {
|
||||
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 () {
|
||||
describe('Game.elderWrath = 1', () => {
|
||||
before(() => {
|
||||
Game.elderWrath = 1;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
it('Toggle style correctly', () => {
|
||||
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 () {
|
||||
describe('WrinklerButtons = 1', () => {
|
||||
before(() => {
|
||||
CMOptions.WrinklerButtons = 1;
|
||||
});
|
||||
describe('Game.elderWrath = 0', function () {
|
||||
before(function () {
|
||||
describe('Game.elderWrath = 0', () => {
|
||||
before(() => {
|
||||
Game.elderWrath = 0;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
it('Toggle style correctly', () => {
|
||||
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 () {
|
||||
describe('Game.elderWrath = 1', () => {
|
||||
before(() => {
|
||||
Game.elderWrath = 1;
|
||||
});
|
||||
it('Toggle style correctly', function () {
|
||||
it('Toggle style correctly', () => {
|
||||
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