Skip to content

Commit 0b5137c

Browse files
committed
test: refactor tests in FeedScreenTest.kt class to align with the new filtering logic.
-Added the userMail parameter field in each post of the testPosts. -Ensured that the tests pass by making the first post's email the logged-in user's.
1 parent fe3b07f commit 0b5137c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

app/src/androidTest/java/com/github/lookupgroup27/lookup/ui/feed/FeedScreenTest.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,38 +64,43 @@ class FeedScreenTest {
6464
// Mock posts
6565
val testPosts =
6666
listOf(
67-
Post(
67+
Post( // Post created by the logged-in user
6868
uid = "1",
6969
uri = "http://example.com/1.jpg",
70-
username = testUserProfile.email, // Post created by the logged-in user
70+
username = testUserProfile.email,
71+
userMail = testUserProfile.email,
7172
latitude = 37.7749, // San Francisco
7273
longitude = -122.4194,
7374
description = "This is a test description"),
7475
Post(
7576
uid = "2",
7677
uri = "http://example.com/2.jpg",
7778
username = "User2", // Post created by another user
79+
userMail = "User2",
7880
latitude = 34.0522, // Los Angeles
7981
longitude = -118.2437,
8082
description = "This is another test description"),
8183
Post(
8284
uid = "3",
8385
uri = "http://example.com/3.jpg",
84-
username = "User3", // Another user's post
86+
username = "User3",
87+
userMail = "User3", // Another user's post
8588
latitude = 36.7783, // Fresno (closer to SF)
8689
longitude = -119.4179,
8790
description = "This is yet another test description"),
8891
Post(
8992
uid = "4",
9093
uri = "User4",
9194
username = "user4@example.com", // Another user's post
95+
userMail = "User4",
9296
latitude = 40.7128, // New York City (farther from SF than LA or Fresno)
9397
longitude = -74.0060,
9498
description = "This is a test description"),
9599
Post(
96100
uid = "5",
97101
uri = "User5",
98102
username = "user5@example.com", // Another user's post
103+
userMail = "User5",
99104
latitude = -33.8688, // Sydney, Australia (farthest from SF)
100105
longitude = 151.2093,
101106
description = "This is a test description"))

0 commit comments

Comments
 (0)