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 627aa09
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 @@ -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);
Expand Down

0 comments on commit 627aa09

Please sign in to comment.