fix: post-merge type and test fixes

Library.vue: use Song type from store so SongCard's strict platform
union accepts the data (was platform: string, broke after merge tightened
SongCard prop type).

database.test.ts: switch toEqual -> toMatchObject so getBotInstances()
returning extra profile_* schema columns no longer fails the assertion.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
saopig1andClaude Opus 4.7 committed 2026-05-06 12:47:19 +08:00
1 parent 877c431b13
commit 652424b74c
2 files changed
+4 -6

No files matched your search

+1 -1
View File
@@ -68,7 +68,7 @@ describe("database", () => {
botDb.saveBotInstance(instance);
const instances = botDb.getBotInstances();
expect(instances).toHaveLength(1);
expect(instances[0]).toEqual(instance);
expect(instances[0]).toMatchObject(instance);
expect(instances[0].autoStart).toBe(true);
// Test upsert
+3 -5
View File
@@ -67,16 +67,14 @@
import { ref, onMounted } from 'vue';
import { Icon } from '@iconify/vue';
import axios from 'axios';
import { usePlayerStore } from '../stores/player.js';
import { usePlayerStore, type Song } from '../stores/player.js';
import CoverArt from '../components/CoverArt.vue';
import SongCard from '../components/SongCard.vue';
const store = usePlayerStore();
type SongItem = { id: string; name: string; artist: string; album: string; duration: number; coverUrl: string; platform: string };
const history = ref<SongItem[]>([]);
const liked = ref<SongItem[]>([]);
const history = ref<Song[]>([]);
const liked = ref<Song[]>([]);
const historyLoading = ref(true);
onMounted(async () => {