дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-05 17:47:08 +02:00
A .NET project node in the Project view's solution tree was a leaf for its .csproj holding only Dependencies. It now lists the project's folder (bin and obj left out) below Dependencies, keeps the project's .NET context actions, and Select Opened File reveals files of a project in the solution tree. The project file opens from the node's Edit '<name>.csproj' menu item. Closes #7859 Co-authored-by: Inf1mum <[email protected]>
79 рядки
3.5 KiB
TypeScript
79 рядки
3.5 KiB
TypeScript
/**
|
|
* The Dependencies node under a .NET project in the Project view (#7429), from a stubbed
|
|
* workspace model; `src/features/dotnet/tree.test.ts` covers the tree contributions.
|
|
*/
|
|
import { expect, stubDesktop, test } from "./fixtures";
|
|
|
|
const SHOTS = process.env.E2E_SHOTS;
|
|
|
|
test("a project lists its packages, projects, frameworks and analyzers under Dependencies", async ({
|
|
workbench: page,
|
|
}) => {
|
|
await stubDesktop(page);
|
|
await page.evaluate(async () => {
|
|
const storeModule = "/src/features/dotnet/store.ts";
|
|
const { useDotnet } = await import(/* @vite-ignore */ storeModule);
|
|
const project = (path: string, name: string, extra: object = {}) => ({
|
|
path,
|
|
name,
|
|
frameworks: ["net9.0"],
|
|
configurations: ["Debug"],
|
|
references: [],
|
|
packages: [],
|
|
test: false,
|
|
runner: "vstest",
|
|
adapter: "mstest",
|
|
trx: false,
|
|
...extra,
|
|
});
|
|
useDotnet.setState({
|
|
model: {
|
|
projects: [
|
|
project("/dev/acme-api/App/App.csproj", "App", {
|
|
packages: [{ id: "Newtonsoft.Json", version: "13.0.3" }],
|
|
references: ["/dev/acme-api/Core/Core.csproj", "/dev/acme-api/Shared/Core.csproj"],
|
|
frameworkReferences: ["Microsoft.AspNetCore.App"],
|
|
analyzers: ["Microsoft.AspNetCore.Analyzers.dll"],
|
|
}),
|
|
project("/dev/acme-api/Core/Core.csproj", "Core"),
|
|
project("/dev/acme-api/Shared/Core.csproj", "Core"),
|
|
],
|
|
solutions: [
|
|
{
|
|
path: "/dev/acme-api/Acme.sln",
|
|
projects: ["/dev/acme-api/App/App.csproj", "/dev/acme-api/Core/Core.csproj"],
|
|
},
|
|
],
|
|
},
|
|
});
|
|
});
|
|
const tree = page.getByRole("tree", { name: "Project" });
|
|
await tree.getByRole("treeitem", { name: /Solution 'Acme'/ }).click();
|
|
await page.keyboard.press("ArrowRight");
|
|
const app = tree.getByRole("treeitem", { name: "App", exact: true });
|
|
await app.click();
|
|
await page.keyboard.press("ArrowRight");
|
|
await tree.getByRole("treeitem", { name: "Dependencies", exact: true }).click();
|
|
await page.keyboard.press("ArrowRight");
|
|
for (const group of ["Packages", "Projects", "Frameworks", "Analyzers"]) {
|
|
await tree.getByRole("treeitem", { name: group, exact: true }).click();
|
|
await page.keyboard.press("ArrowRight");
|
|
}
|
|
// The solution's Core plus each distinct reference with that same display name.
|
|
await expect(tree.getByRole("treeitem", { name: "Core", exact: true })).toHaveCount(3);
|
|
await expect(tree.getByRole("treeitem", { name: /Newtonsoft\.Json/ })).toContainText("13.0.3");
|
|
await expect(tree.getByRole("treeitem", { name: "Microsoft.AspNetCore.App", exact: true })).toBeVisible();
|
|
await expect(tree.getByRole("treeitem", { name: "Microsoft.AspNetCore.Analyzers.dll", exact: true })).toBeVisible();
|
|
// Core has no dependencies: no node.
|
|
await expect(tree.getByRole("treeitem", { name: "Dependencies" })).toHaveCount(1);
|
|
if (SHOTS) await page.screenshot({ path: `${SHOTS}/b2-dependencies.png`, animations: "disabled" });
|
|
// The project node lists the project's folder; its project file opens from the context menu.
|
|
const editorTabs = page.getByRole("tablist", { name: "Editor tabs" }).getByRole("tab");
|
|
await expect(editorTabs).toHaveCount(0);
|
|
await app.click({ button: "right" });
|
|
await page.getByRole("menuitem", { name: "Edit 'App.csproj'" }).click();
|
|
await expect(editorTabs).toHaveText(["App.csproj"]);
|
|
await tree.getByRole("treeitem", { name: /Newtonsoft\.Json/ }).dblclick();
|
|
await expect(editorTabs).toHaveText(["App.csproj"]);
|
|
});
|