Comfy-Org / Comfy-Org/ComfyUI_frontend
test: add bootstrapStore fast-path test for cached Firebase session
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Summary
In PR #9909, the `bootstrapStore` test suite was extended to cover the sequential unlock path for Firebase authentication (init first, then auth). However, there is no test for the **fast path** where a returning user already has a cached Firebase session — i.e., both `isInitialized` and `isAuthenticated` are `true` at the time `startStoreBootstrap()` is called.
## Task
Add a small additional test case in `src/stores/bootstrapStore.test.ts` under the `cloud mode` describe block to cover this scenario:
```ts
it('bootstraps immediately when Firebase session is already cached', async () => {
// Both flags already true before bootstrap starts
mockIsFirebaseInitialized.value = true
mockIsFirebaseAuthenticated.value = true
const store = useBootstrapStore()
const settingStore = useSettingStore()
await store.startStoreBootstrap()
expect(store.isI18nReady).toBe(true)
expect(settingStore.isReady).toBe(true)
})
```
This ensures cached sessions (returning users) don't regress.
## Context
- Raised as a nitpick in PR #9909: https://github.com/Comfy-Org/ComfyUI_frontend/pull/9909#discussion_r2945644022
- Requested by @christian-byrne as a follow-up issue.
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-10170-test-add-bootstrapStore-fast-path-test-for-cached-Firebase-session-3266d73d365081beae43ec035e0316ea) by [Unito](https://www.unito.io)
Contributor guide
Assessment
This issue has not been assessed yet.