修复了一些问题
This commit is contained in:
@@ -45,6 +45,30 @@ test('message center URL helper builds every view from the configured alias', ()
|
||||
});
|
||||
});
|
||||
|
||||
test('message pagination setting switches between cumulative loading and numeric replacement', () => {
|
||||
const result = spawnSync(process.env.PHP_BINARY || 'php', [path.join(__dirname, 'message-center-pagination-harness.php')], {
|
||||
cwd: root,
|
||||
encoding: 'utf8',
|
||||
});
|
||||
assert.equal(result.status, 0, result.stderr || result.stdout);
|
||||
assert.deepEqual(JSON.parse(result.stdout), {
|
||||
ajax_items: 40,
|
||||
ajax_has_more: true,
|
||||
ajax_has_numbers: false,
|
||||
default_items: 20,
|
||||
default_has_more: false,
|
||||
default_numbers: true,
|
||||
default_current_2: true,
|
||||
});
|
||||
|
||||
const script = read('assets/js/messages.js');
|
||||
const styles = read('assets/css/frontend/messages.css');
|
||||
assert.match(script, /data-message-next-page|dataset\.messageNextPage/);
|
||||
assert.match(script, /appendMessagePage\(result\.data\.content\)/);
|
||||
assert.match(styles, /\.messages-pagination__more/);
|
||||
assert.match(styles, /\.messages-pagination__button\.is-current/);
|
||||
});
|
||||
|
||||
test('tabs, pagination, actions, and detail all replace DOM fragments', () => {
|
||||
const center = read('inc/modules/message-center.php');
|
||||
const script = read('assets/js/messages.js');
|
||||
|
||||
Reference in New Issue
Block a user