fix(admin): translate asset notification type labels

Register Chinese labels and matching badge tones for balance and points
increase/decrease types across message filters, list badges and details.
Add regression coverage without changing notification delivery behavior.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Fable 5 committed 2026-10-30 17:36:42 +08:00
1 parent fe3ef82718
commit 1902ba1e87
3 files changed
+26 -3

No files matched your search

@@ -144,6 +144,21 @@ test('role broadcasts require confirmation of the current role and count on the
assert.equal(nonce_checked.length, 8);
});
test('asset types use Chinese labels in filters, row badges and details', () => {
const { asset_types, filter_form, asset_table } = harness();
assert.deepEqual(asset_types, {
asset_balance_increase: ['余额增加', 'success'],
asset_balance_decrease: ['余额减少', 'danger'],
asset_points_increase: ['积分增加', 'success'],
asset_points_decrease: ['积分减少', 'danger'],
});
for (const [type, [label]] of Object.entries(asset_types)) {
assert.ok(filter_form.includes(`<option value="${type}">${label}</option>`));
}
assert.match(asset_table, /class="aksrt-msg-badge is-success"[^>]*>余额增加<\/a>/);
assert.match(asset_table, /<dt>消息类型<\/dt><dd>余额增加<\/dd>/);
});
test('single row actions cannot accidentally operate on the checked bulk selection', () => {
const { single_delete } = harness();
assert.deepEqual(single_delete.sql[0].params, [8]);