about summary refs log tree commit diff
path: root/src/view/shell
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/shell')
-rw-r--r--src/view/shell/mobile/Menu.tsx5
-rw-r--r--src/view/shell/mobile/TabsSelector.tsx18
-rw-r--r--src/view/shell/mobile/index.tsx6
3 files changed, 21 insertions, 8 deletions
diff --git a/src/view/shell/mobile/Menu.tsx b/src/view/shell/mobile/Menu.tsx
index 99f2bdab6..6a673d25f 100644
--- a/src/view/shell/mobile/Menu.tsx
+++ b/src/view/shell/mobile/Menu.tsx
@@ -75,6 +75,7 @@ export const Menu = observer(
       onPress?: () => void
     }) => (
       <TouchableOpacity
+        testID="menuItemButton"
         style={styles.menuItem}
         onPress={onPress ? onPress : () => onNavigate(url || '/')}>
         <View style={[styles.menuItemIconWrapper]}>
@@ -98,8 +99,9 @@ export const Menu = observer(
     )
 
     return (
-      <ScrollView style={[styles.view, pal.view]}>
+      <ScrollView testID="menuView" style={[styles.view, pal.view]}>
         <TouchableOpacity
+          testID="profileCardButton"
           onPress={() => onNavigate(`/profile/${store.me.handle}`)}
           style={styles.profileCard}>
           <UserAvatar
@@ -123,6 +125,7 @@ export const Menu = observer(
           </View>
         </TouchableOpacity>
         <TouchableOpacity
+          testID="searchBtn"
           style={[styles.searchBtn, pal.btn]}
           onPress={() => onNavigate('/search')}>
           <MagnifyingGlassIcon
diff --git a/src/view/shell/mobile/TabsSelector.tsx b/src/view/shell/mobile/TabsSelector.tsx
index 71aaa200d..433471602 100644
--- a/src/view/shell/mobile/TabsSelector.tsx
+++ b/src/view/shell/mobile/TabsSelector.tsx
@@ -116,11 +116,12 @@ export const TabsSelector = observer(
     }
 
     if (!active) {
-      return <View />
+      return <View testID="emptyView" />
     }
 
     return (
       <Animated.View
+        testID="tabsSelectorView"
         style={[
           styles.wrapper,
           {bottom: insets.bottom + 55},
@@ -129,7 +130,9 @@ export const TabsSelector = observer(
         <View onLayout={onLayout}>
           <View style={[s.p10, styles.section]}>
             <View style={styles.btns}>
-              <TouchableWithoutFeedback onPress={onPressShareTab}>
+              <TouchableWithoutFeedback
+                testID="shareButton"
+                onPress={onPressShareTab}>
                 <View style={[styles.btn]}>
                   <View style={styles.btnIcon}>
                     <FontAwesomeIcon size={16} icon="share" />
@@ -137,7 +140,9 @@ export const TabsSelector = observer(
                   <Text style={styles.btnText}>Share</Text>
                 </View>
               </TouchableWithoutFeedback>
-              <TouchableWithoutFeedback onPress={onPressCloneTab}>
+              <TouchableWithoutFeedback
+                testID="cloneButton"
+                onPress={onPressCloneTab}>
                 <View style={[styles.btn]}>
                   <View style={styles.btnIcon}>
                     <FontAwesomeIcon size={16} icon={['far', 'clone']} />
@@ -145,7 +150,9 @@ export const TabsSelector = observer(
                   <Text style={styles.btnText}>Clone tab</Text>
                 </View>
               </TouchableWithoutFeedback>
-              <TouchableWithoutFeedback onPress={onPressNewTab}>
+              <TouchableWithoutFeedback
+                testID="newTabButton"
+                onPress={onPressNewTab}>
                 <View style={[styles.btn]}>
                   <View style={styles.btnIcon}>
                     <FontAwesomeIcon size={16} icon="plus" />
@@ -164,6 +171,7 @@ export const TabsSelector = observer(
                 return (
                   <Swipeable
                     key={tab.id}
+                    testID="tabsSwipable"
                     renderLeftActions={renderSwipeActions}
                     renderRightActions={renderSwipeActions}
                     leftThreshold={100}
@@ -185,6 +193,7 @@ export const TabsSelector = observer(
                           isActive && styles.active,
                         ]}>
                         <TouchableWithoutFeedback
+                          testID="changeTabButton"
                           onPress={() => onPressChangeTab(tabIndex)}>
                           <View style={styles.tabInner}>
                             <View style={styles.tabIcon}>
@@ -203,6 +212,7 @@ export const TabsSelector = observer(
                           </View>
                         </TouchableWithoutFeedback>
                         <TouchableWithoutFeedback
+                          testID="closeTabButton"
                           onPress={() => onCloseTab(tabIndex)}>
                           <View style={styles.tabClose}>
                             <FontAwesomeIcon
diff --git a/src/view/shell/mobile/index.tsx b/src/view/shell/mobile/index.tsx
index 07fdfc843..ffb22bda9 100644
--- a/src/view/shell/mobile/index.tsx
+++ b/src/view/shell/mobile/index.tsx
@@ -327,7 +327,7 @@ export const MobileShell: React.FC = observer(() => {
         start={{x: 0, y: 0.8}}
         end={{x: 0, y: 1}}
         style={styles.outerContainer}>
-        <SafeAreaView style={styles.innerContainer}>
+        <SafeAreaView testID="noSessionView" style={styles.innerContainer}>
           <ErrorBoundary>
             <Login />
           </ErrorBoundary>
@@ -338,7 +338,7 @@ export const MobileShell: React.FC = observer(() => {
   }
   if (store.onboard.isOnboarding) {
     return (
-      <View style={styles.outerContainer}>
+      <View testID="onboardOuterView" style={styles.outerContainer}>
         <View style={styles.innerContainer}>
           <ErrorBoundary>
             <Onboard />
@@ -355,7 +355,7 @@ export const MobileShell: React.FC = observer(() => {
     backgroundColor: theme.colorScheme === 'dark' ? colors.gray7 : colors.gray1,
   }
   return (
-    <View style={[styles.outerContainer, pal.view]}>
+    <View testID="mobileShellView" style={[styles.outerContainer, pal.view]}>
       <StatusBar
         barStyle={
           theme.colorScheme === 'dark' ? 'light-content' : 'dark-content'