mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2025-12-08 12:36:44 +03:00
fixed tests
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user