levels tests

This commit is contained in:
realaravinth
2021-05-06 17:22:25 +05:30
parent 6069509504
commit 20ee5c35c6
8 changed files with 184 additions and 72 deletions

View File

@@ -16,25 +16,12 @@
*/
import getLevelFields from './getLevelFields';
import {getAddForm, addLevel} from '../setupTests';
import {Level} from './index';
//import CONST from '../const';
import {getAddForm, level1, level2, addLevel} from '../setupTests';
document.body.innerHTML = getAddForm();
const level1: Level = {
difficulty_factor: 200,
visitor_threshold: 500,
};
const level2: Level = {
difficulty_factor: 400,
visitor_threshold: 700,
};
it('get levels fields works', () => {
addLevel(level1.visitor_threshold, level1.difficulty_factor);
console.log(document.body.innerHTML);
expect(getLevelFields(1)).toEqual(level1);
addLevel(level2.visitor_threshold, level2.difficulty_factor);