You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This changeintroduces a **targeted** approach to improve the testability of MessageStore:
- Created a new ConfigurationStore as a Pinia store to replace usage of useConfiguration composable in MessageStore
- Created a new EditRetryStore as a Pinia store to replace useEditAndRetry composable usage in MessageStore
- Removed automatic initialization in the store definition to avoid network calls during tests and take advantage of Pinia testing infraestructure that stubs actions by default and allow tests to patch the stores state instead for each scenario
- The Message store explicitly calls loadConfig() of the new stores during initialization, which in turn is properly stubbed by Pinia when used in tests
- This allows component tests to run without unwanted network calls when patch the store state is preffered by the developer writing the component test
- The original useConfiguration composable remains untouched for other components
This focused refactoring prevents network calls from being made during tests while
minimizing changes to the codebase, as it only affects MessageStore.ts without
requiring a broader refactoring across all components that use configuration data.
0 commit comments