From 3f3765c067c633712f16043948d3b85b6b708581 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 5 Dec 2023 14:14:03 -0600 Subject: [PATCH] Fix thread view --- __e2e__/tests/thread-screen.test.ts | 14 ++++++++------ src/view/com/post-thread/PostThreadItem.tsx | 10 ++++++++-- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/__e2e__/tests/thread-screen.test.ts b/__e2e__/tests/thread-screen.test.ts index 02831d055e..e3cff12c9f 100644 --- a/__e2e__/tests/thread-screen.test.ts +++ b/__e2e__/tests/thread-screen.test.ts @@ -1,5 +1,7 @@ /* eslint-env detox/detox */ +import {describe, beforeAll, it} from '@jest/globals' +import {expect} from 'detox' import {openApp, loginAsAlice, createServer} from '../util' describe('Thread screen', () => { @@ -31,15 +33,15 @@ describe('Thread screen', () => { it('Can like the root post', async () => { const post = by.id('postThreadItem-by-bob.test') await expect( - element(by.id('likeCount').withAncestor(post)).atIndex(0), + element(by.id('likeCount-expanded').withAncestor(post)).atIndex(0), ).not.toExist() await element(by.id('likeBtn').withAncestor(post)).atIndex(0).tap() await expect( - element(by.id('likeCount').withAncestor(post)).atIndex(0), + element(by.id('likeCount-expanded').withAncestor(post)).atIndex(0), ).toHaveText('1 like') await element(by.id('likeBtn').withAncestor(post)).atIndex(0).tap() await expect( - element(by.id('likeCount').withAncestor(post)).atIndex(0), + element(by.id('likeCount-expanded').withAncestor(post)).atIndex(0), ).not.toExist() }) @@ -61,21 +63,21 @@ describe('Thread screen', () => { it('Can repost the root post', async () => { const post = by.id('postThreadItem-by-bob.test') await expect( - element(by.id('repostCount').withAncestor(post)).atIndex(0), + element(by.id('repostCount-expanded').withAncestor(post)).atIndex(0), ).not.toExist() await element(by.id('repostBtn').withAncestor(post)).atIndex(0).tap() await expect(element(by.id('repostModal'))).toBeVisible() await element(by.id('repostBtn').withAncestor(by.id('repostModal'))).tap() await expect(element(by.id('repostModal'))).not.toBeVisible() await expect( - element(by.id('repostCount').withAncestor(post)).atIndex(0), + element(by.id('repostCount-expanded').withAncestor(post)).atIndex(0), ).toHaveText('1 repost') await element(by.id('repostBtn').withAncestor(post)).atIndex(0).tap() await expect(element(by.id('repostModal'))).toBeVisible() await element(by.id('repostBtn').withAncestor(by.id('repostModal'))).tap() await expect(element(by.id('repostModal'))).not.toBeVisible() await expect( - element(by.id('repostCount').withAncestor(post)).atIndex(0), + element(by.id('repostCount-expanded').withAncestor(post)).atIndex(0), ).not.toExist() }) diff --git a/src/view/com/post-thread/PostThreadItem.tsx b/src/view/com/post-thread/PostThreadItem.tsx index 86ea4eb395..c121c7234f 100644 --- a/src/view/com/post-thread/PostThreadItem.tsx +++ b/src/view/com/post-thread/PostThreadItem.tsx @@ -375,7 +375,10 @@ let PostThreadItemLoaded = ({ style={styles.expandedInfoItem} href={repostsHref} title={repostsTitle}> - + {formatCount(post.repostCount)} {' '} @@ -390,7 +393,10 @@ let PostThreadItemLoaded = ({ style={styles.expandedInfoItem} href={likesHref} title={likesTitle}> - + {formatCount(post.likeCount)} {' '}