Skip to content

Commit

Permalink
fix: classic template did not pass base_url to macro
Browse files Browse the repository at this point in the history
Fixes #734
  • Loading branch information
maartenbreddels committed Oct 19, 2020
1 parent b003a7f commit 6bcc277
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion share/jupyter/voila/templates/classic/index.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@
{% endblock body_header %}

{% block footer_js %}
{{ voila_setup() }}
{{ voila_setup(resources.base_url, resources.nbextensions) }}
{% endblock footer_js %}

19 changes: 19 additions & 0 deletions tests/app/template_sanity_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# tests basic things the templates should have
import pytest

import os

BASE_DIR = os.path.dirname(__file__)


@pytest.fixture(params=['lab', 'classic'])
def voila_args_extra(request):
return [f'--template={request.param}']


async def test_lists_extension(http_server_client, base_url, voila_app):
response = await http_server_client.fetch(base_url)
assert response.code == 200
html_text = response.body.decode('utf-8')
assert f'/voila/templates/{voila_app.voila_configuration.template}/static/voila.js' in html_text
assert '/voila/static/require.min.js' in html_text

0 comments on commit 6bcc277

Please sign in to comment.