fix(messages): stop skeleton sticking after full content replace

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Fable 5 committed 2026-10-27 22:24:35 +08:00
1 parent 5febdb35c8
commit d71528f500
2 files changed
+13 -14

No files matched your search

@@ -89,6 +89,12 @@ test('message centre shows a skeleton during the AJAX load-more cycle', () => {
assert.match(script, /content\.querySelector\('\.messages-list > \.post_ajax_loader'\)/);
assert.match(script, /skeleton\.classList\.add\('is-loading'\)/);
assert.match(script, /loader\.classList\.remove\('is-loading'\)/);
// Teardown must sweep every loader, not just `.messages-list >` children:
// a loader stranded outside a list (empty view / detail) would stay open.
assert.match(script, /content\.querySelectorAll\('\.post_ajax_loader\.is-loading'\)/);
// Full replacement must not carry the old (still is-loading) node across.
assert.doesNotMatch(script, /list\.appendChild\(keep\)/);
assert.doesNotMatch(script, /content\.appendChild\(keep\)/);
// Appended rows land before the skeleton so it stays flush under the list.
assert.match(script, /currentList\.insertBefore\(item, skeleton\)/);