Skip to content

Commit

Permalink
test: add test for displaying Maven dependency nodes in correct format
Browse files Browse the repository at this point in the history
  • Loading branch information
mamilic committed Oct 29, 2024
1 parent 0c1a8d3 commit 9bb8490
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/maven-suite/projectView.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,19 @@ suite("Maven Project View Tests", () => {
assert.equal(projectChildren.length, 4);
});

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")
});

teardown(async () => {
// Restore default settings. Some tests might alter them and others depend on a specific setting.
// Not resetting to the default settings will also show the file as changed in the source control view.
Expand Down

0 comments on commit 9bb8490

Please sign in to comment.