From a3d3656bf156a637524b7473e7cd385084f160a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Mon, 2 Aug 2021 16:17:35 +0200 Subject: [PATCH] Implement login-button --- .../LoginButton/LoginButton.spec.js | 53 ++++++++++++++ webapp/components/LoginButton/LoginButton.vue | 54 ++++++++++++++ .../features/InternalPage/InternalPage.vue | 1 - webapp/layouts/basic.vue | 70 ++++++++++++++++++- webapp/locales/html/de/organization.html | 5 +- webapp/locales/html/en/organization.html | 18 +++-- webapp/pages/organization.vue | 3 +- 7 files changed, 189 insertions(+), 15 deletions(-) create mode 100644 webapp/components/LoginButton/LoginButton.spec.js create mode 100644 webapp/components/LoginButton/LoginButton.vue diff --git a/webapp/components/LoginButton/LoginButton.spec.js b/webapp/components/LoginButton/LoginButton.spec.js new file mode 100644 index 000000000..f28045612 --- /dev/null +++ b/webapp/components/LoginButton/LoginButton.spec.js @@ -0,0 +1,53 @@ +import { config, mount } from '@vue/test-utils' +import InviteButton from './InviteButton.vue' + +config.stubs['v-popover'] = '' + +describe('InviteButton.vue', () => { + let wrapper + let mocks + let propsData + + beforeEach(() => { + mocks = { + $t: jest.fn(), + navigator: { + clipboard: { + writeText: jest.fn(), + }, + }, + } + propsData = {} + }) + + describe('mount', () => { + const Wrapper = () => { + return mount(InviteButton, { mocks, propsData }) + } + + beforeEach(() => { + wrapper = Wrapper() + }) + + it('renders', () => { + expect(wrapper.contains('.invite-button')).toBe(true) + }) + + it('open popup', () => { + wrapper.find('.base-button').trigger('click') + expect(wrapper.contains('.invite-button')).toBe(true) + }) + + it('invite codes not available', async () => { + wrapper.find('.base-button').trigger('click') // open popup + wrapper.find('.invite-button').trigger('click') // click copy button + expect(mocks.$t).toHaveBeenCalledWith('invite-codes.not-available') + }) + + it.skip('invite codes copied to clipboard', async () => { + wrapper.find('.base-button').trigger('click') // open popup + wrapper.find('.invite-button').trigger('click') // click copy button + expect(mocks.$t).toHaveBeenCalledWith('invite-codes.not-available') + }) + }) +}) diff --git a/webapp/components/LoginButton/LoginButton.vue b/webapp/components/LoginButton/LoginButton.vue new file mode 100644 index 000000000..39f0fa4ae --- /dev/null +++ b/webapp/components/LoginButton/LoginButton.vue @@ -0,0 +1,54 @@ + + + + + diff --git a/webapp/components/_new/features/InternalPage/InternalPage.vue b/webapp/components/_new/features/InternalPage/InternalPage.vue index 0d071c3f1..389ecc01c 100644 --- a/webapp/components/_new/features/InternalPage/InternalPage.vue +++ b/webapp/components/_new/features/InternalPage/InternalPage.vue @@ -34,7 +34,6 @@ export default { title: this.$t(this.pageParams.internalPage.headTitleIdent), } }, - // layout: 'basic', // components: { // Logo, // }, diff --git a/webapp/layouts/basic.vue b/webapp/layouts/basic.vue index 01872868e..a14ae4f3c 100644 --- a/webapp/layouts/basic.vue +++ b/webapp/layouts/basic.vue @@ -10,7 +10,17 @@ - + @@ -26,18 +36,26 @@ + + diff --git a/webapp/locales/html/de/organization.html b/webapp/locales/html/de/organization.html index c1eec4273..2ffdd90b5 100644 --- a/webapp/locales/html/de/organization.html +++ b/webapp/locales/html/de/organization.html @@ -24,7 +24,7 @@

Sende-Wochenplan -

+

@@ -83,7 +83,4 @@ https://senderfm.out.airtime.pro/senderfm_a --> margin-bottom: 0px; margin-left: -20px; } - .schedule.current, .schedule_content { - max-height: 900px; - } diff --git a/webapp/locales/html/en/organization.html b/webapp/locales/html/en/organization.html index 19e9ebf9a..7a3316eb2 100644 --- a/webapp/locales/html/en/organization.html +++ b/webapp/locales/html/en/organization.html @@ -15,17 +15,17 @@


--> -

+

Our Radio Stream -

+

-

+

Radio Weekly Plan -

- + +

@@ -38,6 +38,12 @@ https://senderfm.out.airtime.pro/senderfm_a --> margin-bottom: 48px; } + .h1-headline { + font-size: 48px; + margin-top: 12px; + margin-bottom: 8px; + } + .h3-headline-big { font-size: 64px; margin-top: 12px; @@ -45,7 +51,7 @@ https://senderfm.out.airtime.pro/senderfm_a --> } .h3-headline { - font-size: 24px; + font-size: 32px; margin-top: 12px; margin-bottom: 8px; } diff --git a/webapp/pages/organization.vue b/webapp/pages/organization.vue index 6478caca3..0447fff4f 100644 --- a/webapp/pages/organization.vue +++ b/webapp/pages/organization.vue @@ -17,11 +17,10 @@ import links from '~/constants/links.js' import InternalPage from '~/components/_new/features/InternalPage/InternalPage.vue' export default { + layout: 'basic', components: { InternalPage, }, - // Wolle - layout: 'basic', data() { // Wolle console.log(links.ORGANIZATION) return { links }