|
9 | 9 | renderError, |
10 | 10 | wrapTextMultiline, |
11 | 11 | } from "../src/common/utils.js"; |
12 | | -import { getCardColors } from "../src/common/color.js"; |
13 | 12 |
|
14 | 13 | describe("Test utils.js", () => { |
15 | 14 | it("should test kFormatter default behavior", () => { |
@@ -103,78 +102,6 @@ describe("Test utils.js", () => { |
103 | 102 | ).toHaveTextContent(/Secondary Message/gim); |
104 | 103 | }); |
105 | 104 |
|
106 | | - it("getCardColors: should return expected values", () => { |
107 | | - let colors = getCardColors({ |
108 | | - title_color: "f00", |
109 | | - text_color: "0f0", |
110 | | - ring_color: "0000ff", |
111 | | - icon_color: "00f", |
112 | | - bg_color: "fff", |
113 | | - border_color: "fff", |
114 | | - theme: "dark", |
115 | | - }); |
116 | | - expect(colors).toStrictEqual({ |
117 | | - titleColor: "#f00", |
118 | | - textColor: "#0f0", |
119 | | - iconColor: "#00f", |
120 | | - ringColor: "#0000ff", |
121 | | - bgColor: "#fff", |
122 | | - borderColor: "#fff", |
123 | | - }); |
124 | | - }); |
125 | | - |
126 | | - it("getCardColors: should fallback to default colors if color is invalid", () => { |
127 | | - let colors = getCardColors({ |
128 | | - title_color: "invalidcolor", |
129 | | - text_color: "0f0", |
130 | | - icon_color: "00f", |
131 | | - bg_color: "fff", |
132 | | - border_color: "invalidColor", |
133 | | - theme: "dark", |
134 | | - }); |
135 | | - expect(colors).toStrictEqual({ |
136 | | - titleColor: "#2f80ed", |
137 | | - textColor: "#0f0", |
138 | | - iconColor: "#00f", |
139 | | - ringColor: "#2f80ed", |
140 | | - bgColor: "#fff", |
141 | | - borderColor: "#e4e2e2", |
142 | | - }); |
143 | | - }); |
144 | | - |
145 | | - it("getCardColors: should fallback to specified theme colors if is not defined", () => { |
146 | | - let colors = getCardColors({ |
147 | | - theme: "dark", |
148 | | - }); |
149 | | - expect(colors).toStrictEqual({ |
150 | | - titleColor: "#fff", |
151 | | - textColor: "#9f9f9f", |
152 | | - ringColor: "#fff", |
153 | | - iconColor: "#79ff97", |
154 | | - bgColor: "#151515", |
155 | | - borderColor: "#e4e2e2", |
156 | | - }); |
157 | | - }); |
158 | | - |
159 | | - it("getCardColors: should return ring color equal to title color if not ring color is defined", () => { |
160 | | - let colors = getCardColors({ |
161 | | - title_color: "f00", |
162 | | - text_color: "0f0", |
163 | | - icon_color: "00f", |
164 | | - bg_color: "fff", |
165 | | - border_color: "fff", |
166 | | - theme: "dark", |
167 | | - }); |
168 | | - expect(colors).toStrictEqual({ |
169 | | - titleColor: "#f00", |
170 | | - textColor: "#0f0", |
171 | | - iconColor: "#00f", |
172 | | - ringColor: "#f00", |
173 | | - bgColor: "#fff", |
174 | | - borderColor: "#fff", |
175 | | - }); |
176 | | - }); |
177 | | - |
178 | 105 | it("formatBytes: should return expected values", () => { |
179 | 106 | expect(formatBytes(0)).toBe("0 B"); |
180 | 107 | expect(formatBytes(100)).toBe("100.0 B"); |
|
0 commit comments