diff options
Diffstat (limited to 'src/view/com')
-rw-r--r-- | src/view/com/feeds/FeedSourceCard.tsx | 1 | ||||
-rw-r--r-- | src/view/com/lists/ListMembers.tsx | 1 | ||||
-rw-r--r-- | src/view/com/modals/UserAddRemoveLists.tsx | 7 | ||||
-rw-r--r-- | src/view/com/post-thread/PostThreadItem.tsx | 10 | ||||
-rw-r--r-- | src/view/com/profile/ProfileHeader.tsx | 1 | ||||
-rw-r--r-- | src/view/com/testing/TestCtrls.e2e.tsx | 8 | ||||
-rw-r--r-- | src/view/com/util/Toast.tsx | 2 |
7 files changed, 27 insertions, 3 deletions
diff --git a/src/view/com/feeds/FeedSourceCard.tsx b/src/view/com/feeds/FeedSourceCard.tsx index 1f2af069b..460816fc1 100644 --- a/src/view/com/feeds/FeedSourceCard.tsx +++ b/src/view/com/feeds/FeedSourceCard.tsx @@ -170,6 +170,7 @@ export function FeedSourceCardLoaded({ {showSaveBtn && feed.type === 'feed' && ( <View> <Pressable + testID={`feed-${feed.displayName}-toggleSave`} disabled={isSavePending || isPinPending || isRemovePending} accessibilityRole="button" accessibilityLabel={ diff --git a/src/view/com/lists/ListMembers.tsx b/src/view/com/lists/ListMembers.tsx index e6afb3d3c..b25f3ac48 100644 --- a/src/view/com/lists/ListMembers.tsx +++ b/src/view/com/lists/ListMembers.tsx @@ -132,6 +132,7 @@ export function ListMembers({ name: 'user-add-remove-lists', subject: profile.did, displayName: profile.displayName || profile.handle, + handle: profile.handle, }) }, [openModal], diff --git a/src/view/com/modals/UserAddRemoveLists.tsx b/src/view/com/modals/UserAddRemoveLists.tsx index 8c3dc8bb7..506ce15d0 100644 --- a/src/view/com/modals/UserAddRemoveLists.tsx +++ b/src/view/com/modals/UserAddRemoveLists.tsx @@ -28,11 +28,13 @@ export const snapPoints = ['fullscreen'] export function Component({ subject, + handle, displayName, onAdd, onRemove, }: { subject: string + handle: string displayName: string onAdd?: (listUri: string) => void onRemove?: (listUri: string) => void @@ -60,6 +62,7 @@ export function Component({ list={list} memberships={memberships} subject={subject} + handle={handle} onAdd={onAdd} onRemove={onRemove} /> @@ -87,6 +90,7 @@ function ListItem({ list, memberships, subject, + handle, onAdd, onRemove, }: { @@ -94,6 +98,7 @@ function ListItem({ list: GraphDefs.ListView memberships: ListMembersip[] | undefined subject: string + handle: string onAdd?: (listUri: string) => void onRemove?: (listUri: string) => void }) { @@ -182,7 +187,7 @@ function ListItem({ <ActivityIndicator /> ) : ( <Button - testID={`user-${subject}-addBtn`} + testID={`user-${handle}-addBtn`} type="default" label={membership === false ? _(msg`Add`) : _(msg`Remove`)} onPress={onToggleMembership} diff --git a/src/view/com/post-thread/PostThreadItem.tsx b/src/view/com/post-thread/PostThreadItem.tsx index 86ea4eb39..c121c7234 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}> - <Text testID="repostCount" type="lg" style={pal.textLight}> + <Text + testID="repostCount-expanded" + type="lg" + style={pal.textLight}> <Text type="xl-bold" style={pal.text}> {formatCount(post.repostCount)} </Text>{' '} @@ -390,7 +393,10 @@ let PostThreadItemLoaded = ({ style={styles.expandedInfoItem} href={likesHref} title={likesTitle}> - <Text testID="likeCount" type="lg" style={pal.textLight}> + <Text + testID="likeCount-expanded" + type="lg" + style={pal.textLight}> <Text type="xl-bold" style={pal.text}> {formatCount(post.likeCount)} </Text>{' '} diff --git a/src/view/com/profile/ProfileHeader.tsx b/src/view/com/profile/ProfileHeader.tsx index 39e3e42ec..e006cac7d 100644 --- a/src/view/com/profile/ProfileHeader.tsx +++ b/src/view/com/profile/ProfileHeader.tsx @@ -217,6 +217,7 @@ let ProfileHeaderLoaded = ({ openModal({ name: 'user-add-remove-lists', subject: profile.did, + handle: profile.handle, displayName: profile.displayName || profile.handle, onAdd: invalidateProfileQuery, onRemove: invalidateProfileQuery, diff --git a/src/view/com/testing/TestCtrls.e2e.tsx b/src/view/com/testing/TestCtrls.e2e.tsx index 41abc25d3..e1e899488 100644 --- a/src/view/com/testing/TestCtrls.e2e.tsx +++ b/src/view/com/testing/TestCtrls.e2e.tsx @@ -5,6 +5,7 @@ import {useModalControls} from '#/state/modals' import {useQueryClient} from '@tanstack/react-query' import {useSessionApi} from '#/state/session' import {useSetFeedViewPreferencesMutation} from '#/state/queries/preferences' +import {useLoggedOutViewControls} from '#/state/shell/logged-out' /** * This utility component is only included in the test simulator @@ -19,6 +20,7 @@ export function TestCtrls() { const {logout, login} = useSessionApi() const {openModal} = useModalControls() const {mutate: setFeedViewPref} = useSetFeedViewPreferencesMutation() + const {setShowLoggedOut} = useLoggedOutViewControls() const onPressSignInAlice = async () => { await login({ service: 'http://localhost:3000', @@ -95,6 +97,12 @@ export function TestCtrls() { accessibilityRole="button" style={BTN} /> + <Pressable + testID="e2eOpenLoggedOutView" + onPress={() => setShowLoggedOut(true)} + accessibilityRole="button" + style={BTN} + /> </View> ) } diff --git a/src/view/com/util/Toast.tsx b/src/view/com/util/Toast.tsx index c7134febe..5462505e1 100644 --- a/src/view/com/util/Toast.tsx +++ b/src/view/com/util/Toast.tsx @@ -7,6 +7,7 @@ import {colors} from 'lib/styles' import {useTheme} from 'lib/ThemeContext' import {usePalette} from 'lib/hooks/usePalette' import {useAnimatedValue} from 'lib/hooks/useAnimatedValue' +import {IS_TEST} from '#/env' const TIMEOUT = 4e3 @@ -14,6 +15,7 @@ export function show( message: string, _icon: FontAwesomeProps['icon'] = 'check', ) { + if (IS_TEST) return const item = new RootSiblings(<Toast message={message} />) setTimeout(() => { item.destroy() |