-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Embedded dashboard parameters parse runtime error #41545
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,16 @@ describe("PublicDashboard", () => { | |
|
||
expect(firstTab).toHaveAttribute("aria-selected", "true"); | ||
}); | ||
|
||
it("should render when a filter passed with value starting from '0' (metabase#41483)", async () => { | ||
// note: as all slugs this is ignored and we only use the id | ||
await setup({ | ||
queryString: "?my-filter-value=01", | ||
}); | ||
|
||
// should not throw runtime error and render dashboard content | ||
expect(screen.getByText(DASHBOARD_TITLE)).toBeInTheDocument(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test only verifies that the dashboard is rendered not crashed. But it doesn't assert that the filter value is retained. I've tried a few iterations to make this unit test work by passing At first I thought this code wasn't fixing the issue because there's also no filter value assertion in the test. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the behaviour customers expect is that the filter will have value 1, should we make an expect on that too? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
}); | ||
}); | ||
|
||
async function setup({ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you use
text
as it's already existing?Then we should be able to query the widget value like so