mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
fix: update tests for InstalledSkill new fields and missing hook mocks
- Add content_hash and updated_at fields to 4 InstalledSkill literals in skill_sync.rs - Add useCheckSkillUpdates and useUpdateSkill to UnifiedSkillsPanel test mock - Suppress unused import warning in auto_launch.rs test module
This commit is contained in:
@@ -70,6 +70,7 @@ pub fn is_auto_launch_enabled() -> Result<bool, AppError> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[allow(unused_imports)]
|
||||
use super::*;
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
|
||||
@@ -110,6 +110,8 @@ fn sync_to_app_removes_disabled_and_orphaned_ssot_symlinks() {
|
||||
opencode: false,
|
||||
},
|
||||
installed_at: 0,
|
||||
content_hash: None,
|
||||
updated_at: 0,
|
||||
})
|
||||
.expect("save disabled skill");
|
||||
|
||||
@@ -154,6 +156,8 @@ fn uninstall_skill_creates_backup_before_removing_ssot() {
|
||||
opencode: false,
|
||||
},
|
||||
installed_at: 123,
|
||||
content_hash: None,
|
||||
updated_at: 0,
|
||||
})
|
||||
.expect("save skill");
|
||||
|
||||
@@ -222,6 +226,8 @@ fn restore_skill_backup_restores_files_to_ssot_and_current_app() {
|
||||
opencode: false,
|
||||
},
|
||||
installed_at: 456,
|
||||
content_hash: None,
|
||||
updated_at: 0,
|
||||
})
|
||||
.expect("save skill");
|
||||
|
||||
@@ -303,6 +309,8 @@ fn delete_skill_backup_removes_backup_directory() {
|
||||
opencode: false,
|
||||
},
|
||||
installed_at: 789,
|
||||
content_hash: None,
|
||||
updated_at: 0,
|
||||
})
|
||||
.expect("save skill");
|
||||
|
||||
|
||||
@@ -64,6 +64,15 @@ vi.mock("@/hooks/useSkills", () => ({
|
||||
useInstallSkillsFromZip: () => ({
|
||||
mutateAsync: installFromZipMock,
|
||||
}),
|
||||
useCheckSkillUpdates: () => ({
|
||||
data: [],
|
||||
refetch: vi.fn(),
|
||||
isFetching: false,
|
||||
}),
|
||||
useUpdateSkill: () => ({
|
||||
mutateAsync: vi.fn(),
|
||||
isPending: false,
|
||||
}),
|
||||
}));
|
||||
|
||||
describe("UnifiedSkillsPanel", () => {
|
||||
|
||||
Reference in New Issue
Block a user