Skip to content

Commit

Permalink
added test_page_registry_with_images
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnMarieW committed Dec 20, 2023
1 parent fd75cbb commit 9a279cb
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions vizro-core/tests/unit/vizro/models/test_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,24 @@ def test_page_registry_with_image(self, page_1, mocker, tmp_path, image_filename
layout=mocker.ANY, # partial call is tricky to mock out so we ignore it.
)

def test_page_registry_with_images(self, page_1, mocker, tmp_path):
Path(tmp_path / "app.svg").touch()
Path(tmp_path / "logo.svg").touch()
vizro.Vizro(assets_folder=tmp_path)
mock_register_page = mocker.patch("dash.register_page", autospec=True)
vm.Dashboard(pages=[page_1], title="My dashboard").pre_build()

mock_register_page.assert_any_call(
module=page_1.id,
name="Page 1",
description="",
image="app.svg",
title="My dashboard: Page 1",
path="/",
order=0,
layout=mocker.ANY, # partial call is tricky to mock out so we ignore it.
)

def test_make_page_404_layout(self, vizro_app):
# vizro_app fixture is needed to avoid mocking out get_relative_path.
expected = html.Div(
Expand Down

0 comments on commit 9a279cb

Please sign in to comment.