max / makenotwork
- Co-Authored-By
- Claude Opus 5 (1M context) <noreply@anthropic.com>
1 file changed,
+12 insertions,
-0 deletions
| @@ -48,6 +48,13 @@ | |||
| 48 | 48 | ||
| 49 | 49 | let resp = h.client.get("/").await; | |
| 50 | 50 | assert!(resp.status.is_success()); | |
| 51 | + | // One `directory-name` div per rendered community row, so counting them | |
| 52 | + | // counts the rows the handler actually paginated down to. | |
| 53 | + | assert_eq!( | |
| 54 | + | resp.text.matches("directory-name").count(), | |
| 55 | + | 25, | |
| 56 | + | "page 1 should render 25 of the 30 communities" | |
| 57 | + | ); | |
| 51 | 58 | assert!( | |
| 52 | 59 | resp.text.contains("Page 1 of 2"), | |
| 53 | 60 | "Should show pagination info: {}", | |
| @@ -64,6 +71,11 @@ | |||
| 64 | 71 | ||
| 65 | 72 | let resp = h.client.get("/?page=2").await; | |
| 66 | 73 | assert!(resp.status.is_success()); | |
| 74 | + | assert_eq!( | |
| 75 | + | resp.text.matches("directory-name").count(), | |
| 76 | + | 5, | |
| 77 | + | "page 2 should render the remaining 5 communities" | |
| 78 | + | ); | |
| 67 | 79 | assert!( | |
| 68 | 80 | resp.text.contains("Previous"), | |
| 69 | 81 | "Should show Previous link on page 2" |