fix(recipe): re-export syncChanges and add show mock to fix test

This commit is contained in:
Will Miao
2026-06-02 11:02:20 +08:00
parent dd5d9cfcb2
commit df67bd396a
2 changed files with 5 additions and 0 deletions

View File

@@ -297,6 +297,10 @@ export async function resetAndReload(updateFolders = false, options = {}) {
* Refreshes the recipe list by triggering a backend scan, then reloading.
* @param {boolean} fullRebuild - If true, fully rebuild the cache; if false, incremental scan
*/
export async function syncChanges() {
return refreshRecipes(false);
}
export async function refreshRecipes(fullRebuild = true) {
const actionLabel = fullRebuild ? 'Rebuilding recipe cache' : 'Refreshing recipes';
const actionToast = fullRebuild ? 'Full rebuild' : 'Refresh';

View File

@@ -3,6 +3,7 @@ import { describe, it, beforeEach, afterEach, expect, vi } from 'vitest';
const showToastMock = vi.hoisted(() => vi.fn());
const loadingManagerMock = vi.hoisted(() => ({
showSimpleLoading: vi.fn(),
show: vi.fn(),
hide: vi.fn(),
restoreProgressBar: vi.fn(),
}));