Skip to content

Commit 3b63d23

Browse files
committed
test(mobile): cover alternate diff palette in both themes
1 parent c3568ce commit 3b63d23

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

‎apps/mobile/src/features/review/nativeReviewDiffAdapter.test.ts‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,30 @@ describe("getCachedNativeReviewDiffData", () => {
191191
});
192192

193193
describe("createNativeReviewDiffTheme", () => {
194+
it.each(["light", "dark"] as const)(
195+
"changes only diff colors for the blue-orange palette in %s mode",
196+
(appearance) => {
197+
const variables = appTheme("t3-code", appearance);
198+
const baseline = createNativeReviewDiffTheme(appearance, "t3-code", variables, "red-green");
199+
const alternate = createNativeReviewDiffTheme(
200+
appearance,
201+
"t3-code",
202+
variables,
203+
"blue-orange",
204+
);
205+
206+
expect(alternate).toEqual({
207+
...baseline,
208+
addBackground: appearance === "dark" ? "#142a45" : "#e7f0ff",
209+
deleteBackground: appearance === "dark" ? "#3e2718" : "#fff0e3",
210+
addBar: "#60a5fa",
211+
deleteBar: "#fb923c",
212+
addText: appearance === "dark" ? "#60a5fa" : "#2563eb",
213+
deleteText: appearance === "dark" ? "#fb923c" : "#c2410c",
214+
});
215+
},
216+
);
217+
194218
it("serializes every native color as cross-platform opaque hex", () => {
195219
for (const themeId of MOBILE_THEME_IDS) {
196220
for (const appearance of ["light", "dark"] as const) {

0 commit comments

Comments
 (0)