Skip to content

Commit 730d6aa

Browse files
committed
test: pin the badge defaults and sweep every equality field from review
Add the four badge fields to the clone-defaults contract and convert the single-field equality check into an it.each sweep over the independent comparisons (sort, badge, action, theme, and TTL fields). https://claude.ai/code/session_01XNtnkLbBiXZxfQQYLMpucB
1 parent fb25e85 commit 730d6aa

1 file changed

Lines changed: 30 additions & 20 deletions

File tree

test/dashboard-settings-data.test.ts

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ describe("cloneDashboardSettingsData", () => {
5555
menuSortQuickSwitchVisibleRow: true,
5656
uiThemePreset: "green",
5757
uiAccentColor: "green",
58+
menuShowStatusBadge: true,
59+
menuShowCurrentBadge: true,
60+
menuShowLastUsed: true,
5861
menuShowQuotaSummary: true,
62+
menuShowQuotaCooldown: true,
5963
menuShowFetchStatus: true,
6064
menuQuotaTtlMs: 5 * 60_000,
6165
menuFocusStyle: "row-invert",
@@ -122,27 +126,33 @@ describe("dashboardSettingsDataEqual", () => {
122126
).toBe(true);
123127
});
124128

125-
it("detects a difference in any single field", () => {
129+
it.each([
130+
["menuQuotaTtlMs", { menuQuotaTtlMs: 60_000 }],
131+
["uiThemePreset", { uiThemePreset: "mono" }],
132+
["uiAccentColor", { uiAccentColor: "cyan" }],
133+
["showQuotaDetails", { showQuotaDetails: false }],
134+
["showPerAccountRows", { showPerAccountRows: false }],
135+
["actionAutoReturnMs", { actionAutoReturnMs: 500 }],
136+
["actionPauseOnKey", { actionPauseOnKey: false }],
137+
["menuAutoFetchLimits", { menuAutoFetchLimits: false }],
138+
["menuSortEnabled", { menuSortEnabled: false }],
139+
["menuSortPinCurrent", { menuSortPinCurrent: true }],
140+
[
141+
"menuSortQuickSwitchVisibleRow",
142+
{ menuSortQuickSwitchVisibleRow: false },
143+
],
144+
["menuShowStatusBadge", { menuShowStatusBadge: false }],
145+
["menuShowCurrentBadge", { menuShowCurrentBadge: false }],
146+
["menuShowLastUsed", { menuShowLastUsed: false }],
147+
["menuShowQuotaSummary", { menuShowQuotaSummary: false }],
148+
["menuShowQuotaCooldown", { menuShowQuotaCooldown: false }],
149+
["menuShowFetchStatus", { menuShowFetchStatus: false }],
150+
["menuHighlightCurrentRow", { menuHighlightCurrentRow: false }],
151+
] as const satisfies ReadonlyArray<
152+
readonly [string, Partial<DashboardDisplaySettings>]
153+
>)("detects a difference in %s alone", (_field, override) => {
126154
expect(
127-
dashboardSettingsDataEqual(
128-
settings(),
129-
settings({ menuQuotaTtlMs: 60_000 }),
130-
deps,
131-
),
132-
).toBe(false);
133-
expect(
134-
dashboardSettingsDataEqual(
135-
settings(),
136-
settings({ uiThemePreset: "mono" }),
137-
deps,
138-
),
139-
).toBe(false);
140-
expect(
141-
dashboardSettingsDataEqual(
142-
settings(),
143-
settings({ showQuotaDetails: false }),
144-
deps,
145-
),
155+
dashboardSettingsDataEqual(settings(), settings(override), deps),
146156
).toBe(false);
147157
});
148158

0 commit comments

Comments
 (0)