Skip to content

Commit dcdb06a

Browse files
committed
fixed tests
1 parent 9fa10da commit dcdb06a

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

src/lib/gitea.test.ts

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -309,17 +309,17 @@ describe("getGiteaRepoOwner - Organization Override Tests", () => {
309309
excludeOrgs: [],
310310
mirrorPublicOrgs: false,
311311
publicOrgs: [],
312-
skipStarredIssues: false
312+
skipStarredIssues: false,
313+
mirrorStrategy: "preserve"
313314
},
314315
giteaConfig: {
315316
defaultOwner: "giteauser",
316317
url: "https://gitea.example.com",
317318
token: "gitea-token",
318-
defaultOrg: "github-mirrors",
319+
organization: "github-mirrors",
319320
visibility: "public",
320321
starredReposOrg: "starred",
321-
preserveVisibility: false,
322-
mirrorStrategy: "preserve"
322+
preserveVisibility: false
323323
}
324324
};
325325

@@ -381,12 +381,15 @@ describe("getGiteaRepoOwner - Organization Override Tests", () => {
381381
expect(result).toBe("myorg");
382382
});
383383

384-
test("single-org strategy: personal repos go to defaultOrg", () => {
384+
test("mixed strategy: personal repos go to organization", () => {
385385
const configWithMixed = {
386386
...baseConfig,
387+
githubConfig: {
388+
...baseConfig.githubConfig!,
389+
mirrorStrategy: "mixed" as const
390+
},
387391
giteaConfig: {
388392
...baseConfig.giteaConfig!,
389-
mirrorStrategy: "mixed" as const,
390393
organization: "github-mirrors"
391394
}
392395
};
@@ -395,12 +398,15 @@ describe("getGiteaRepoOwner - Organization Override Tests", () => {
395398
expect(result).toBe("github-mirrors");
396399
});
397400

398-
test("single-org strategy: org repos also go to defaultOrg", () => {
401+
test("mixed strategy: org repos preserve their structure", () => {
399402
const configWithMixed = {
400403
...baseConfig,
404+
githubConfig: {
405+
...baseConfig.githubConfig!,
406+
mirrorStrategy: "mixed" as const
407+
},
401408
giteaConfig: {
402409
...baseConfig.giteaConfig!,
403-
mirrorStrategy: "mixed" as const,
404410
organization: "github-mirrors"
405411
}
406412
};
@@ -412,8 +418,8 @@ describe("getGiteaRepoOwner - Organization Override Tests", () => {
412418
test("flat-user strategy: all repos go to defaultOwner", () => {
413419
const configWithFlatUser = {
414420
...baseConfig,
415-
giteaConfig: {
416-
...baseConfig.giteaConfig!,
421+
githubConfig: {
422+
...baseConfig.githubConfig!,
417423
mirrorStrategy: "flat-user" as const
418424
}
419425
};

0 commit comments

Comments
 (0)