Preserve saved API region item paths
Publish Docker Image / build-and-push-existing-registry (./build/Dockerfile, web, pulse-signage-web) (push) Successful in 1m24s
Publish Docker Image / build-and-push-existing-registry (./build/Dockerfile.player, player, pulse-signage-player) (push) Successful in 32s

This commit is contained in:
lzstealth committed 2026-10-26 01:32:14 +00:00
1 parent 1e8bcae72a
commit 1851187076
3 files changed
+30 -1

No files matched your search

+26
View File
@@ -242,6 +242,32 @@ test('API region results panel exposes its open control without resize buttons',
assert.match(expandedMarkup, /name="region_api_sort_by_24"[^>]*value="stats\.kills"/);
});
test('API editor preserves saved item paths instead of replacing them with the source default', () => {
const editor = loadApiEditor();
const context = {
region: { id: 23 },
current: { value: '{{0.name}}' },
config: { source_id: 11, default_items_path: 'data' },
sourceOptions: '',
placeholderFields: [],
placeholderChips: '',
sampleDataPreview: '[]',
fontSize: 32
};
for (const [savedPath, expectedPath] of [['data.players', 'data.players'], ['', ''], [null, ''], [undefined, 'data']]) {
const markup = editor.renderEditorCard({ ...context, config: { ...context.config, items_path: savedPath } });
assert.match(markup, new RegExp('name="region_api_items_path_23"[^>]*value="' + expectedPath.replace('.', '\\.') + '"'));
}
const explicitContext = editor.renderEditorCard({
...context,
itemsPath: 'other.players',
config: { ...context.config, items_path: 'data.players' }
});
assert.match(explicitContext, /name="region_api_items_path_23"[^>]*value="other\.players"/);
});
test('API results preview always includes the first result completely', () => {
let source = fs.readFileSync(path.join(__dirname, '../src/web/public/js/slides/slide-form-regions.js'), 'utf8');
source = source.replace("import { createSlideFormPreviewHelpers } from '/assets/js/slides/slide-form-preview.js';", '').replace('export function createSlideFormRegionHelpers', 'function createSlideFormRegionHelpers');