Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
gromdimon committed Aug 29, 2023
1 parent 7bdd23e commit f6002f7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions frontend/src/components/__tests__/SearchBar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,8 @@ describe('SearchBar.vue', () => {
const searchButton = wrapper.find('#search') as any
expect(searchButton.exists()).toBe(true)
await searchButton.trigger('click')
await searchButton.trigger('click')
expect(wrapper.emitted()).toHaveProperty('click')
expect(wrapper.emitted('click')).toHaveLength(2)
})
})
13 changes: 12 additions & 1 deletion frontend/src/views/GeneDetailView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,23 @@ const loadDataToStore = async () => {
// When the component is mounted or the search term is changed through
// the router then we need to fetch the gene information from the backend
// through the store.
onMounted(loadDataToStore)
watch(() => props.searchTerm, loadDataToStore)
watch(() => route.hash, scrollToSection)
// If geneInfoStore.storeState is StoreState.Error then redirect to the
// home page.
watch(
() => geneInfoStore.storeState,
(storeState) => {

Check warning on line 46 in frontend/src/views/GeneDetailView.vue

View check run for this annotation

Codecov / codecov/patch

frontend/src/views/GeneDetailView.vue#L46

Added line #L46 was not covered by tests
if (storeState == StoreState.Error) {
geneInfoStore.clearData()
router.push({ name: 'home' })

Check warning on line 49 in frontend/src/views/GeneDetailView.vue

View check run for this annotation

Codecov / codecov/patch

frontend/src/views/GeneDetailView.vue#L48-L49

Added lines #L48 - L49 were not covered by tests
}
}
)
const SECTIONS = [
{ id: 'hgnc', title: 'HGNC' },
{ id: 'constraints-scores', title: 'Constraints / Scores' },
Expand Down

0 comments on commit f6002f7

Please sign in to comment.