From fa649574b033431619e2a13526f1a088f68f8273 Mon Sep 17 00:00:00 2001
From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Date: Fri, 2 Feb 2024 10:29:06 +0000
Subject: [PATCH] Bug 32474: (follow-up): Tell the tests to wait for the
 intercepted request responses

---
 t/cypress/integration/InfiniteScrollSelect_spec.ts | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/t/cypress/integration/InfiniteScrollSelect_spec.ts b/t/cypress/integration/InfiniteScrollSelect_spec.ts
index 1a5295aeee..526f692b87 100644
--- a/t/cypress/integration/InfiniteScrollSelect_spec.ts
+++ b/t/cypress/integration/InfiniteScrollSelect_spec.ts
@@ -84,9 +84,10 @@ describe("Infinite scroll", () => {
                 "X-Base-Total-Count": "20",
                 "X-Total-Count": "20",
             },
-        });
+        }).as("getPageTwo");
         // Scroll the dropdown
         cy.get(".vs__dropdown-menu").scrollTo("bottom");
+        cy.wait("@getPageTwo");
         cy.get("@options").should("have.length", 40);
 
         cy.intercept("GET", "/api/v1/erm/licenses*", {
@@ -96,9 +97,10 @@ describe("Infinite scroll", () => {
                 "X-Base-Total-Count": "20",
                 "X-Total-Count": "20",
             },
-        });
+        }).as("getPageThree");
         // Scroll the dropdown again
         cy.get(".vs__dropdown-menu").scrollTo("bottom");
+        cy.wait("@getPageThree");
         cy.get("@options").should("have.length", 60);
     });
 
@@ -208,9 +210,10 @@ describe("Infinite scroll", () => {
                 "X-Base-Total-Count": "20",
                 "X-Total-Count": "20",
             },
-        });
+        }).as("getPageTwo");
         // Scroll the dropdown
         cy.get(".vs__dropdown-menu").scrollTo("bottom");
+        cy.wait("@getPageTwo");
 
         cy.intercept("GET", "/api/v1/erm/licenses*", {
             statusCode: 200,
-- 
2.37.1 (Apple Git-137.1)