Skip to content
Snippets Groups Projects
Unverified Commit 2e16e356 authored by Mahatthana (Kelvin) Nomsawadi's avatar Mahatthana (Kelvin) Nomsawadi Committed by GitHub
Browse files

Add test to cover #16151 (#33431)

parent d56dd469
Branches
Tags
No related merge requests found
......@@ -18,6 +18,7 @@ import {
createSampleDatabase,
ORDERS,
PEOPLE,
REVIEWS,
} from "metabase-types/api/mocks/presets";
import {
createMockQueryBuilderState,
......@@ -169,6 +170,25 @@ describe("TagEditorParam", () => {
});
});
it("should default to number/= for a new reviews->rating field filter (metabase#16151)", async () => {
const tag = createMockTemplateTag({
type: "dimension",
dimension: undefined,
"widget-type": undefined,
});
const { setTemplateTag } = setup({ tag });
userEvent.click(await screen.findByText("Reviews"));
userEvent.click(await screen.findByText("Rating"));
expect(setTemplateTag).toHaveBeenCalledWith({
...tag,
dimension: ["field", REVIEWS.RATING, null],
"widget-type": "number/=",
options: undefined,
});
});
it("should allow to change the field for a field filter", async () => {
const tag = createMockTemplateTag({
type: "dimension",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment