improvements

This commit is contained in:
2026-09-28 23:01:07 +02:00
parent 27a42a076b
commit 3206b1b3f1
2 changed files with 18 additions and 3 deletions
+11 -1
View File
@@ -11,7 +11,7 @@ function harness() {
' Plugin.register(PLUGIN_ID, {', `globalThis.props = { indexPropZip, propResourcePath, openPropSource,
loadPropAsset, resolvePropModel, propTextureId, propDisplayTransform, manualPropModel,
writePropDefinition, effectivePropEntry, effectivePropItem, propEntryKey, extrudePropPixels, discoverPropSources,
buildPropMesh, refreshPropPreviews, clearPropMeshes, propFaceVertices, propDefaultUv,
buildPropMesh, refreshPropPreviews, clearPropMeshes, propFaceVertices, propDefaultUv, propItemOptions,
applyPropPreview, createPropDialog, showPropDialog, readPropPreviews };
Plugin.register(PLUGIN_ID, {`);
const context = { Buffer, requireNativeModule: require, console, Plugin: { register() {} },
@@ -161,6 +161,16 @@ test('asset discovery reuses Asset Browser cache without requiring the plugin',
assert.equal(sources[0].label,'Asset Browser: 1.21.11');
});
test('item picker includes entries after the first hundred and filters the full source list', () => {
const h = harness();
const items = Array.from({ length: 1505 }, (_, index) => `minecraft:item_${String(index).padStart(4, '0')}`);
const all = h.propItemOptions(items, '');
assert.equal(Object.keys(all).length, 1506);
assert.equal(all['minecraft:item_1504'], 'minecraft:item_1504');
const searched = h.propItemOptions(items, ' ITEM_1504 ');
assert.deepEqual(Object.keys(searched), ['', 'minecraft:item_1504']);
});
test('Item Props uses native dialog form fields and Apply/Cancel actions', () => {
const h = harness();
let configuration;