feat: add current view refresh action
This commit is contained in:
@@ -615,6 +615,15 @@ describe('task and habit row decoration', () => {
|
||||
expect(app.match(/<CompletedFilterPill/g)).toHaveLength(1)
|
||||
expect(app).toContain("v-if=\"['today', 'tasks', 'upcoming', 'habits'].includes(activeView)\"")
|
||||
expect(app).toContain('v-model="showCompleted"')
|
||||
expect(app).toContain('class="topbar-actions"')
|
||||
expect(app).toContain('topbar-refresh')
|
||||
expect(app).toContain('aria-label="刷新当前页面"')
|
||||
expect(app).toContain('@click="refreshCurrentView"')
|
||||
expect(app).toContain(':class="{spinning:refreshing}"')
|
||||
expect(app).toContain(':disabled="refreshing || loading"')
|
||||
expect(app).toContain("else if (activeView.value === 'today') await Promise.all([refreshAll(), habitComposer.value?.refreshHabits()])")
|
||||
expect(app).toContain("if (activeView.value === 'habits') await habitComposer.value?.refreshHabits()")
|
||||
expect(mvpPanel).toContain('defineExpose({ openHabitComposer, refreshHabits: loadHabits })')
|
||||
expect(app).toContain("readStoredBoolean(window.localStorage, SHOW_COMPLETED_STORAGE_KEY, true)")
|
||||
expect(app).toContain("writeStoredBoolean(window.localStorage, SHOW_COMPLETED_STORAGE_KEY, value)")
|
||||
expect(app).toContain(':show-completed="showCompleted"')
|
||||
@@ -642,8 +651,11 @@ describe('task and habit row decoration', () => {
|
||||
expect(css).toContain('.topbar .search{width:100%;margin:0}')
|
||||
expect(css).toContain('.topbar-title{grid-area:title;min-width:0;width:100%}')
|
||||
expect(css).toContain('.topbar h1{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;')
|
||||
expect(css).toContain('.topbar-filter{grid-area:filter;justify-self:end;')
|
||||
expect(app.indexOf('class="topbar-filter"')).toBeLessThan(app.indexOf('class="search-reveal"'))
|
||||
expect(css).toContain('.topbar-filter{justify-self:end;')
|
||||
expect(css).toContain('.topbar-actions{grid-area:filter;justify-self:end;display:flex;align-items:center;gap:8px}')
|
||||
expect(css).toContain('.topbar-refresh{width:44px;height:44px;')
|
||||
expect(css).toContain('.topbar-refresh.spinning svg{animation:topbar-refresh-spin .7s linear infinite}')
|
||||
expect(app.indexOf('class="topbar-actions"')).toBeLessThan(app.indexOf('class="search-reveal"'))
|
||||
expect(app).toContain('@touchstart="startSearchPull"')
|
||||
expect(app).toContain('@touchmove="moveSearchPull"')
|
||||
expect(app).toContain('@touchend="finishSearchPull"')
|
||||
|
||||
Reference in New Issue
Block a user