Added tests for toggles

This commit is contained in:
Daniël van Noord
2021-04-13 11:38:23 +02:00
parent 652d00ee72
commit d23719c2a8
4 changed files with 197 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
import { before, beforeEach, describe, it } from 'mocha';
import { assert } from 'chai';
import { l, Game } from '../../GlobalsForTesting'; // eslint-disable-line no-unused-vars
import ToggleBotBar from '../../../src/Config/Toggles/ToggleBotBar';
import { CMOptions } from '../../../src/Config/VariablesAndData';
describe('ToggleBotBar', function () {
global.l = l;
global.Game = Game;
beforeEach(function () {
global.domids = {};
ToggleBotBar();
});
describe('BotBar = 0', function () {
before(function () {
CMOptions.BotBar = 0;
});
it('Toggle style correctly', function () {
assert.equal(domids.CMBotBar.style.display, 'none'); // eslint-disable-line no-undef
});
});
describe('BotBar = 1', function () {
before(function () {
CMOptions.BotBar = 1;
});
it('Toggle style correctly', function () {
assert.equal(domids.CMBotBar.style.display, ''); // eslint-disable-line no-undef
});
});
});