Skip to content

Commit e398b67

Browse files
test(webview): make the provider-filter assertion bite in both seeding rows
CodeRabbit's point measured rather than argued. The two it.each rows share the store order ["Zoo Gateway", "Other", "Zoo Gateway 2"], so only one of them can ever fail expect(...).not.toContain("Other"): with the stale profile first the every-profile loop breaks before it reaches the non-gateway profile, so that row cannot observe the filter at all. Mutants run against 27a2836, production untouched (blob 8a5977a, restored by content hash after each): - drop the provider filter in ensureZooGatewayProfileSeeded: fixture as shipped -> 1 of the 2 rows fails (expected [ 'Zoo Gateway', 'Other', ...1 ] to not include 'Other'); with "Other" leading the store -> both rows fail. The assertion goes from one-row to two-row coverage. - check only the first gateway profile (the bug the comment describes): 1 row fails on the handleZooCodeCallback assertion, before and after the reorder, so the reorder does not weaken the detection this fixture pair exists for. - no mutant: 397 tests in the file pass. Test-only: the store order of the two rows moves and the comment records why "Other" leads. No assertion was added, weakened or deleted - nothing deleted here, duplicate or coverage - so the number a maintainer needs is 0 deleted-duplicate, 0 deleted-coverage, 1 assertion made load-bearing in a second row. Gates: prettier --check, tsc --noEmit -p . and eslint --max-warnings=0 clean; vitest core/webview + core.config suites 44 files / 1304 tests green.
1 parent 27a2836 commit e398b67

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

‎src/core/webview/__tests__/ClineProvider.spec.ts‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10006,19 +10006,20 @@ describe("ClineProvider - Comprehensive Edit/Delete Edge Cases", () => {
1000610006

1000710007
expect(handleSpy).toHaveBeenCalledWith("current-token")
1000810008
})
10009-
// The up-to-date guard reads every zoo-gateway profile rather than one end of the list, and it
10010-
// skips profiles that belong to another provider. With a single profile in the store a
10011-
// first-only, a last-only and an every-profile check all behave the same, so the order of the
10012-
// two rows below is what pins the guard down.
10009+
// The up-to-date guard reads every zoo-gateway profile rather than one end of the list, and
10010+
// it skips profiles that belong to another provider. With a single profile in the store a
10011+
// first-only, a last-only and an every-profile check all behave the same, so the order of
10012+
// the two rows below is what pins the guard down. "Other" leads the store in both rows so
10013+
// that a guard which stopped filtering by provider is caught by either row, not by one.
1001310014
it.each([
1001410015
{
1001510016
title: "re-seeds when a later zoo-gateway profile is stale and the first is current",
10016-
profiles: ["Zoo Gateway", "Other", "Zoo Gateway 2"],
10017+
profiles: ["Other", "Zoo Gateway", "Zoo Gateway 2"],
1001710018
staleProfile: "Zoo Gateway 2",
1001810019
},
1001910020
{
1002010021
title: "re-seeds when the first zoo-gateway profile is stale and the last is current",
10021-
profiles: ["Zoo Gateway", "Other", "Zoo Gateway 2"],
10022+
profiles: ["Other", "Zoo Gateway", "Zoo Gateway 2"],
1002210023
staleProfile: "Zoo Gateway",
1002310024
},
1002410025
])("$title", async ({ profiles, staleProfile }) => {

0 commit comments

Comments
 (0)