From 6b14cda3f9f4b93019c3b852e9fb4eb36c8cebc0 Mon Sep 17 00:00:00 2001 From: Phan An Date: Wed, 26 Oct 2022 23:39:24 +0200 Subject: [PATCH] feat: add sponsor list to About modal (#1558) --- resources/assets/img/sponsors/exoscale.svg | 6 ++ resources/assets/img/sponsors/keycdn.svg | 6 ++ resources/assets/img/sponsors/render.svg | 60 +++++++++++++++++++ .../assets/img/sponsors/what-the-diff.svg | 1 + .../js/components/meta/AboutKoelModal.spec.ts | 16 ++++- .../js/components/meta/AboutKoelModal.vue | 32 +++++----- .../js/components/meta/SponsorList.spec.ts | 11 ++++ .../assets/js/components/meta/SponsorList.vue | 36 +++++++++++ .../__snapshots__/AboutKoelModal.spec.ts.snap | 7 +-- .../__snapshots__/SponsorList.spec.ts.snap | 3 + resources/assets/js/sponsors.ts | 46 ++++++++++++++ 11 files changed, 199 insertions(+), 25 deletions(-) create mode 100644 resources/assets/img/sponsors/exoscale.svg create mode 100644 resources/assets/img/sponsors/keycdn.svg create mode 100644 resources/assets/img/sponsors/render.svg create mode 100644 resources/assets/img/sponsors/what-the-diff.svg create mode 100644 resources/assets/js/components/meta/SponsorList.spec.ts create mode 100644 resources/assets/js/components/meta/SponsorList.vue create mode 100644 resources/assets/js/components/meta/__snapshots__/SponsorList.spec.ts.snap create mode 100644 resources/assets/js/sponsors.ts diff --git a/resources/assets/img/sponsors/exoscale.svg b/resources/assets/img/sponsors/exoscale.svg new file mode 100644 index 00000000..fc9e74b1 --- /dev/null +++ b/resources/assets/img/sponsors/exoscale.svg @@ -0,0 +1,6 @@ + + + + diff --git a/resources/assets/img/sponsors/keycdn.svg b/resources/assets/img/sponsors/keycdn.svg new file mode 100644 index 00000000..6afdf165 --- /dev/null +++ b/resources/assets/img/sponsors/keycdn.svg @@ -0,0 +1,6 @@ + + + + diff --git a/resources/assets/img/sponsors/render.svg b/resources/assets/img/sponsors/render.svg new file mode 100644 index 00000000..853c6f1e --- /dev/null +++ b/resources/assets/img/sponsors/render.svg @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/assets/img/sponsors/what-the-diff.svg b/resources/assets/img/sponsors/what-the-diff.svg new file mode 100644 index 00000000..3ff529f3 --- /dev/null +++ b/resources/assets/img/sponsors/what-the-diff.svg @@ -0,0 +1 @@ + diff --git a/resources/assets/js/components/meta/AboutKoelModal.spec.ts b/resources/assets/js/components/meta/AboutKoelModal.spec.ts index f16fe89d..845c68dc 100644 --- a/resources/assets/js/components/meta/AboutKoelModal.spec.ts +++ b/resources/assets/js/components/meta/AboutKoelModal.spec.ts @@ -6,18 +6,28 @@ import { waitFor } from '@testing-library/vue' import AboutKoelModel from './AboutKoelModal.vue' new class extends UnitTestCase { + private renderComponent () { + return this.render(AboutKoelModel, { + global: { + stubs: { + SponsorList: this.stub('sponsor-list') + } + } + }) + } + protected test () { it('renders', async () => { commonStore.state.current_version = 'v0.0.0' commonStore.state.latest_version = 'v0.0.0' - expect(this.render(AboutKoelModel).html()).toMatchSnapshot() + expect(this.renderComponent().html()).toMatchSnapshot() }) it('shows new version', () => { commonStore.state.current_version = 'v1.0.0' commonStore.state.latest_version = 'v1.0.1' - this.actingAsAdmin().render(AboutKoelModel).getByTestId('new-version-about') + this.actingAsAdmin().renderComponent().getByTestId('new-version-about') }) it('shows demo notation', async () => { @@ -25,7 +35,7 @@ new class extends UnitTestCase { // @ts-ignore import.meta.env.VITE_KOEL_ENV = 'demo' - const { getByTestId } = this.render(AboutKoelModel) + const { getByTestId } = this.renderComponent() await waitFor(() => { getByTestId('demo-credits') diff --git a/resources/assets/js/components/meta/AboutKoelModal.vue b/resources/assets/js/components/meta/AboutKoelModal.vue index 096181d4..d21affe3 100644 --- a/resources/assets/js/components/meta/AboutKoelModal.vue +++ b/resources/assets/js/components/meta/AboutKoelModal.vue @@ -1,15 +1,11 @@