remove slide effect
This commit is contained in:
1 parent
a26f31a150
commit
f447a9a163
5 files changed
+101
-84
No files matched your search
@@ -13,7 +13,7 @@ class FakeIntersectionObserver {
|
||||
vi.stubGlobal('IntersectionObserver', FakeIntersectionObserver)
|
||||
|
||||
describe('useFeeds', () => {
|
||||
const { feeds, allItems, feedFilter, feedTitles, feedUnreadCounts, unreadCount, setFeedFilter, showMessage, message, showModal, fetchData, sync, getReadable, setInitialLoad, handleIntersection, markAllRead, setupIntersectionObserver } = useFeeds()
|
||||
const { feeds, allItems, feedFilter, feedTitles, feedUnreadCounts, unreadCount, displayedFeedUnreadCounts, refreshUnreadDisplay, setFeedFilter, showMessage, message, showModal, fetchData, sync, getReadable, setInitialLoad, handleIntersection, markAllRead, setupIntersectionObserver } = useFeeds()
|
||||
|
||||
beforeEach(() => {
|
||||
localStorage.setItem('user-token', 'test-token')
|
||||
@@ -119,6 +119,32 @@ describe('useFeeds', () => {
|
||||
setInitialLoad(false)
|
||||
})
|
||||
|
||||
it('refreshes the filter dropdown\'s displayed per-feed counts when list-view scrolling marks an article read', async () => {
|
||||
// displayedFeedUnreadCounts is a frozen snapshot of feedUnreadCounts (see
|
||||
// useFeeds.js) — AppNav's filter <select> renders it instead of the live
|
||||
// computed so paging through article view doesn't force it to repaint.
|
||||
// List-view scrolling is a different code path (handleIntersection) and
|
||||
// should keep it live regardless.
|
||||
allItems.value = [
|
||||
{ id: 301, feedTitle: 'Feed A', read: false },
|
||||
{ id: 302, feedTitle: 'Feed A', read: false },
|
||||
]
|
||||
feeds.value = [...allItems.value]
|
||||
refreshUnreadDisplay()
|
||||
expect(displayedFeedUnreadCounts.value).toEqual({ 'Feed A': 2 })
|
||||
|
||||
setInitialLoad(true)
|
||||
axios.put.mockResolvedValue({ status: 200 })
|
||||
|
||||
await handleIntersection([
|
||||
{ isIntersecting: false, boundingClientRect: { y: -10 }, target: { id: '0' } },
|
||||
])
|
||||
|
||||
expect(displayedFeedUnreadCounts.value).toEqual({ 'Feed A': 1 })
|
||||
|
||||
setInitialLoad(false)
|
||||
})
|
||||
|
||||
it('ignores the initial observer snapshot on connect so a scrolled-down reconnect cannot mass-mark', async () => {
|
||||
feeds.value = [
|
||||
{ id: 201, title: 'First' },
|
||||
|
||||
Reference in new issue
Block a user