From b6465c61e76430a742db5977d18df169532686db Mon Sep 17 00:00:00 2001 From: Phan An Date: Thu, 15 Sep 2022 00:40:08 +0700 Subject: [PATCH] fix: some test errors --- resources/assets/js/__tests__/setup.ts | 2 +- resources/assets/js/services/downloadService.ts | 2 +- resources/assets/js/stores/songStore.spec.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/assets/js/__tests__/setup.ts b/resources/assets/js/__tests__/setup.ts index f69d9ffed0..d9e16fd396 100644 --- a/resources/assets/js/__tests__/setup.ts +++ b/resources/assets/js/__tests__/setup.ts @@ -14,4 +14,4 @@ window.HTMLMediaElement.prototype.load = vi.fn() window.HTMLMediaElement.prototype.play = vi.fn() window.HTMLMediaElement.prototype.pause = vi.fn() -window.BASE_URL = 'https://koel.test/' +window.BASE_URL = 'http://localhost/' diff --git a/resources/assets/js/services/downloadService.ts b/resources/assets/js/services/downloadService.ts index 981fb8a063..1142e4bb96 100644 --- a/resources/assets/js/services/downloadService.ts +++ b/resources/assets/js/services/downloadService.ts @@ -21,7 +21,7 @@ export const downloadService = { }, fromFavorites () { - if (favoriteStore.all.length) { + if (favoriteStore.state.songs.length) { this.trigger('favorites') } }, diff --git a/resources/assets/js/stores/songStore.spec.ts b/resources/assets/js/stores/songStore.spec.ts index d93cfee9dc..45fe2c796d 100644 --- a/resources/assets/js/stores/songStore.spec.ts +++ b/resources/assets/js/stores/songStore.spec.ts @@ -163,7 +163,7 @@ new class extends UnitTestCase { it('gets shareable URL', () => { const song = factory('song', { id: 'foo' }) - expect(songStore.getShareableUrl(song)).toBe('https://koel.test/#!/song/foo') + expect(songStore.getShareableUrl(song)).toBe('http://localhost/#!/song/foo') }) it('syncs with the vault', () => {