diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-09-20 19:47:56 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-20 19:47:56 -0700 |
commit | 5a945c2024855b89dfb99f81a2c4d226bb39dc32 (patch) | |
tree | 3a42e8e8d79c281606c2b7d9bff9380df596d8c7 /__e2e__/tests/merge-feed.test.ts | |
parent | 68dd3210d11bf8a15c319768d3e338c629a69d4b (diff) | |
download | voidsky-5a945c2024855b89dfb99f81a2c4d226bb39dc32.tar.zst |
Prefilter the mergefeed to ensure a better mix of following and custom feeds (#1498)
* Prefilter the mergefeed to ensure a better mix of following and custom feeds * Test suite improvements & tests for the mergefeed (#1499) * Disable invite codes test for now * Update test sim to latest iphone * Introduce TestCtrls driver * Add mergefeed tests
Diffstat (limited to '__e2e__/tests/merge-feed.test.ts')
-rw-r--r-- | __e2e__/tests/merge-feed.test.ts | 157 |
1 files changed, 157 insertions, 0 deletions
diff --git a/__e2e__/tests/merge-feed.test.ts b/__e2e__/tests/merge-feed.test.ts new file mode 100644 index 000000000..903e34328 --- /dev/null +++ b/__e2e__/tests/merge-feed.test.ts @@ -0,0 +1,157 @@ +/* eslint-env detox/detox */ + +import {openApp, loginAsAlice, createServer} from '../util' + +describe('Mergefeed', () => { + beforeAll(async () => { + await createServer('?mergefeed') + await openApp({permissions: {notifications: 'YES'}}) + }) + + it('Login', async () => { + await loginAsAlice() + await element(by.id('e2eToggleMergefeed')).tap() + }) + + it('Sees the expected mix of posts with default filters', async () => { + await element(by.id('followingFeedPage-feed-flatlist')).swipe( + 'down', + 'slow', + 1, + 0.5, + 0.5, + ) + // followed users + await expect( + element( + by.id('postText').withAncestor(by.id('feedItem-by-carla.test')), + ).atIndex(0), + ).toHaveText('Post 9') + await expect( + element( + by.id('postText').withAncestor(by.id('feedItem-by-bob.test')), + ).atIndex(0), + ).toHaveText('Post 9') + await element(by.id('followingFeedPage-feed-flatlist')).swipe( + 'up', + 'fast', + 1, + 0.5, + 0.5, + ) + // feed users + await expect( + element( + by.id('postText').withAncestor(by.id('feedItem-by-dan.test')), + ).atIndex(0), + ).toHaveText('Post 0') + }) + + it('Sees the expected mix of posts with replies disabled', async () => { + await element(by.id('followingFeedPage-feed-flatlist')).swipe( + 'down', + 'fast', + 1, + 0.5, + 0.5, + ) + await element(by.id('followingFeedPage-feed-flatlist')).swipe( + 'down', + 'fast', + 1, + 0.5, + 0.5, + ) + await element(by.id('viewHeaderHomeFeedPrefsBtn')).tap() + await element(by.id('toggleRepliesBtn')).tap() + await element(by.id('confirmBtn')).tap() + await element(by.id('followingFeedPage-feed-flatlist')).swipe( + 'down', + 'slow', + 1, + 0.5, + 0.5, + ) + + // followed users + await expect( + element( + by.id('postText').withAncestor(by.id('feedItem-by-carla.test')), + ).atIndex(0), + ).toHaveText('Post 9') + await expect( + element( + by.id('postText').withAncestor(by.id('feedItem-by-bob.test')), + ).atIndex(0), + ).toHaveText('Post 9') + await element(by.id('followingFeedPage-feed-flatlist')).swipe( + 'up', + 'fast', + 1, + 0.5, + 0.5, + ) + + // feed users + await expect( + element( + by.id('postText').withAncestor(by.id('feedItem-by-dan.test')), + ).atIndex(0), + ).toHaveText('Post 0') + }) + + it('Sees the expected mix of posts with no follows', async () => { + await element(by.id('followingFeedPage-feed-flatlist')).swipe( + 'down', + 'fast', + 1, + 0.5, + 0.5, + ) + + await element(by.id('bottomBarSearchBtn')).tap() + await element(by.id('searchTextInput')).typeText('bob') + await element(by.id('searchAutoCompleteResult-bob.test')).tap() + await expect(element(by.id('profileView'))).toBeVisible() + await element(by.id('unfollowBtn')).tap() + await element(by.id('profileHeaderBackBtn')).tap() + + // have to wait for the toast to clear + await waitFor(element(by.id('searchTextInputClearBtn'))) + .toBeVisible() + .withTimeout(5000) + await element(by.id('searchTextInputClearBtn')).tap() + await element(by.id('searchTextInput')).typeText('carla') + await element(by.id('searchAutoCompleteResult-carla.test')).tap() + await expect(element(by.id('profileView'))).toBeVisible() + await element(by.id('unfollowBtn')).tap() + await element(by.id('profileHeaderBackBtn')).tap() + + await element(by.id('bottomBarHomeBtn')).tap() + await element(by.id('followingFeedPage-feed-flatlist')).swipe( + 'down', + 'slow', + 1, + 0.5, + 0.5, + ) + await element(by.id('followingFeedPage-feed-flatlist')).swipe( + 'down', + 'slow', + 1, + 0.5, + 0.5, + ) + + // followed users NOT present + await expect(element(by.id('feedItem-by-carla.test'))).not.toExist() + await expect(element(by.id('feedItem-by-bob.test'))).not.toExist() + + // feed users + await expect( + element( + by.id('postText').withAncestor(by.id('feedItem-by-dan.test')), + ).atIndex(0), + ).toHaveText('Post 0') + }) +}) |