fix(widgets): replace old page before showing pagination skeleton

This commit is contained in:
kate522 committed 2026-10-29 21:29:17 +08:00
1 parent 985f18c750
commit 4c13ef478c
4 files changed
+189 -29

No files matched your search

@@ -47,8 +47,8 @@ test('widget REST client keeps the skeleton across the load-more cycle', () => {
assert.match(frontend, /loader\.classList\.add\('is-loading'\)/);
assert.doesNotMatch(frontend, /loader\.style\.display/);
// The skeleton is anchored to the end of the list on every request, exactly
// like the reference post_ajax beforeSend hook.
// The loader follows any retained rows and precedes the pagination controls.
// Replacement clears old rows before loading; runtime tests cover that cycle.
assert.match(frontend, /function anchorLoader\(container\) \{/);
assert.match(frontend, /if \(!loader\) return null;/);
assert.match(frontend, /pag\.parentNode\.insertBefore\(loader, pag\)/);
@@ -57,8 +57,6 @@ test('widget REST client keeps the skeleton across the load-more cycle', () => {
// flush under the last card.
assert.match(frontend, /var anchor = loaderOf\(container\) \|\| container\.querySelector\(':scope > \.ajax-pag'\);/);
// A replace must preserve the loader node (the reference success only hides it).
assert.match(frontend, /if \(child !== loader && !child\.classList\.contains\('ajax-pag'\)\) child\.remove\(\);/);
assert.match(frontend, /return fetch\(itemsUrl\(/);
});