diff options
author | Eric Bailey <git@esb.lol> | 2023-12-05 14:50:56 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-05 14:50:56 -0600 |
commit | 5f553c29dfdac1bf81debe5e28983a9dbe74bd7f (patch) | |
tree | 6bfabab5623050aed65cdbb8dcc6474aa8f9d9cb /__e2e__/tests/merge-feed.test.skip.ts | |
parent | ed5a97d0fab249cab91539f0c4dc7d3084bc59a8 (diff) | |
download | voidsky-5f553c29dfdac1bf81debe5e28983a9dbe74bd7f.tar.zst |
E2E 🟢 (#2092)
* Add logged out e2e ctrl, fix login test * Fix log handling via env vars in expo * Fix create account test * Upgrade dev-env * Fix home screen tests * Fix composer tests * Fix curate-lists tests, split in two * Fix invite codes test * Fix curate-lists tests * Give up on mergefeed test * Fix mod lists * Fix app view url * Fix profile tests * Fix profile test with hack * Keep using globals * Fix two more * Fix thread view * Better skip for merge feed * Revert debug code
Diffstat (limited to '__e2e__/tests/merge-feed.test.skip.ts')
-rw-r--r-- | __e2e__/tests/merge-feed.test.skip.ts | 163 |
1 files changed, 163 insertions, 0 deletions
diff --git a/__e2e__/tests/merge-feed.test.skip.ts b/__e2e__/tests/merge-feed.test.skip.ts new file mode 100644 index 000000000..4a8b3cbce --- /dev/null +++ b/__e2e__/tests/merge-feed.test.skip.ts @@ -0,0 +1,163 @@ +/* eslint-env detox/detox */ + +import {describe, beforeAll, it} from '@jest/globals' +import {expect} from 'detox' +import {openApp, loginAsAlice, createServer} from '../util' + +describe('Mergefeed', () => { + beforeAll(async () => { + await createServer('?mergefeed') + await openApp({permissions: {notifications: 'YES'}}) + }) + + it('Login', async () => { + await element(by.id('e2eOpenLoggedOutView')).tap() + await loginAsAlice() + await element(by.id('e2eToggleMergefeed')).tap() + await element(by.id('bottomBarFeedsBtn')).tap() + await element(by.id('feed-alice-favs-toggleSave')).tap() + await element(by.id('e2eGotoHome')).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') + }) +}) |