diff --git a/core/modules/content_moderation/tests/src/Kernel/ViewsDataIntegrationTest.php b/core/modules/content_moderation/tests/src/Kernel/ViewsDataIntegrationTest.php
index 6b127c8..8703d1f 100644
--- a/core/modules/content_moderation/tests/src/Kernel/ViewsDataIntegrationTest.php
+++ b/core/modules/content_moderation/tests/src/Kernel/ViewsDataIntegrationTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\content_moderation\Kernel;
 
+use Drupal\entity_test\Entity\EntityTestMul;
+use Drupal\entity_test\Entity\EntityTestMulRevPub;
 use Drupal\node\Entity\Node;
 use Drupal\node\Entity\NodeType;
 use Drupal\Tests\views\Kernel\ViewsKernelTestBase;
@@ -23,6 +25,7 @@ class ViewsDataIntegrationTest extends ViewsKernelTestBase {
     'node',
     'content_moderation',
     'workflows',
+    'entity_test',
   ];
 
   /**
@@ -32,6 +35,7 @@ protected function setUp($import_test_views = TRUE) {
     parent::setUp($import_test_views);
 
     $this->installEntitySchema('node');
+    $this->installEntitySchema('entity_test_mulrevpub');
     $this->installEntitySchema('user');
     $this->installEntitySchema('content_moderation_state');
     $this->installSchema('node', 'node_access');
@@ -44,6 +48,7 @@ protected function setUp($import_test_views = TRUE) {
     $node_type->save();
     $workflow = Workflow::load('editorial');
     $workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'page');
+    $workflow->getTypePlugin()->addEntityTypeAndBundle('entity_test_mulrevpub', 'entity_test_mulrevpub');
     $workflow->save();
   }
 
@@ -60,6 +65,15 @@ public function testViewsData() {
     $node->moderation_state->value = 'published';
     $node->save();
 
+    // Create a totally unrelated entity to ensure the extra join information
+    // joins by the correct entity type.
+    $unrelated_entity = EntityTestMulRevPub::create([
+      'id' => $node->id(),
+    ]);
+    $unrelated_entity->save();
+
+    $this->assertEquals($unrelated_entity->id(), $node->id());
+
     $revision = clone $node;
     $revision->setNewRevision(TRUE);
     $revision->isDefaultRevision(FALSE);
@@ -109,15 +123,15 @@ public function testContentModerationStateRevisionJoin() {
 
     $expected_result = [
       [
-        'revision_id' => $node->getRevisionId(),
+        'vid' => $node->getRevisionId(),
         'moderation_state' => 'published',
       ],
       [
-        'revision_id' => $revision->getRevisionId(),
+        'vid' => $revision->getRevisionId(),
         'moderation_state' => 'draft',
       ],
     ];
-    $this->assertIdenticalResultset($view, $expected_result, ['revision_id' => 'revision_id', 'moderation_state' => 'moderation_state']);
+    $this->assertIdenticalResultset($view, $expected_result, ['vid' => 'vid', 'moderation_state' => 'moderation_state']);
   }
 
   /**
