11import { sleep } from 'common/src/util/time'
22
3- import { TEST_USER_DISPLAY_NAME } from '../../utils/seedDatabase'
43import { expect , test } from '../fixtures/signInFixture'
54import { getCardAgeGender , getCardName , getCardSeekingInfo , getCardStar } from '../pages/peoplePage'
65
@@ -17,6 +16,7 @@ test.describe('when given valid input', () => {
1716 test ( 'should be able to save/favorite people' , async ( { app, signedOutAccount : account } ) => {
1817 await app . signinWithEmail ( account )
1918 await app . home . clickPeopleLink ( )
19+ await app . people . clearFilters ( )
2020 const profile = await app . people . getProfileInfo ( )
2121 const star = await getCardStar ( profile )
2222 const name = await getCardName ( profile )
@@ -30,6 +30,7 @@ test.describe('when given valid input', () => {
3030 test . describe ( 'the applied filter should' , ( ) => {
3131 test ( 'update the profile count' , async ( { app, signedInAccount} ) => {
3232 await app . home . clickPeopleLink ( )
33+ await app . people . clearFilters ( )
3334
3435 const totalProfiles = await app . people . profileCountLocator . textContent ( )
3536 await app . people . setConnectionTypeFilter ( [ 'Collaboration' , 'collaboration' ] )
@@ -57,6 +58,7 @@ test.describe('when given valid input', () => {
5758 */
5859 test . skip ( 'show profiles with the correct age' , async ( { app, signedInAccount} ) => {
5960 await app . home . clickPeopleLink ( )
61+ await app . people . clearFilters ( )
6062 await app . people . setDisplayFilter ( { filters : { Age : true } } )
6163
6264 const totalProfiles = await app . people . profileCountLocator . textContent ( )
@@ -77,6 +79,7 @@ test.describe('when given valid input', () => {
7779
7880 test ( 'show profiles with the correct gender' , async ( { app, signedInAccount} ) => {
7981 await app . home . clickPeopleLink ( )
82+ await app . people . clearFilters ( )
8083
8184 const totalProfiles = await app . people . profileCountLocator . textContent ( )
8285 await app . people . setGenderTypeFilter ( [ 'Woman' , 'female' ] )
@@ -87,6 +90,7 @@ test.describe('when given valid input', () => {
8790
8891 test ( 'show profiles with the correct education level' , async ( { app, signedInAccount} ) => {
8992 await app . home . clickPeopleLink ( )
93+ await app . people . clearFilters ( )
9094
9195 const totalProfiles = await app . people . profileCountLocator . textContent ( )
9296 await app . people . setBackgroundFilter ( { education : [ 'College' , 'some-college' ] } )
@@ -97,6 +101,7 @@ test.describe('when given valid input', () => {
97101
98102 test ( 'show profiles with the correct diet' , async ( { app, signedInAccount} ) => {
99103 await app . home . clickPeopleLink ( )
104+ await app . people . clearFilters ( )
100105
101106 const totalProfiles = await app . people . profileCountLocator . textContent ( )
102107 await app . people . setLifestyleFilter ( { diet : [ 'Vegetarian' , 'veg' ] } )
@@ -107,6 +112,7 @@ test.describe('when given valid input', () => {
107112
108113 test ( 'show profiles with the correct smoking preference' , async ( { app, signedInAccount} ) => {
109114 await app . home . clickPeopleLink ( )
115+ await app . people . clearFilters ( )
110116
111117 const totalProfiles = await app . people . profileCountLocator . textContent ( )
112118 await app . people . setLifestyleFilter ( { smoker : 'Yes' } )
@@ -120,6 +126,7 @@ test.describe('when given valid input', () => {
120126 signedInAccount,
121127 } ) => {
122128 await app . home . clickPeopleLink ( )
129+ await app . people . clearFilters ( )
123130
124131 const totalProfiles = await app . people . profileCountLocator . textContent ( )
125132 await app . people . setLifestyleFilter ( { psychedelics : [ 'Regularly (weekly+)' , 'regularly' ] } )
@@ -130,6 +137,7 @@ test.describe('when given valid input', () => {
130137
131138 test ( 'show profiles with the correct cannabis preference' , async ( { app, signedInAccount} ) => {
132139 await app . home . clickPeopleLink ( )
140+ await app . people . clearFilters ( )
133141
134142 const totalProfiles = await app . people . profileCountLocator . textContent ( )
135143 await app . people . setLifestyleFilter ( {
@@ -142,6 +150,7 @@ test.describe('when given valid input', () => {
142150
143151 test ( 'show profiles with the correct political preference' , async ( { app, signedInAccount} ) => {
144152 await app . home . clickPeopleLink ( )
153+ await app . people . clearFilters ( )
145154
146155 const totalProfiles = await app . people . profileCountLocator . textContent ( )
147156 await app . people . setValuesAndBeliefsFilter ( { political : [ 'Progressive' , 'progressive' ] } )
@@ -152,6 +161,7 @@ test.describe('when given valid input', () => {
152161
153162 test ( 'show profiles with the correct religion preference' , async ( { app, signedInAccount} ) => {
154163 await app . home . clickPeopleLink ( )
164+ await app . people . clearFilters ( )
155165
156166 const totalProfiles = await app . people . profileCountLocator . textContent ( )
157167 await app . people . setValuesAndBeliefsFilter ( { religious : [ 'Jewish' , 'jewish' ] } )
@@ -161,10 +171,14 @@ test.describe('when given valid input', () => {
161171 } )
162172 } )
163173
174+ // Each test hides `signedOutAccount` — a profile the fixture seeds and deletes for this test alone —
175+ // rather than a permanent seeded member, so the tests neither depend on `seed-test-data` having been
176+ // run against the database nor leave a hidden-profile row behind on a shared account.
164177 test . describe ( 'the hide profile feature' , ( ) => {
165- test ( 'should correctly hide a profile' , async ( { app, signedInAccount} ) => {
178+ test ( 'should correctly hide a profile' , async ( { app, signedInAccount, signedOutAccount } ) => {
166179 await app . home . clickPeopleLink ( )
167- await app . people . useSearch ( TEST_USER_DISPLAY_NAME )
180+ await app . people . clearFilters ( )
181+ await app . people . useSearch ( signedOutAccount . display_name )
168182 await sleep ( 1000 )
169183 const profile = await app . people . getProfileInfo ( )
170184 if ( ! profile ) throw new Error ( 'Profile not found' )
@@ -180,9 +194,10 @@ test.describe('when given valid input', () => {
180194 ) . toBeVisible ( )
181195 } )
182196
183- test ( 'should be reversible using undo' , async ( { app, signedInAccount} ) => {
197+ test ( 'should be reversible using undo' , async ( { app, signedInAccount, signedOutAccount } ) => {
184198 await app . home . clickPeopleLink ( )
185- await app . people . useSearch ( TEST_USER_DISPLAY_NAME )
199+ await app . people . clearFilters ( )
200+ await app . people . useSearch ( signedOutAccount . display_name )
186201 await sleep ( 1000 )
187202 const profile = await app . people . getProfileInfo ( )
188203 if ( ! profile ) throw new Error ( 'Profile not found' )
@@ -205,9 +220,11 @@ test.describe('when given valid input', () => {
205220 test ( 'should be reversible using manage hidden profiles feature in settings' , async ( {
206221 app,
207222 signedInAccount,
223+ signedOutAccount,
208224 } ) => {
209225 await app . home . clickPeopleLink ( )
210- await app . people . useSearch ( TEST_USER_DISPLAY_NAME )
226+ await app . people . clearFilters ( )
227+ await app . people . useSearch ( signedOutAccount . display_name )
211228 await sleep ( 1000 )
212229 const profile = await app . people . getProfileInfo ( )
213230 if ( ! profile ) throw new Error ( 'Profile not found' )
@@ -228,6 +245,7 @@ test.describe('when given valid input', () => {
228245 await app . settings . unhideProfiles ( name )
229246 await app . settings . clickCloseButton ( )
230247 await app . home . clickPeopleLink ( )
248+ await app . people . clearFilters ( )
231249 const undoProfile = app . people . page . getByRole ( 'heading' , { name : `${ name } ` } )
232250 await expect ( undoProfile ) . toBeVisible ( )
233251 } )
@@ -264,6 +282,7 @@ test.describe('when given valid input', () => {
264282 const longMessage = message . repeat ( 20 )
265283
266284 await app . home . clickPeopleLink ( )
285+ await app . people . clearFilters ( )
267286 await app . people . useSearch ( receiver . display_name )
268287 await app . people . messageProfile ( receiver . display_name , longMessage )
269288 await app . messages . verifyMessage ( longMessage )
0 commit comments