The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
Convert formatting colors test to ts (#71425)
Ryan Laurie1fd62fa69895
diff --git a/frontend/src/metabase/ui/colors/formatting-colors.ts b/frontend/src/metabase/ui/colors/formatting-colors.tsindex 2b8a070c272..52ce4e961a1 100644--- a/frontend/src/metabase/ui/colors/formatting-colors.ts+++ b/frontend/src/metabase/ui/colors/formatting-colors.ts@@ -2,7 +2,7 @@ import { color } from "./palette";export function assignUserColors(userIds: string[],- currentUserId: string,+ currentUserId: string | null,colors = [color("brand"),color("accent2"),diff --git a/frontend/src/metabase/ui/colors/formatting-colors.unit.spec.js b/frontend/src/metabase/ui/colors/formatting-colors.unit.spec.tssimilarity index 71%rename from frontend/src/metabase/ui/colors/formatting-colors.unit.spec.jsrename to frontend/src/metabase/ui/colors/formatting-colors.unit.spec.tsindex b19e9350bb4..fa4075bda74 100644--- a/frontend/src/metabase/ui/colors/formatting-colors.unit.spec.js+++ b/frontend/src/metabase/ui/colors/formatting-colors.unit.spec.ts@@ -3,30 +3,30 @@ import { color } from "./palette";describe("lib/formatting/colors", () => {it("should assign colors to users when currentUserId is passed", () => {- const userIds = [1, 2, 3];- const currentUserId = 1;+ const userIds = ["1", "2", "3"];+ const currentUserId = "1";const userColors = assignUserColors(userIds, currentUserId);const expectedAssignedColors = {- 1: color("brand"),- 2: color("accent2"),- 3: color("error"),+ "1": color("brand"),+ "2": color("accent2"),+ "3": color("error"),};expect(userColors).toMatchObject(expectedAssignedColors);});it("should assign colors to users when currentUserId is null", () => {- const userIds = [1, 2, 3];+ const userIds = ["1", "2", "3"];const currentUserId = null;const userColors = assignUserColors(userIds, currentUserId);const expectedAssignedColors = {- 1: color("accent2"),- 2: color("error"),- 3: color("accent1"),+ "1": color("accent2"),+ "2": color("error"),+ "3": color("accent1"),};expect(userColors).toMatchObject(expectedAssignedColors);