diff --git a/src/Form/TagsForm.php b/src/Form/TagsForm.php
index 9545705..1171ff4 100644
--- a/src/Form/TagsForm.php
+++ b/src/Form/TagsForm.php
@@ -91,8 +91,8 @@ class TagsForm extends FormBase {
     else {
       // Get the view builder and build the node view in 'content'.
       $view_builder = $this->entityTypeManager->getViewBuilder('node');
-      $library_item_render_array = $view_builder->view($node);
-      $form['content'] = $view_builder->build($library_item_render_array);
+      $node_output = $view_builder->view($node);
+      $form['content'] = $node_output;
       $form_state->set('entity', $node);
 
       // If 'analyse' is set, call the service and display the tags.
diff --git a/src/Tests/OpenCalaisUIAdminTest.php b/src/Tests/OpenCalaisUIAdminTest.php
index cee11f4..f311e2f 100644
--- a/src/Tests/OpenCalaisUIAdminTest.php
+++ b/src/Tests/OpenCalaisUIAdminTest.php
@@ -2,58 +2,20 @@
 
 namespace Drupal\opencalais_ui\Tests;
 
-use Drupal\field_ui\Tests\FieldUiTestTrait;
 use Drupal\node\Entity\Node;
-use Drupal\simpletest\WebTestBase;
 
 /**
  * Tests the Open Calais UI admin.
  *
  * @group opencalais_ui
  */
-class OpenCalaisUIAdminTest extends WebTestBase {
-
-  use FieldUiTestTrait;
-
-  /**
-   * Modules to enable.
-   *
-   * @var array
-   */
-  public static $modules = array(
-    'node',
-    'block',
-    'opencalais_ui',
-    'taxonomy',
-    'field_ui'
-  );
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function setUp() {
-    parent::setUp();
-    // Create article content type.
-    $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
-    $this->drupalPlaceBlock('system_breadcrumb_block');
-  }
+class OpenCalaisUIAdminTest extends OpenCalaisUITestBase {
 
   /**
    * Tests Open Calais UI configuration form.
    */
   public function testConfigForm() {
-    $admin_user = $this->drupalCreateUser(array(
-      'administer site configuration',
-      'administer nodes',
-      'create article content',
-      'administer content types',
-      'administer node fields',
-      'edit any article content',
-      'administer opencalais',
-      'administer content types'
-    ));
-    $this->drupalLogin($admin_user);
-
+    $this->loginAsAdmin();
     // Create a test node.
     $node = Node::create([
       'title' => 'Target node',
@@ -71,10 +33,7 @@ class OpenCalaisUIAdminTest extends WebTestBase {
     $this->assertNoText('No Open Calais field has been set. Click here to set it');
 
     // Set the API key and check that the message is no longer displayed.
-    $edit = [
-      'api_key' => 'test_key'
-    ];
-    $this->drupalPostForm('admin/config/content/opencalais/general', $edit, 'Save configuration');
+    $this->setTestApiKey();
     $this->drupalGet('node/' . $node->id() . '/opencalais_tags');
     $this->assertLink('here');
     $this->assertNoText('No API key has been set. Click here to set it');
@@ -96,7 +55,7 @@ class OpenCalaisUIAdminTest extends WebTestBase {
     $this->assertNoText('The content type has no taxonomy fields available. Please add one to use Open Calais.');
 
     // Set the open calais field and check if the message is no longer displayed.
-    $this->drupalPostForm('admin/structure/types/manage/article', ['opencalais_field' => 'field_taxonomy_test'], 'Save content type');
+    $this->setTestOpenCalaisField('field_taxonomy_test');
     $this->drupalGet('node/' . $node->id() . '/opencalais_tags');
     $this->assertNoText('No API key has been set. Click here to set it');
     $this->assertNoText('No Open Calais field has been set. Click here to set it');
diff --git a/src/Tests/OpenCalaisUITagsTest.php b/src/Tests/OpenCalaisUITagsTest.php
new file mode 100644
index 0000000..c3b2a8d
--- /dev/null
+++ b/src/Tests/OpenCalaisUITagsTest.php
@@ -0,0 +1,53 @@
+<?php
+
+namespace Drupal\opencalais_ui\Tests;
+
+use Drupal\comment\Entity\CommentType;
+use Drupal\comment\Tests\CommentTestTrait;
+use Drupal\node\Entity\Node;
+
+/**
+ * Tests the Open Calais UI tags.
+ *
+ * @group opencalais_ui
+ */
+class OpenCalaisUITagsTest extends OpenCalaisUITestBase {
+
+  use CommentTestTrait;
+
+  /**
+   * Tests Open Calais UI tags form.
+   */
+  public function testTagsForm() {
+    // Add a comment field to the content type.
+    $this->loginAsAdmin([
+      'access comments',
+      'post comments',
+    ]);
+    $this->addDefaultCommentField('node', 'article', 'field_comment_test');
+    $field_edit = [
+      'settings[handler_settings][target_bundles][entities]' => TRUE,
+      'settings[handler_settings][target_bundles][industry_tags]' => TRUE,
+      'settings[handler_settings][target_bundles][markup_tags]' => TRUE,
+      'settings[handler_settings][target_bundles][social_tags]' => TRUE,
+      'settings[handler_settings][target_bundles][topic_tags]' => TRUE
+    ];
+    static::fieldUIAddNewField('admin/structure/types/manage/article', 'taxonomy_test', 'taxonomy_test', 'field_ui:entity_reference:taxonomy_term', [], $field_edit);
+    $this->setTestApiKey();
+    $this->setTestOpenCalaisField('field_taxonomy_test');
+
+    // Create a test node.
+    $node = Node::create([
+      'title' => 'Test node',
+      'type' => 'article',
+      'body' => 'recognizable_text',
+    ]);
+    $node->save();
+
+    // Assert the form is displayed when there are comment fields.
+    $this->drupalGet('node/' . $node->id() . '/opencalais_tags');
+    $this->assertResponse(200);
+    $this->assertText('recognizable_text');
+  }
+
+}
diff --git a/src/Tests/OpenCalaisUITestBase.php b/src/Tests/OpenCalaisUITestBase.php
new file mode 100644
index 0000000..fa919eb
--- /dev/null
+++ b/src/Tests/OpenCalaisUITestBase.php
@@ -0,0 +1,111 @@
+<?php
+
+namespace Drupal\opencalais_ui\Tests;
+
+use Drupal\field_ui\Tests\FieldUiTestTrait;
+use Drupal\simpletest\WebTestBase;
+
+/**
+ * Base class for tests.
+ */
+class OpenCalaisUITestBase extends WebTestBase {
+
+  use FieldUiTestTrait;
+
+  /**
+   * Drupal user object created by loginAsAdmin().
+   *
+   * @var \Drupal\user\UserInterface
+   */
+  protected $admin_user = NULL;
+
+  /**
+   * List of permissions used by loginAsAdmin().
+   *
+   * @var array
+   */
+  protected $admin_permissions = [];
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = [
+    'node',
+    'block',
+    'opencalais_ui',
+    'taxonomy',
+    'field_ui',
+    'comment'
+  ];
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+    $this->drupalPlaceBlock('system_breadcrumb_block');
+    $this->admin_permissions = [
+      'administer site configuration',
+      'administer nodes',
+      'create article content',
+      'administer content types',
+      'administer node fields',
+      'edit any article content',
+      'administer opencalais',
+      'administer content types'
+    ];
+    $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
+  }
+
+  /**
+   * Creates an user with admin permissions and log in.
+   *
+   * @param array $additional_permissions
+   *   Additional permissions that will be granted to admin user.
+   * @param bool $reset_permissions
+   *   Flag to determine if default admin permissions will be replaced by
+   *   $additional_permissions.
+   *
+   * @return object
+   *   Newly created and logged in user object.
+   */
+  function loginAsAdmin($additional_permissions = [], $reset_permissions = FALSE) {
+    $permissions = $this->admin_permissions;
+
+    if ($reset_permissions) {
+      $permissions = $additional_permissions;
+    }
+    elseif (!empty($additional_permissions)) {
+      $permissions = array_merge($permissions, $additional_permissions);
+    }
+
+    $this->admin_user = $this->drupalCreateUser($permissions);
+    $this->drupalLogin($this->admin_user);
+    return $this->admin_user;
+  }
+
+  /**
+   * Set a test API key.
+   */
+  public function setTestApiKey() {
+    $edit = [
+      'api_key' => 'test_key'
+    ];
+    $this->drupalPostForm('admin/config/content/opencalais/general', $edit, 'Save configuration');
+  }
+
+  /**
+   * Set the Open Calais field.
+   * @param string $field_name
+   *   Taxonomy field to use for storing the tags.
+   */
+  public function setTestOpenCalaisField($field_name) {
+    $edit = [
+      'opencalais_field' => $field_name
+    ];
+    $this->drupalPostForm('admin/structure/types/manage/article', $edit, 'Save content type');
+  }
+
+}
