From 627aa09d78f5c9c277f05df798f7e9b5d4b1eaee Mon Sep 17 00:00:00 2001 From: Marko Milic Date: Tue, 29 Oct 2024 16:38:00 +0100 Subject: [PATCH] test: add test for displaying Maven dependency nodes in correct format --- test/maven-suite/projectView.test.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/maven-suite/projectView.test.ts b/test/maven-suite/projectView.test.ts index f6863758..906fbf1c 100644 --- a/test/maven-suite/projectView.test.ts +++ b/test/maven-suite/projectView.test.ts @@ -12,6 +12,19 @@ suite("Maven Project View Tests", () => { suiteSetup(setupTestEnv); + test("Can maven dependency nodes display in correct groupId:artifactId:version format", async function() { + const explorer = DependencyExplorer.getInstance(contextManager.context); + + const roots = await explorer.dataProvider.getChildren(); + const projectNode = roots![0] as ProjectNode; + const projectChildren = await projectNode.getChildren(); + const mavenDependency = projectChildren[3] as ContainerNode; + const mavenChildren = await mavenDependency.getChildren(); + + assert.equal(mavenChildren[0].getDisplayName(), "org.hamcrest:hamcrest-core:1.3") + assert.equal(mavenChildren[1].getDisplayName(), "junit:junit:4.13.1") + }); + test("Can node render correctly in hierarchical view", async function() { await vscode.workspace.getConfiguration("java.dependency").update("packagePresentation", "hierarchical"); await vscode.commands.executeCommand(Commands.VIEW_PACKAGE_CHANGETOHIERARCHICALPACKAGEVIEW);