Skip to content

Commit

Permalink
Fix unit tests and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
huong-li-nguyen committed Dec 2, 2024
1 parent 6409548 commit 6781c72
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!--
A new scriv changelog fragment.
Uncomment the section that is right (remove the HTML comment wrapper).
-->

<!--
### Highlights ✨
- A bullet item for the Highlights ✨ category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Removed
- A bullet item for the Removed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Added
- A bullet item for the Added category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Changed
- A bullet item for the Changed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Deprecated
- A bullet item for the Deprecated category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Fixed
- A bullet item for the Fixed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
<!--
### Security
- A bullet item for the Security category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX. ([#1](https://github.com/mckinsey/vizro/pull/1))
-->
35 changes: 10 additions & 25 deletions vizro-core/tests/unit/vizro/models/test_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,35 +243,20 @@ def test_make_page_404_layout(self, page_1, vizro_app):
# vizro_app fixture is needed to avoid mocking out get_relative_path.
expected = html.Div(
[
html.Div(
children=dbc.Switch(
id="theme-selector",
value=False,
persistence=True,
persistence_type="session",
),
id="settings",
dbc.Switch(
id="theme-selector",
value=False,
persistence=True,
persistence_type="session",
),
html.Img(),
html.Div(
[
html.Div(
[
html.H3("This page could not be found.", className="heading-3-600"),
html.P("Make sure the URL you entered is correct."),
],
className="error-text-container",
),
dbc.Button("Take me home", href="/"),
],
className="error-content-container",
),
html.H3("This page could not be found."),
html.P("Make sure the URL you entered is correct."),
dbc.Button(children="Take me home", href="/", className="mt-4"),
],
className="page-error-container",
className="d-flex flex-column align-items-center justify-content-center min-vh-100",
)

# Strip out src since it's too long to be worth comparing and just comes directly
# from reading a file.
# Strip out src since it's too long to be worth comparing and just comes directly from reading a file.
assert_component_equal(vm.Dashboard(pages=[page_1])._make_page_404_layout(), expected, keys_to_strip={"src"})


Expand Down

0 comments on commit 6781c72

Please sign in to comment.