Порівняти коміти

...
Автор SHA1 Повідомлення Дата
l0ng-ai 915adfb1cb test(vcs): give the unavailable-root fixtures their VCS kind
#7065 made VcsRoot.kind required; the fixtures #7161 added on main lacked it, so tsc
failed on main.
2026-12-01 20:43:33 +08:00
+43 -4
Переглянути файл
@@ -395,7 +395,17 @@ describe("VCS status ownership", () => {
expect(getFileDecoration(modified.path)?.color).toBe("var(--vcs-modified)");
vi.mocked(commands.vcsRoots).mockResolvedValueOnce(
ok([{ root: git.root, branchRoot: git.root, head: null, headCommit: null, operation: null, unavailable: true }]),
ok([
{
root: git.root,
branchRoot: git.root,
kind: "git",
head: null,
headCommit: null,
operation: null,
unavailable: true,
},
]),
);
vi.mocked(commands.vcsStatus).mockRejectedValueOnce(new Error("git repository is no longer valid: /a"));
vi.mocked(commands.vcsBranchInfo).mockRejectedValueOnce(new Error("git repository is no longer valid: /a"));
@@ -461,6 +471,7 @@ describe("VCS status ownership", () => {
{
root: healthy,
branchRoot: healthy,
kind: "git",
head: "main",
headCommit: "def1234",
operation: null,
@@ -478,10 +489,19 @@ describe("VCS status ownership", () => {
vi.mocked(commands.vcsRoots).mockResolvedValue(
ok([
{ root: git.root, branchRoot: git.root, head: null, headCommit: null, operation: null, unavailable: true },
{
root: git.root,
branchRoot: git.root,
kind: "git",
head: null,
headCommit: null,
operation: null,
unavailable: true,
},
{
root: healthy,
branchRoot: healthy,
kind: "git",
head: "main",
headCommit: "def1234",
operation: null,
@@ -518,7 +538,17 @@ describe("VCS status ownership", () => {
it("preserves empty roots reference across repeated all-unavailable refreshes", async () => {
useProject.setState({ project: git });
vi.mocked(commands.vcsRoots).mockResolvedValue(
ok([{ root: git.root, branchRoot: git.root, head: null, headCommit: null, operation: null, unavailable: true }]),
ok([
{
root: git.root,
branchRoot: git.root,
kind: "git",
head: null,
headCommit: null,
operation: null,
unavailable: true,
},
]),
);
vi.mocked(commands.vcsStatus).mockRejectedValue(new Error("git repository is no longer valid"));
vi.mocked(commands.vcsBranchInfo).mockRejectedValue(new Error("git repository is no longer valid"));
@@ -543,7 +573,15 @@ describe("VCS status ownership", () => {
vi.mocked(commands.vcsRoots).mockResolvedValueOnce(
ok([
...roots,
{ root: sibling, branchRoot: sibling, head: null, headCommit: null, operation: null, unavailable: true },
{
root: sibling,
branchRoot: sibling,
kind: "git",
head: null,
headCommit: null,
operation: null,
unavailable: true,
},
]),
);
await refreshNow();
@@ -555,6 +593,7 @@ describe("VCS status ownership", () => {
{
root: sibling,
branchRoot: sibling,
kind: "git",
head: "main",
headCommit: "def1234",
operation: null,