diff --git a/cli/ballerina-cli/src/test/java/io/ballerina/cli/cmd/DocCommandTest.java b/cli/ballerina-cli/src/test/java/io/ballerina/cli/cmd/DocCommandTest.java index 22ab61e0fbb7..e368d6a95dea 100644 --- a/cli/ballerina-cli/src/test/java/io/ballerina/cli/cmd/DocCommandTest.java +++ b/cli/ballerina-cli/src/test/java/io/ballerina/cli/cmd/DocCommandTest.java @@ -55,17 +55,23 @@ public void setup() throws IOException { } @Test(description = "Test doc command on a ballerina project.") - public void testDocCommand() throws IOException { + public void testDocCommand() { Path projectPath = this.testResources.resolve("doc_project"); System.setProperty("user.dir", projectPath.toString()); + Path destinationPath = projectPath.resolve("target") + .resolve("apidocs").resolve("foo").resolve("winery").resolve("0.1.0"); DocCommand docCommand = new DocCommand(this.printStream, this.printStream, false); docCommand.execute(); - Assert.assertTrue(Files.exists(this.testResources.resolve("doc_project").resolve("target") - .resolve("apidocs").resolve("foo").resolve("winery").resolve("0.1.0").resolve("index.html"))); + Assert.assertTrue(Files.exists(destinationPath.resolve("api-docs.js"))); + Assert.assertTrue(Files.exists(destinationPath.resolve("api-docs.json"))); - Files.delete(this.testResources.resolve("doc_project").resolve("target") - .resolve("apidocs").resolve("foo").resolve("winery").resolve("0.1.0").resolve("index.html")); + /* Verify if all the UI components are present. */ + Assert.assertTrue(Files.exists(destinationPath.resolve("bundle.js"))); + Assert.assertTrue(Files.exists(destinationPath.resolve("favicon.ico"))); + Assert.assertTrue(Files.exists(destinationPath.resolve("globals.css"))); + Assert.assertTrue(Files.exists(destinationPath.resolve("index.html"))); + Assert.assertTrue(Files.exists(destinationPath.resolve("vercel.svg"))); } @Test(description = "Test doc command on a ballerina project with custom target dir.")