change icon stats, new plana, redesign some ui, fix JSON managment
Deploy GaC-Srtool to GitHub Pages / deploy (push) Canceled after 0s

This commit is contained in:
CAtlas0784 committed 2026-11-02 10:07:19 +07:00
1 parent 083848ee6e
commit 45d8414e60
19 files changed
+911 -222

No files matched your search

+49
View File
@@ -2,6 +2,7 @@ const test = require('node:test');
const assert = require('node:assert/strict');
const fs = require('node:fs');
const path = require('node:path');
const vm = require('node:vm');
test('4.6 equipment metadata and bundled artwork are available', async () => {
const { LIGHTCONE_METADATA, RELIC_SET_METADATA, getRelicSetInfo } = await import('../js/equipment-data.js');
@@ -15,10 +16,58 @@ test('4.6 equipment metadata and bundled artwork are available', async () => {
assert.equal(getRelicSetInfo(id, 'en').name, name);
assert.ok(getRelicSetInfo(id, 'en').desc2);
assert.notEqual(relic.creationAvailable, false);
assert.ok(fs.existsSync(path.resolve(__dirname, '..', relic.setIcon)));
for (const slot of [5, 6]) assert.ok(fs.existsSync(path.resolve(__dirname, '..', relic.images[slot])));
}
});
test('Aha recommends Dreamlit Actor and the captured God\'s Moment of Joy set', () => {
const source = fs.readFileSync(path.join(__dirname, '../js/app.js'), 'utf8');
const start = source.indexOf('const CHARACTER_OPTIMAL_BUILDS =');
const end = source.indexOf('// Recommended Relic Builds by Path', start);
assert.ok(start >= 0 && end > start);
const context = vm.createContext({});
vm.runInContext(source.slice(start, end) + '\nthis.build = getOptimalBuildForAvatar(1511);', context);
assert.equal(context.build.cavern, 133);
assert.equal(context.build.planar, 329);
const capture = require('../assets/relic-client-capture.json');
for (const [slot, id] of [[5, context.build.sphere], [6, context.build.rope]]) {
const piece = capture.relics.find(row => row.SetID === context.build.planar && row.Type === slot);
assert.ok(piece && capture.main_affixes.some(row => row.GroupID === piece.MainAffixGroup && row.AffixID === id));
}
});
test('all six relic slots use bundled game artwork and localized badge labels', async () => {
const source = fs.readFileSync(path.join(__dirname, '../js/app.js'), 'utf8');
const start = source.indexOf('const SLOT_NAMES_FULL =');
const end = source.indexOf('function getRelicMainAffixName', start);
assert.ok(start >= 0 && end > start);
const context = vm.createContext({ t: key => key });
vm.runInContext(source.slice(start, end) + '\nthis.slots = SLOT_NAMES_FULL;', context);
const icons = new Set();
for (let slot = 1; slot <= 6; slot++) {
const icon = context.slots[slot].icon;
assert.ok(fs.existsSync(path.resolve(__dirname, '..', icon)));
icons.add(icon);
}
assert.equal(icons.size, 6);
assert.match(source, /relic-slot-type-icon/);
assert.match(source, /relic-slot-empty-icon/);
const { TRANSLATIONS } = await import('../js/i18n.js');
for (const language of ['th', 'en']) assert.match(TRANSLATIONS[language].relicSlotBadgeLabel, /\{slot\}/);
});
test('equipment and trace labels do not embed emoji in any supported translation', async () => {
const { TRANSLATIONS } = await import('../js/i18n.js');
const keys = ['tabEquipment', 'modalAddLcTitle', 'modalAddRelicTitle', 'eqLcTitle', 'eqRelicTitle', 'overviewEquippedLc', 'overviewEquippedRelics', 'activeSetEffects', 'traceA2', 'traceA4', 'traceA6'];
for (const [language, translations] of Object.entries(TRANSLATIONS)) {
for (const key of keys) {
if (translations[key]) assert.doesNotMatch(translations[key], /^[🌟✨🗡🛡]/u, `${language}: ${key}`);
}
}
for (const language of ['th', 'en']) assert.match(TRANSLATIONS[language].relicSetPieces, /\{count\}/);
});
test('captured relic templates reference matching client affix properties', () => {
const capture = require('../assets/relic-client-capture.json');
assert.deepEqual(capture.relics.map(row => row.ID), [63295, 63296, 63305, 63306]);