diff --git a/resources/assets/js/components/auth/LoginForm.vue b/resources/assets/js/components/auth/LoginForm.vue index b31d69d2..93f99134 100644 --- a/resources/assets/js/components/auth/LoginForm.vue +++ b/resources/assets/js/components/auth/LoginForm.vue @@ -22,8 +22,8 @@ const DEMO_ACCOUNT = { } const url = ref('') -const email = ref(isDemo ? DEMO_ACCOUNT.email : '') -const password = ref(isDemo ? DEMO_ACCOUNT.password : '') +const email = ref(isDemo() ? DEMO_ACCOUNT.email : '') +const password = ref(isDemo() ? DEMO_ACCOUNT.password : '') const failed = ref(false) const emit = defineEmits(['loggedin']) diff --git a/resources/assets/js/components/layout/main-wrapper/ExtraPanel.spec.ts b/resources/assets/js/components/layout/main-wrapper/ExtraPanel.spec.ts index b2ed7979..f01e0d5c 100644 --- a/resources/assets/js/components/layout/main-wrapper/ExtraPanel.spec.ts +++ b/resources/assets/js/components/layout/main-wrapper/ExtraPanel.spec.ts @@ -61,6 +61,14 @@ new class extends UnitTestCase { expect(emitMock).toHaveBeenCalledWith('MODAL_SHOW_ABOUT_KOEL') }) + it('notifies new version', async () => { + it('shows new version', () => { + commonStore.state.current_version = 'v1.0.0' + commonStore.state.latest_version = 'v1.0.1' + this.actingAsAdmin().renderComponent().getByTitle('New version available!') + }) + }) + it('logs out', async () => { const emitMock = this.mock(eventBus, 'emit') const { getByTitle } = this.renderComponent() diff --git a/resources/assets/js/components/layout/main-wrapper/ExtraPanel.vue b/resources/assets/js/components/layout/main-wrapper/ExtraPanel.vue index 66f06ecf..bb79ee21 100644 --- a/resources/assets/js/components/layout/main-wrapper/ExtraPanel.vue +++ b/resources/assets/js/components/layout/main-wrapper/ExtraPanel.vue @@ -7,8 +7,14 @@
-
-

+

diff --git a/resources/assets/js/components/meta/AboutKoelModal.spec.ts b/resources/assets/js/components/meta/AboutKoelModal.spec.ts index 5a182042..f16fe89d 100644 --- a/resources/assets/js/components/meta/AboutKoelModal.spec.ts +++ b/resources/assets/js/components/meta/AboutKoelModal.spec.ts @@ -1,6 +1,8 @@ import { expect, it } from 'vitest' import { commonStore } from '@/stores' import UnitTestCase from '@/__tests__/UnitTestCase' +import { http } from '@/services' +import { waitFor } from '@testing-library/vue' import AboutKoelModel from './AboutKoelModal.vue' new class extends UnitTestCase { @@ -15,13 +17,20 @@ new class extends UnitTestCase { it('shows new version', () => { commonStore.state.current_version = 'v1.0.0' commonStore.state.latest_version = 'v1.0.1' - this.actingAsAdmin().render(AboutKoelModel).findByTestId('new-version-about') + this.actingAsAdmin().render(AboutKoelModel).getByTestId('new-version-about') }) - it('shows demo notation', () => { + it('shows demo notation', async () => { + const getMock = this.mock(http, 'get').mockResolvedValue([]) // @ts-ignore import.meta.env.VITE_KOEL_ENV = 'demo' - this.render(AboutKoelModel).findByTestId('demo-credits') + + const { getByTestId } = this.render(AboutKoelModel) + + await waitFor(() => { + getByTestId('demo-credits') + expect(getMock).toHaveBeenCalledWith('demo/credits') + }) }) } } diff --git a/resources/assets/js/components/meta/AboutKoelModal.vue b/resources/assets/js/components/meta/AboutKoelModal.vue index 37377230..096181d4 100644 --- a/resources/assets/js/components/meta/AboutKoelModal.vue +++ b/resources/assets/js/components/meta/AboutKoelModal.vue @@ -21,11 +21,11 @@ Made with ❤️ by Phan An and quite a few - awesome - contributors. + awesome contributors.

-
+
Music by