Skip to content

Commit 9bb8490

Browse files
committed
test: add test for displaying Maven dependency nodes in correct format
1 parent 0c1a8d3 commit 9bb8490

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/maven-suite/projectView.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,19 @@ suite("Maven Project View Tests", () => {
253253
assert.equal(projectChildren.length, 4);
254254
});
255255

256+
test("Can maven dependency nodes display in correct groupId:artifactId:version format", async function() {
257+
const explorer = DependencyExplorer.getInstance(contextManager.context);
258+
259+
const roots = await explorer.dataProvider.getChildren();
260+
const projectNode = roots![0] as ProjectNode;
261+
const projectChildren = await projectNode.getChildren();
262+
const mavenDependency = projectChildren[3] as ContainerNode;
263+
const mavenChildren = await mavenDependency.getChildren();
264+
265+
assert.equal(mavenChildren[0].getDisplayName(), "org.hamcrest:hamcrest-core:1.3")
266+
assert.equal(mavenChildren[1].getDisplayName(), "junit:junit:4.13.1")
267+
});
268+
256269
teardown(async () => {
257270
// Restore default settings. Some tests might alter them and others depend on a specific setting.
258271
// Not resetting to the default settings will also show the file as changed in the source control view.

0 commit comments

Comments
 (0)