perf: streamline view data loading
This commit is contained in:
@@ -44,12 +44,15 @@ describe('countdown modal accessibility', () => {
|
||||
expect(source).toContain(':disabled="form.ignore_year"')
|
||||
})
|
||||
|
||||
it('shows cached countdowns immediately and refreshes active items first', () => {
|
||||
it('shows cached countdowns immediately and shares one fresh/in-flight refresh', () => {
|
||||
expect(source).toContain('readCountdownCache<Countdown>()')
|
||||
expect(source).toContain("const active = await request('/countdowns')")
|
||||
expect(source).toContain("const archivedItems = await request('/countdowns?archived=true')")
|
||||
expect(source).toContain('writeCountdownCache(items.value, archived.value)')
|
||||
expect(source).not.toContain("Promise.all([request('/countdowns'),request('/countdowns?archived=true')])")
|
||||
expect(source).toContain('loadCountdownCache(fetchCountdowns, { force })')
|
||||
expect(source).toContain("request('/countdowns') as Promise<Countdown[]>")
|
||||
expect(source).toContain("request('/countdowns?archived=true') as Promise<Countdown[]>")
|
||||
expect(source).toContain('const generation = getCountdownCacheGeneration()')
|
||||
expect(source).toContain('if (!isCountdownCacheGenerationCurrent(generation)) return')
|
||||
expect(source).toContain('if (isCountdownCacheGenerationCurrent(generation)) error.value=')
|
||||
expect(source).toContain('if (isCountdownCacheGenerationCurrent(generation)) busy.value=false')
|
||||
})
|
||||
|
||||
it('prevents duplicate submits and sends the edit precondition', () => {
|
||||
|
||||
Reference in New Issue
Block a user