From 3afcfcf2200cb90e723f6a2e29ffe5684b33dafd Mon Sep 17 00:00:00 2001
From: Case Walker <25988138+casewalker@users.noreply.github.com>
Date: Tue, 21 Nov 2023 07:02:35 -0500
Subject: [PATCH] Small fixups - sort call centers in the picker, check for all
 of them being there in the test, and update the User Pool details in Readme
 (#3)

---
 README.md                       | 6 +++---
 components/CallCenterPicker.tsx | 2 +-
 cypress/e2e/app.cy.ts           | 4 ++++
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index da22cdc..2233481 100644
--- a/README.md
+++ b/README.md
@@ -21,12 +21,12 @@ This site relies on some environment variables:
 
   The base URL for the Hosted UI Cognito sign-in page associated with this
   UserPool's application (the current working UserPool is "_Cognito for Connect
-  Call Centers_" (ID: _us-east-1_jKQHCtx7s_) and the "App integration" client is
-  "_ReactAppClient_")
+  Call Centers_" (ID: _us-east-1_AZyvZQdFN_) and the "App integration" client is
+  "_Amplify App_")
 
 - `NEXT_PUBLIC_COGNITO_CLIENT_ID`
 
-  The Client ID of the App Integration - App Client (from the "_ReactAppClient_"
+  The Client ID of the App Integration - App Client (from the "_Amplify App_"
   client)
 
 - `NEXT_PUBLIC_COGNITO_REDIRECT_URI`
diff --git a/components/CallCenterPicker.tsx b/components/CallCenterPicker.tsx
index e114cab..f71aa21 100644
--- a/components/CallCenterPicker.tsx
+++ b/components/CallCenterPicker.tsx
@@ -44,7 +44,7 @@ export default function CallCenterPicker({
     <>
       <h2>Choose a Call Center to connect to:</h2>
       <div>
-        {cognitoGroups.map((group: string) => (
+        {cognitoGroups.sort().map((group: string) => (
           <div key={group}>
             <input
               type="radio"
diff --git a/cypress/e2e/app.cy.ts b/cypress/e2e/app.cy.ts
index 8162201..f32332a 100644
--- a/cypress/e2e/app.cy.ts
+++ b/cypress/e2e/app.cy.ts
@@ -94,6 +94,10 @@ describe("Happy paths", () => {
       fixture: "postSamlFormPage",
     }).as("samlPostToAws");
 
+    cy.contains("callcenter1");
+    cy.contains("callcenter2");
+    cy.contains("callcenter3");
+
     cy.get("input").parent("div").contains("callcenter1").click();
     cy.get("button").should("not.be.disabled");
     cy.get("button").click();