fixed tests

This commit is contained in:
Arunavo Ray
2025-07-21 15:17:53 +05:30
parent 9fa10dae00
commit dcdb06ac39

View File

@@ -309,17 +309,17 @@ describe("getGiteaRepoOwner - Organization Override Tests", () => {
excludeOrgs: [], excludeOrgs: [],
mirrorPublicOrgs: false, mirrorPublicOrgs: false,
publicOrgs: [], publicOrgs: [],
skipStarredIssues: false skipStarredIssues: false,
mirrorStrategy: "preserve"
}, },
giteaConfig: { giteaConfig: {
defaultOwner: "giteauser", defaultOwner: "giteauser",
url: "https://gitea.example.com", url: "https://gitea.example.com",
token: "gitea-token", token: "gitea-token",
defaultOrg: "github-mirrors", organization: "github-mirrors",
visibility: "public", visibility: "public",
starredReposOrg: "starred", starredReposOrg: "starred",
preserveVisibility: false, preserveVisibility: false
mirrorStrategy: "preserve"
} }
}; };
@@ -381,12 +381,15 @@ describe("getGiteaRepoOwner - Organization Override Tests", () => {
expect(result).toBe("myorg"); expect(result).toBe("myorg");
}); });
test("single-org strategy: personal repos go to defaultOrg", () => { test("mixed strategy: personal repos go to organization", () => {
const configWithMixed = { const configWithMixed = {
...baseConfig, ...baseConfig,
githubConfig: {
...baseConfig.githubConfig!,
mirrorStrategy: "mixed" as const
},
giteaConfig: { giteaConfig: {
...baseConfig.giteaConfig!, ...baseConfig.giteaConfig!,
mirrorStrategy: "mixed" as const,
organization: "github-mirrors" organization: "github-mirrors"
} }
}; };
@@ -395,12 +398,15 @@ describe("getGiteaRepoOwner - Organization Override Tests", () => {
expect(result).toBe("github-mirrors"); expect(result).toBe("github-mirrors");
}); });
test("single-org strategy: org repos also go to defaultOrg", () => { test("mixed strategy: org repos preserve their structure", () => {
const configWithMixed = { const configWithMixed = {
...baseConfig, ...baseConfig,
githubConfig: {
...baseConfig.githubConfig!,
mirrorStrategy: "mixed" as const
},
giteaConfig: { giteaConfig: {
...baseConfig.giteaConfig!, ...baseConfig.giteaConfig!,
mirrorStrategy: "mixed" as const,
organization: "github-mirrors" organization: "github-mirrors"
} }
}; };
@@ -412,8 +418,8 @@ describe("getGiteaRepoOwner - Organization Override Tests", () => {
test("flat-user strategy: all repos go to defaultOwner", () => { test("flat-user strategy: all repos go to defaultOwner", () => {
const configWithFlatUser = { const configWithFlatUser = {
...baseConfig, ...baseConfig,
giteaConfig: { githubConfig: {
...baseConfig.giteaConfig!, ...baseConfig.githubConfig!,
mirrorStrategy: "flat-user" as const mirrorStrategy: "flat-user" as const
} }
}; };