forked from unimatrix/web
Fresh production baseline [skip ci]
This commit is contained in:
commit
0a11a18274
1 changed files with 229644 additions and 0 deletions
20
website/tests/material-processing-grades.test.mjs
Normal file
20
website/tests/material-processing-grades.test.mjs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import {MATERIAL_ITEM_GRADES as grades,itemTemplateCatalogue} from '../control-panel/public/item-metadata-policy.mjs';
|
||||
import {qualityForMark} from '../control-panel/public/equipment-template-policy.mjs';
|
||||
test('compressed resources use the next mark and its matching quality, capped at S1 MK14',()=>{
|
||||
for(const [base,block] of Object.entries({COPPER_INGOT:'COPPER_BLOCK',IRON_INGOT:'IRON_BLOCK',GOLD_INGOT:'GOLD_BLOCK',NETHERITE_INGOT:'NETHERITE_BLOCK',LAPIS_LAZULI:'LAPIS_BLOCK',REDSTONE:'REDSTONE_BLOCK',EMERALD:'EMERALD_BLOCK',DIAMOND:'DIAMOND_BLOCK',COAL:'COAL_BLOCK'})){
|
||||
const mark=Math.min(14,grades[base].equipmentMark+1);
|
||||
assert.deepEqual(grades[block],{quality:qualityForMark(mark),equipmentMark:mark,itemClass:'resource'});
|
||||
}
|
||||
});
|
||||
test('mob processing advances grades without changing custom item identities',()=>{
|
||||
assert.equal(grades.BLAZE_POWDER.equipmentMark,7);
|
||||
assert.equal(grades.ENDER_EYE.equipmentMark,8);
|
||||
assert.equal(grades.END_CRYSTAL.equipmentMark,9);
|
||||
assert.equal(grades.END_CRYSTAL.quality,'very_rare');
|
||||
assert.equal(grades.BONE.quality,'uncommon');
|
||||
const catalogue=itemTemplateCatalogue();
|
||||
assert.equal(catalogue.templates.refined_spice.quality,'rare');
|
||||
assert.equal(catalogue.templates.dr_imperial_codex.equipmentMark,1);
|
||||
});
|
||||
Loading…
Reference in a new issue

Staff