Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gromdimon committed Oct 18, 2023
1 parent 8b21a51 commit b69e8ff
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 12 deletions.
8 changes: 6 additions & 2 deletions frontend/src/components/__tests__/HeaderDefault.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { describe, expect, it } from 'vitest'
import { nextTick } from 'vue'
import { VMenu } from 'vuetify/components'

import { setupMountedComponents } from '@/lib/test-utils'

Expand All @@ -23,7 +25,7 @@ describe.concurrent('HeaderDefault.vue', () => {
expect(title.text()).toBe('REEV: Explanation and Evaluation of Variants')
})

it('renders the navigation links', () => {
it('renders the navigation links', async () => {
const { wrapper } = setupMountedComponents(
{ component: HeaderDefault, template: true },
{
Expand All @@ -35,7 +37,9 @@ describe.concurrent('HeaderDefault.vue', () => {
}
)

const menu = wrapper.find('#menu')
const menu = wrapper.findComponent(VMenu)
expect(menu.exists()).toBe(true)
await menu.trigger('click')
await nextTick()
})
})
3 changes: 2 additions & 1 deletion frontend/src/components/__tests__/HeaderDetailPage.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { afterEach, describe, expect, it, vi } from 'vitest'
import { nextTick } from 'vue'
import { VMenu } from 'vuetify/components'

import { DottyClient } from '@/api/dotty'
import SearchBar from '@/components/SearchBar.vue'
Expand Down Expand Up @@ -40,7 +41,7 @@ describe.concurrent('HeaderDetailPage', async () => {
store.geneInfo = JSON.parse(JSON.stringify(geneData.geneInfo))

const logo = wrapper.find('#logo')
const menu = wrapper.find('#menu')
const menu = wrapper.findComponent(VMenu)
expect(logo.exists()).toBe(true)
expect(menu.exists()).toBe(true)
})
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/views/__tests__/ACMGCriteriaDoc.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { describe, expect, it } from 'vitest'
import { VMenu } from 'vuetify/components'

import { setupMountedComponents } from '@/lib/test-utils'

Expand All @@ -18,7 +19,7 @@ describe.concurrent('ACMGCriteriaDocs', async () => {
)

const logo = wrapper.find('#logo')
const menu = wrapper.find('#menu')
const menu = wrapper.findComponent(VMenu)
expect(logo.exists()).toBe(true)
expect(menu.exists()).toBe(true)
})
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/views/__tests__/ACMGSVDocs.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { describe, expect, it } from 'vitest'
import { VMenu } from 'vuetify/components'

import { setupMountedComponents } from '@/lib/test-utils'

Expand All @@ -18,7 +19,7 @@ describe.concurrent('ACMGSVDocs', async () => {
)

const logo = wrapper.find('#logo')
const menu = wrapper.find('#menu')
const menu = wrapper.findComponent(VMenu)
expect(logo.exists()).toBe(true)
expect(menu.exists()).toBe(true)
})
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/views/__tests__/AboutView.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { describe, expect, it } from 'vitest'
import { VMenu } from 'vuetify/components'

import { setupMountedComponents } from '@/lib/test-utils'

Expand All @@ -18,7 +19,7 @@ describe.concurrent('AboutView', async () => {
)

const logo = wrapper.find('#logo')
const menu = wrapper.find('#menu')
const menu = wrapper.findComponent(VMenu)
expect(logo.exists()).toBe(true)
expect(menu.exists()).toBe(true)
})
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/views/__tests__/ContactView.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { describe, expect, it } from 'vitest'
import { VMenu } from 'vuetify/components'

import { setupMountedComponents } from '@/lib/test-utils'

Expand All @@ -18,7 +19,7 @@ describe.concurrent('ContactView', async () => {
)

const logo = wrapper.find('#logo')
const menu = wrapper.find('#menu')
const menu = wrapper.findComponent(VMenu)
expect(logo.exists()).toBe(true)
expect(menu.exists()).toBe(true)
})
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/views/__tests__/GeneDetailView.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createTestingPinia } from '@pinia/testing'
import { describe, expect, it, vi } from 'vitest'
import { nextTick } from 'vue'
import { VMenu } from 'vuetify/components'

import * as BRCA1geneInfo from '@/assets/__tests__/BRCA1GeneInfo.json'
import HeaderDetailPage from '@/components/HeaderDetailPage.vue'
Expand Down Expand Up @@ -55,7 +56,7 @@ describe.concurrent('GeneDetailView', async () => {
expect(searchBar.exists()).toBe(true)

const logo = wrapper.find('#logo')
const menu = wrapper.find('#menu')
const menu = wrapper.findComponent(VMenu)
expect(logo.exists()).toBe(true)
expect(menu.exists()).toBe(true)

Expand All @@ -72,7 +73,7 @@ describe.concurrent('GeneDetailView', async () => {
expect(searchBar.exists()).toBe(true)

const logo = wrapper.find('#logo')
const menu = wrapper.find('#menu')
const menu = wrapper.findComponent(VMenu)
expect(logo.exists()).toBe(true)
expect(menu.exists()).toBe(true)
})
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/views/__tests__/GenesListView.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createTestingPinia } from '@pinia/testing'
import { describe, expect, it, vi } from 'vitest'
import { nextTick } from 'vue'
import { VMenu } from 'vuetify/components'

import HeaderDetailPage from '@/components/HeaderDetailPage.vue'
import SearchBar from '@/components/SearchBar.vue'
Expand Down Expand Up @@ -68,7 +69,7 @@ describe.concurrent('GenesListView', async () => {
expect(searchBar.exists()).toBe(true)

const logo = wrapper.find('#logo')
const menu = wrapper.find('#menu')
const menu = wrapper.findComponent(VMenu)
expect(logo.exists()).toBe(true)
expect(menu.exists()).toBe(true)
})
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/views/__tests__/HomeView.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { afterEach, describe, expect, it, vi } from 'vitest'
import { nextTick } from 'vue'
import { VMenu } from 'vuetify/components'

import { DottyClient } from '@/api/dotty'
import FooterDefault from '@/components/FooterDefault.vue'
Expand Down Expand Up @@ -50,7 +51,7 @@ describe.concurrent('HomeView with mocked router', async () => {
expect(footer.exists()).toBe(true)

const logo = wrapper.find('#logo')
const menu = wrapper.find('#menu')
const menu = wrapper.findComponent(VMenu)
expect(logo.exists()).toBe(true)
expect(menu.exists()).toBe(true)
})
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/views/__tests__/VariantDetailView.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createTestingPinia } from '@pinia/testing'
import { describe, expect, it, vi } from 'vitest'
import { nextTick } from 'vue'
import { VMenu } from 'vuetify/components'

import * as BRCA1ClinVar from '@/assets/__tests__/BRCA1ClinVar.json'
import * as BRCA1GeneInfo from '@/assets/__tests__/BRCA1GeneInfo.json'
Expand Down Expand Up @@ -105,7 +106,7 @@ describe('VariantDetailView', async () => {
expect(searchBar.exists()).toBe(true)

const logo = wrapper.find('#logo')
const menu = wrapper.find('#menu')
const menu = wrapper.findComponent(VMenu)
expect(logo.exists()).toBe(true)
expect(menu.exists()).toBe(true)
})
Expand Down

0 comments on commit b69e8ff

Please sign in to comment.