From 53b2eb38cb5efffe2a84c8fed15b590f04422f06 Mon Sep 17 00:00:00 2001
From: Liam Morland <lkmorlan@uwaterloo.ca>
Date: Wed, 23 Jun 2021 15:59:49 -0400
Subject: [PATCH] ISTWCMS-4881: Test for Honeypot element

---
 tests/src/Functional/UwWcmsBasicTest.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/src/Functional/UwWcmsBasicTest.php b/tests/src/Functional/UwWcmsBasicTest.php
index 0b8b0a007..0cdba5da5 100644
--- a/tests/src/Functional/UwWcmsBasicTest.php
+++ b/tests/src/Functional/UwWcmsBasicTest.php
@@ -313,6 +313,11 @@ class UwWcmsBasicTest extends BrowserTestBase {
         $this_code = $this->getSession()->getStatusCode();
         $message = sprintf('Response status code for %s on path %s is %d; %d expected.', $role, $path, $this_code, $expected_code);
         $this->assert(intval($this_code) === $expected_code, $message);
+
+        if ($path === 'form/test-form' && !$this->loggedInUser) {
+          // Test for Honeypot element.
+          $this->assertRaw('Leave this field blank');
+        }
       }
     }
   }
-- 
GitLab