diff --git a/frontend/src/components/HeaderDefault.vue b/frontend/src/components/HeaderDefault.vue index 001ae417..54d7b622 100644 --- a/frontend/src/components/HeaderDefault.vue +++ b/frontend/src/components/HeaderDefault.vue @@ -50,16 +50,16 @@ function toggleTheme() { - + About - + Contact - + Privacy Policy - + Terms of Use diff --git a/frontend/src/components/HeaderDetailPage.vue b/frontend/src/components/HeaderDetailPage.vue index 964a24bc..5257acdf 100644 --- a/frontend/src/components/HeaderDetailPage.vue +++ b/frontend/src/components/HeaderDetailPage.vue @@ -100,16 +100,16 @@ watch(() => props.searchTerm, updateTerms) - + About - + Contact - + Privacy Policy - + Terms of Use diff --git a/frontend/src/components/StaticViews/AboutView.vue b/frontend/src/components/StaticViews/AboutView.vue new file mode 100644 index 00000000..f32cff5f --- /dev/null +++ b/frontend/src/components/StaticViews/AboutView.vue @@ -0,0 +1,100 @@ + + + diff --git a/frontend/src/components/StaticViews/ContactView.vue b/frontend/src/components/StaticViews/ContactView.vue new file mode 100644 index 00000000..ef1e2643 --- /dev/null +++ b/frontend/src/components/StaticViews/ContactView.vue @@ -0,0 +1,30 @@ + + + diff --git a/frontend/src/components/StaticViews/PrivacyView.vue b/frontend/src/components/StaticViews/PrivacyView.vue new file mode 100644 index 00000000..3589a4f9 --- /dev/null +++ b/frontend/src/components/StaticViews/PrivacyView.vue @@ -0,0 +1,14 @@ + diff --git a/frontend/src/components/StaticViews/TermsView.vue b/frontend/src/components/StaticViews/TermsView.vue new file mode 100644 index 00000000..5fbf1c86 --- /dev/null +++ b/frontend/src/components/StaticViews/TermsView.vue @@ -0,0 +1,17 @@ + diff --git a/frontend/src/components/__tests__/StaticViews/AboutView.spec.ts b/frontend/src/components/__tests__/StaticViews/AboutView.spec.ts new file mode 100644 index 00000000..884957e1 --- /dev/null +++ b/frontend/src/components/__tests__/StaticViews/AboutView.spec.ts @@ -0,0 +1,24 @@ +import { describe, expect, it } from 'vitest' + +import AboutView from '@/components/StaticViews/AboutView.vue' +import { setupMountedComponents } from '@/lib/test-utils' + +describe.concurrent('AboutView', async () => { + it('renders the main content', async () => { + const { wrapper } = await setupMountedComponents( + { component: AboutView, template: true }, + { + initialStoreState: { + misc: { + appVersion: 'v0.0.0' + } + } + } + ) + + expect(wrapper.html()).toMatch('REEV Explains and Evaluates Variants') + // Acknowledgements + expect(wrapper.html()).toMatch('ClinVar is a freely accessible, public archive') + expect(wrapper.html()).toMatch('Coral emoji from OpenMoji') + }) +}) diff --git a/frontend/src/views/__tests__/ContactView.spec.ts b/frontend/src/components/__tests__/StaticViews/ContactView.spec.ts similarity index 51% rename from frontend/src/views/__tests__/ContactView.spec.ts rename to frontend/src/components/__tests__/StaticViews/ContactView.spec.ts index 011e1fcf..a80fd7dc 100644 --- a/frontend/src/views/__tests__/ContactView.spec.ts +++ b/frontend/src/components/__tests__/StaticViews/ContactView.spec.ts @@ -1,29 +1,9 @@ import { describe, expect, it } from 'vitest' -import { VMenu } from 'vuetify/components' +import ContactView from '@/components/StaticViews/ContactView.vue' import { setupMountedComponents } from '@/lib/test-utils' -import ContactView from '../ContactView.vue' - describe.concurrent('ContactView', async () => { - it('renders the header', async () => { - const { wrapper } = await setupMountedComponents( - { component: ContactView, template: true }, - { - initialStoreState: { - misc: { - appVersion: 'v0.0.0' - } - } - } - ) - - const logo = wrapper.find('#logo') - const menu = wrapper.findComponent(VMenu) - expect(logo.exists()).toBe(true) - expect(menu.exists()).toBe(true) - }) - it('renders the main content', async () => { const { wrapper } = await setupMountedComponents( { component: ContactView, template: true }, @@ -36,11 +16,9 @@ describe.concurrent('ContactView', async () => { } ) - const mainContent = wrapper.find('.contact-view') const githubLink = wrapper.find('.mdi-github') const emailLink = wrapper.find('.mdi-email') - expect(mainContent.exists()).toBe(true) - expect(mainContent.html()).toMatch( + expect(wrapper.html()).toMatch( 'Feel free to reach out to us through any of the following channels:' ) expect(githubLink.exists()).toBe(true) diff --git a/frontend/src/views/__tests__/PrivacyView.spec.ts b/frontend/src/components/__tests__/StaticViews/PrivacyView.spec.ts similarity index 60% rename from frontend/src/views/__tests__/PrivacyView.spec.ts rename to frontend/src/components/__tests__/StaticViews/PrivacyView.spec.ts index 381feb40..9a60c2b3 100644 --- a/frontend/src/views/__tests__/PrivacyView.spec.ts +++ b/frontend/src/components/__tests__/StaticViews/PrivacyView.spec.ts @@ -1,26 +1,9 @@ import { describe, expect, it } from 'vitest' -import HeaderDefault from '@/components/HeaderDefault.vue' +import PrivacyView from '@/components/StaticViews/PrivacyView.vue' import { setupMountedComponents } from '@/lib/test-utils' -import PrivacyView from '@/views/PrivacyView.vue' describe.concurrent('PrivacyView', async () => { - it('renders the header', async () => { - const { wrapper } = await setupMountedComponents( - { component: PrivacyView, template: true }, - { - initialStoreState: { - misc: { - appVersion: 'v0.0.0' - } - } - } - ) - - const header = wrapper.findComponent(HeaderDefault) - expect(header.exists()).toBe(true) - }) - it('renders the privacy policy link', async () => { const { wrapper } = await setupMountedComponents( { component: PrivacyView, template: true }, @@ -50,8 +33,7 @@ describe.concurrent('PrivacyView', async () => { } ) - const mainContent = wrapper.find('.privacy-view') - expect(mainContent.exists()).toBe(true) - expect(mainContent.text()).toMatch('Privacy Policy') + expect(wrapper.exists()).toBe(true) + expect(wrapper.text()).toMatch('Privacy Policy') }) }) diff --git a/frontend/src/components/__tests__/StaticViews/TermsView.spec.ts b/frontend/src/components/__tests__/StaticViews/TermsView.spec.ts new file mode 100644 index 00000000..e533a06d --- /dev/null +++ b/frontend/src/components/__tests__/StaticViews/TermsView.spec.ts @@ -0,0 +1,24 @@ +import { describe, expect, it } from 'vitest' + +import TermsView from '@/components/StaticViews/TermsView.vue' +import { setupMountedComponents } from '@/lib/test-utils' + +describe.concurrent('TermsView', async () => { + it('renders the terms of use content', async () => { + const { wrapper } = await setupMountedComponents( + { component: TermsView, template: true }, + { + initialStoreState: { + misc: { + appVersion: 'v0.0.0' + } + } + } + ) + + expect(wrapper.text()).toContain('REEV is for research use only software') + expect(wrapper.text()).toContain( + 'The software is provided "as is," without warranty of any kind' + ) + }) +}) diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index 1ead776a..1a6e1cfe 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -3,18 +3,15 @@ import { createRouter, createWebHistory } from 'vue-router' import ACMGCriteriaDocs from '@/views/ACMGCriteriaDocs.vue' import ACMGSVDocs from '@/views/ACMGSVDocs.vue' -import AboutView from '@/views/AboutView.vue' -import ContactView from '@/views/ContactView.vue' import GeneDetailView from '@/views/GeneDetailView.vue' import GenesListView from '@/views/GenesListView.vue' import HomeView from '@/views/HomeView.vue' import LoginView from '@/views/LoginView.vue' import PathNotFound from '@/views/PathNotFound.vue' -import PrivacyView from '@/views/PrivacyView.vue' import ProfileView from '@/views/ProfileView.vue' import SeqvarDetailsView from '@/views/SeqvarDetailsView.vue' +import StaticView from '@/views/StaticView.vue' import StrucvarDetailsView from '@/views/StrucvarDetailsView.vue' -import TermsView from '@/views/TermsView.vue' import VerifyEmailView from '@/views/VerifyEmailView.vue' const routes = [ @@ -23,26 +20,11 @@ const routes = [ name: 'home', component: HomeView }, - { - path: '/about', - name: 'about', - component: AboutView - }, { path: '/login', name: 'login', component: LoginView }, - { - path: '/privacy', - name: 'privacy', - component: PrivacyView - }, - { - path: '/terms', - name: 'terms', - component: TermsView - }, { path: '/profile', name: 'profile', @@ -54,9 +36,9 @@ const routes = [ component: VerifyEmailView }, { - path: '/contact', - name: 'contact', - component: ContactView + path: '/info', + name: 'static-info', + component: StaticView }, { path: '/gene/:searchTerm/:genomeRelease', diff --git a/frontend/src/views/AboutView.vue b/frontend/src/views/AboutView.vue deleted file mode 100644 index e1008a25..00000000 --- a/frontend/src/views/AboutView.vue +++ /dev/null @@ -1,137 +0,0 @@ - - - - - diff --git a/frontend/src/views/ContactView.vue b/frontend/src/views/ContactView.vue deleted file mode 100644 index 260f86b0..00000000 --- a/frontend/src/views/ContactView.vue +++ /dev/null @@ -1,62 +0,0 @@ - - - - - diff --git a/frontend/src/views/PrivacyView.vue b/frontend/src/views/PrivacyView.vue deleted file mode 100644 index 7b7d3462..00000000 --- a/frontend/src/views/PrivacyView.vue +++ /dev/null @@ -1,39 +0,0 @@ - - - - - diff --git a/frontend/src/views/ProfileView.vue b/frontend/src/views/ProfileView.vue index e9088419..ebf131a5 100644 --- a/frontend/src/views/ProfileView.vue +++ b/frontend/src/views/ProfileView.vue @@ -124,10 +124,3 @@ watch(() => route.hash, scrollToSection) - - diff --git a/frontend/src/views/StaticView.vue b/frontend/src/views/StaticView.vue new file mode 100644 index 00000000..ffc62765 --- /dev/null +++ b/frontend/src/views/StaticView.vue @@ -0,0 +1,86 @@ + + + diff --git a/frontend/src/views/TermsView.vue b/frontend/src/views/TermsView.vue deleted file mode 100644 index 3775a6dc..00000000 --- a/frontend/src/views/TermsView.vue +++ /dev/null @@ -1,42 +0,0 @@ - - - - - diff --git a/frontend/src/views/__tests__/AboutView.spec.ts b/frontend/src/views/__tests__/AboutView.spec.ts deleted file mode 100644 index 7945093a..00000000 --- a/frontend/src/views/__tests__/AboutView.spec.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { VMenu } from 'vuetify/components' - -import { setupMountedComponents } from '@/lib/test-utils' - -import AboutView from '../AboutView.vue' - -describe.concurrent('AboutView', async () => { - it('renders the header', async () => { - const { wrapper } = await setupMountedComponents( - { component: AboutView, template: true }, - { - initialStoreState: { - misc: { - appVersion: 'v0.0.0' - } - } - } - ) - - const logo = wrapper.find('#logo') - const menu = wrapper.findComponent(VMenu) - expect(logo.exists()).toBe(true) - expect(menu.exists()).toBe(true) - }) - - it('renders the main content', async () => { - const { wrapper } = await setupMountedComponents( - { component: AboutView, template: true }, - { - initialStoreState: { - misc: { - appVersion: 'v0.0.0' - } - } - } - ) - - const mainContent = wrapper.find('.about-view') - expect(mainContent.exists()).toBe(true) - expect(mainContent.html()).toMatch('REEV Explains and Evaluates Variants') - // Acknowledgements - expect(mainContent.html()).toMatch('ClinVar is a freely accessible, public archive') - expect(mainContent.html()).toMatch('Coral emoji from OpenMoji') - }) -}) diff --git a/frontend/src/views/__tests__/StaticView.spec.ts b/frontend/src/views/__tests__/StaticView.spec.ts new file mode 100644 index 00000000..84c43a47 --- /dev/null +++ b/frontend/src/views/__tests__/StaticView.spec.ts @@ -0,0 +1,21 @@ +import { describe, expect, it } from 'vitest' + +import HeaderDefault from '@/components/HeaderDefault.vue' +import { setupMountedComponents } from '@/lib/test-utils' +import StaticView from '@/views/StaticView.vue' + +describe.concurrent('StaticView', async () => { + it('renders the about page', async () => { + const { wrapper } = await setupMountedComponents({ component: StaticView, template: true }) + + expect(wrapper.exists()).toBe(true) + expect(wrapper.text()).toMatch('About REEV') + }) + + it('renders the header', async () => { + const { wrapper } = await setupMountedComponents({ component: StaticView, template: true }) + + const header = wrapper.findComponent(HeaderDefault) + expect(header.exists()).toBe(true) + }) +}) diff --git a/frontend/src/views/__tests__/TermsVies.spec.ts b/frontend/src/views/__tests__/TermsVies.spec.ts deleted file mode 100644 index 68895837..00000000 --- a/frontend/src/views/__tests__/TermsVies.spec.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { describe, expect, it } from 'vitest' - -import HeaderDefault from '@/components/HeaderDefault.vue' -import { setupMountedComponents } from '@/lib/test-utils' -import TermsView from '@/views/TermsView.vue' - -describe.concurrent('TermsView', async () => { - it('renders the header', async () => { - const { wrapper } = await setupMountedComponents( - { component: TermsView, template: true }, - { - initialStoreState: { - misc: { - appVersion: 'v0.0.0' - } - } - } - ) - - const header = wrapper.findComponent(HeaderDefault) - expect(header.exists()).toBe(true) - }) - - it('renders the terms of use content', async () => { - const { wrapper } = await setupMountedComponents( - { component: TermsView, template: true }, - { - initialStoreState: { - misc: { - appVersion: 'v0.0.0' - } - } - } - ) - - const termsContent = wrapper.find('.terms-view') - expect(termsContent.exists()).toBe(true) - expect(termsContent.text()).toContain('REEV is for research use only software') - expect(termsContent.text()).toContain( - 'The software is provided "as is," without warranty of any kind' - ) - }) -})