Skip to content

Commit

Permalink
chore: Lint JS and update fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Nov 7, 2024
1 parent ac23184 commit 3d8455a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions data_registry/templates/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@
})

document.querySelectorAll('a[download]').forEach(trackable => {
trackable.addEventListener('click', event => {
fathom.trackEvent(`download ${trackable.dataset.event}`)
})
trackable.addEventListener('click', event => {
fathom.trackEvent(`download ${trackable.dataset.event}`) // eslint-disable-line no-undef
})
})
</script>
{% endblock %}
Expand Down
2 changes: 1 addition & 1 deletion data_registry/templates/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
div.addEventListener('click', event => {
// Stop "See details" from triggering a second event.
event.preventDefault()
open(div.querySelector('.click').href, event.ctrlKey || event.metaKey || event.shiftKey ? '_blank' : '_self')
window.open(div.querySelector('.click').href, event.ctrlKey || event.metaKey || event.shiftKey ? '_blank' : '_self')
})
})

Expand Down
4 changes: 3 additions & 1 deletion tests/data_registry/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ def test_detail(self, get_files):
response = Client().get(f"/en/publication/{self.collection1.id}")

self.assertTemplateUsed("detail.html")
self.assertContains(response, f"""<a href="{url}" rel="nofollow" download>2022</a>""", html=True)
self.assertContains(
response, f"""<a href="{url}" rel="nofollow" data-event="jsonl.gz year" download>2022</a>""", html=True
)

def test_collection_not_found(self):
with self.assertNumQueries(1):
Expand Down

0 comments on commit 3d8455a

Please sign in to comment.