diff --git a/vizro-core/tests/unit/vizro/models/test_dashboard.py b/vizro-core/tests/unit/vizro/models/test_dashboard.py index cc0de7500..3aa09ce0b 100644 --- a/vizro-core/tests/unit/vizro/models/test_dashboard.py +++ b/vizro-core/tests/unit/vizro/models/test_dashboard.py @@ -136,18 +136,20 @@ def test_page_registry_with_description(self, vizro_app, mocker): "image_path", ["app.png", "app.svg", "images/app.png", "images/app.svg", "logo.png", "logo.svg"] ) def test_page_registry_with_image(self, page_1, mocker, tmp_path, image_filename): - Path(tmp_path / "folder").mkdir() + if image_path.parent != Path("."): + Path(tmp_path / image_path.parent).mkdir() Path(tmp_path / image_filename).touch() - vizro.Vizro(assets_folder=tmp_path) + # at top of file: from vizro import 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() + vm.Dashboard(pages=[page_1]).pre_build() mock_register_page.assert_any_call( module=page_1.id, name="Page 1", description="", image=image_filename, - title="My dashboard: Page 1", + title="Page 1", path="/", order=0, layout=mocker.ANY, # partial call is tricky to mock out so we ignore it. @@ -158,7 +160,7 @@ def test_page_registry_with_images(self, page_1, mocker, tmp_path): 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() + vm.Dashboard(pages=[page_1]).pre_build() mock_register_page.assert_any_call( module=page_1.id,