improve gear tinting and unlock render tests

This commit is contained in:
jwinterm
2026-07-06 04:38:28 -04:00
parent 83020f6c08
commit c89c01e5f1
5 changed files with 65 additions and 13 deletions
+18
View File
@@ -53,6 +53,7 @@ function loadRenderKit() {
fs.readFileSync(path.join(__dirname, '../html/js/render/renderModes.js'), 'utf8'),
context
);
RK.RENDER_MODE_TEST_UNLOCKS = false;
return RK;
}
@@ -98,6 +99,23 @@ describe('render pack visual resolver', () => {
expect(RK.createRenderer('iso', {}, {}).name).toBe('iso');
});
test('temporary render test unlocks bypass mode gates only for render packs', () => {
const RK = loadRenderKit();
RK.setEntitlementSnapshot({ totalCreditsPurchased: 0, premium: false, packs: {} });
expect(RK.canUseMode('iso')).toBe(false);
expect(RK.canUsePack('iso-dungeon')).toBe(false);
RK.RENDER_MODE_TEST_UNLOCKS = true;
expect(RK.canUseMode('ascii')).toBe(true);
expect(RK.canUseMode('fancy')).toBe(true);
expect(RK.canUseMode('iso')).toBe(true);
expect(RK.canUseMode('3d')).toBe(true);
expect(RK.canUsePack('iso-dungeon')).toBe(true);
expect(RK.canUsePack('kenney-3d-characters')).toBe(true);
expect(RK.canUsePack('generated-skins')).toBe(false);
});
test('render pack code stays out of payment and account APIs', () => {
const files = [
'../html/js/render/assetPacks.js',