Release v2.17.4: add API region sorting and indexed placeholders
This commit is contained in:
1 parent
bc8075379a
commit
46636939de
18 files changed
+709
-232
No files matched your search
@@ -218,6 +218,20 @@ test('shared API item selection treats object paths as one item and preserves ar
|
||||
assert.equal(JSON.stringify(sandbox.window.placeholderUtils.resolveApiItems(response, 'data')), JSON.stringify([campaign]));
|
||||
});
|
||||
|
||||
test('shared API item sorting supports nested numeric and text fields with stable ties and missing values last', () => {
|
||||
const helpers = require('../src/web/public/js/shared/placeholder-utils');
|
||||
const rows = [
|
||||
{ name: 'First', stats: { kills: 8 } },
|
||||
{ name: 'Second', stats: { kills: 12 } },
|
||||
{ name: 'Third', stats: { kills: 12 } },
|
||||
{ name: 'Missing' }
|
||||
];
|
||||
assert.deepEqual(helpers.sortApiItems(rows, 'stats.kills', 'desc').map((item) => item.name), ['Second', 'Third', 'First', 'Missing']);
|
||||
assert.deepEqual(helpers.sortApiItems(rows, 'name', 'asc').map((item) => item.name), ['First', 'Missing', 'Second', 'Third']);
|
||||
assert.deepEqual(helpers.sortApiItems(rows, '', 'desc'), rows);
|
||||
assert.deepEqual(helpers.sortApiItems(rows, 'stats.kills', 'asc').map((item) => item.name), ['First', 'Second', 'Third', 'Missing']);
|
||||
});
|
||||
|
||||
test('API editor and player resolve object paths, root overrides, and numeric placeholders consistently', () => {
|
||||
let editor;
|
||||
const campaign = { name: 'Campaign', amount_raised: { value: '200' }, goal: { value: '1000' } };
|
||||
|
||||
Reference in new issue
Block a user