about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2024-02-12 18:55:19 -0800
committerGitHub <noreply@github.com>2024-02-12 18:55:19 -0800
commit543e114877fcd00dd8c717a1116757a1a37d5aff (patch)
treef2a5b6b44622c53e4891208c00434acc9e90c9b1
parentfad40dda97c4c4ecc4165524d0898494582ccac2 (diff)
downloadvoidsky-543e114877fcd00dd8c717a1116757a1a37d5aff.tar.zst
Update tests to get them passing again (#2853)
-rw-r--r--__e2e__/tests/create-account.test.ts11
-rw-r--r--__e2e__/tests/home-screen.test.ts8
-rw-r--r--__e2e__/tests/invite-codes.test.ts11
-rw-r--r--__e2e__/tests/invites-and-text-verification.test.ts13
-rw-r--r--__e2e__/tests/mod-lists.test.ts67
-rw-r--r--__e2e__/tests/profile-screen.test.ts8
-rw-r--r--__e2e__/tests/self-labeling.test.ts1
-rw-r--r--__e2e__/tests/text-verification.test.ts14
-rw-r--r--__e2e__/tests/thread-screen.test.ts8
-rw-r--r--__e2e__/util.ts3
-rw-r--r--src/lib/media/picker.e2e.tsx3
-rw-r--r--src/screens/Onboarding/StepInterests/index.tsx2
-rw-r--r--src/state/models/media/image.e2e.ts146
-rw-r--r--src/view/com/auth/create/Step1.tsx2
-rw-r--r--src/view/com/util/post-ctrls/PostCtrls.tsx2
15 files changed, 215 insertions, 84 deletions
diff --git a/__e2e__/tests/create-account.test.ts b/__e2e__/tests/create-account.test.ts
index a6724e8e4..9c56c914e 100644
--- a/__e2e__/tests/create-account.test.ts
+++ b/__e2e__/tests/create-account.test.ts
@@ -18,9 +18,10 @@ describe('Create account', () => {
     await device.takeScreenshot('1- opened create account screen')
     await element(by.id('selectServiceButton')).tap()
     await device.takeScreenshot('2- selected other server')
+    await element(by.id('customSelectBtn')).tap()
     await element(by.id('customServerTextInput')).typeText(service)
     await element(by.id('customServerTextInput')).tapReturnKey()
-    await element(by.id('customServerSelectBtn')).tap()
+    await element(by.id('doneBtn')).tap()
     await device.takeScreenshot('3- input test server URL')
     await element(by.id('emailInput')).typeText('example@test.com')
     await element(by.id('passwordInput')).typeText('hunter2')
@@ -33,12 +34,6 @@ describe('Create account', () => {
 
     await element(by.id('nextBtn')).tap()
 
-    await expect(element(by.id('welcomeOnboarding'))).toBeVisible()
-    await element(by.id('continueBtn')).tap()
-    await expect(element(by.id('recommendedFeedsOnboarding'))).toBeVisible()
-    await element(by.id('continueBtn')).tap()
-    await expect(element(by.id('recommendedFollowsOnboarding'))).toBeVisible()
-    await element(by.id('continueBtn')).tap()
-    await expect(element(by.id('homeScreen'))).toBeVisible()
+    await expect(element(by.id('onboardingInterests'))).toBeVisible()
   })
 })
diff --git a/__e2e__/tests/home-screen.test.ts b/__e2e__/tests/home-screen.test.ts
index 79fca1e6a..ce7f1643b 100644
--- a/__e2e__/tests/home-screen.test.ts
+++ b/__e2e__/tests/home-screen.test.ts
@@ -36,7 +36,7 @@ describe('Home screen', () => {
     const carlaPosts = by.id('feedItem-by-carla.test')
     await expect(
       element(by.id('likeCount').withAncestor(carlaPosts)).atIndex(0),
-    ).toHaveText('0')
+    ).not.toExist()
     await element(by.id('likeBtn').withAncestor(carlaPosts)).atIndex(0).tap()
     await expect(
       element(by.id('likeCount').withAncestor(carlaPosts)).atIndex(0),
@@ -44,14 +44,14 @@ describe('Home screen', () => {
     await element(by.id('likeBtn').withAncestor(carlaPosts)).atIndex(0).tap()
     await expect(
       element(by.id('likeCount').withAncestor(carlaPosts)).atIndex(0),
-    ).toHaveText('0')
+    ).not.toExist()
   })
 
   it('Can repost posts', async () => {
     const carlaPosts = by.id('feedItem-by-carla.test')
     await expect(
       element(by.id('repostCount').withAncestor(carlaPosts)).atIndex(0),
-    ).toHaveText('0')
+    ).not.toExist()
     await element(by.id('repostBtn').withAncestor(carlaPosts)).atIndex(0).tap()
     await expect(element(by.id('repostModal'))).toBeVisible()
     await element(by.id('repostBtn').withAncestor(by.id('repostModal'))).tap()
@@ -65,7 +65,7 @@ describe('Home screen', () => {
     await expect(element(by.id('repostModal'))).not.toBeVisible()
     await expect(
       element(by.id('repostCount').withAncestor(carlaPosts)).atIndex(0),
-    ).toHaveText('0')
+    ).not.toExist()
   })
 
   it('Can report posts', async () => {
diff --git a/__e2e__/tests/invite-codes.test.ts b/__e2e__/tests/invite-codes.test.ts
index 7ab5b1477..7eb8d9a3e 100644
--- a/__e2e__/tests/invite-codes.test.ts
+++ b/__e2e__/tests/invite-codes.test.ts
@@ -28,9 +28,10 @@ describe('invite-codes', () => {
     await device.takeScreenshot('1- opened create account screen')
     await element(by.id('selectServiceButton')).tap()
     await device.takeScreenshot('2- selected other server')
+    await element(by.id('customSelectBtn')).tap()
     await element(by.id('customServerTextInput')).typeText(service)
     await element(by.id('customServerTextInput')).tapReturnKey()
-    await element(by.id('customServerSelectBtn')).tap()
+    await element(by.id('doneBtn')).tap()
     await device.takeScreenshot('3- input test server URL')
     await element(by.id('inviteCodeInput')).typeText(inviteCode)
     await element(by.id('emailInput')).typeText('example@test.com')
@@ -40,12 +41,6 @@ describe('invite-codes', () => {
     await element(by.id('handleInput')).typeText('e2e-test')
     await device.takeScreenshot('4- entered handle')
     await element(by.id('nextBtn')).tap()
-    await expect(element(by.id('welcomeOnboarding'))).toBeVisible()
-    await element(by.id('continueBtn')).tap()
-    await expect(element(by.id('recommendedFeedsOnboarding'))).toBeVisible()
-    await element(by.id('continueBtn')).tap()
-    await expect(element(by.id('recommendedFollowsOnboarding'))).toBeVisible()
-    await element(by.id('continueBtn')).tap()
-    await expect(element(by.id('homeScreen'))).toBeVisible()
+    await expect(element(by.id('onboardingInterests'))).toBeVisible()
   })
 })
diff --git a/__e2e__/tests/invites-and-text-verification.test.ts b/__e2e__/tests/invites-and-text-verification.test.ts
index 850ca6d5c..863b31107 100644
--- a/__e2e__/tests/invites-and-text-verification.test.ts
+++ b/__e2e__/tests/invites-and-text-verification.test.ts
@@ -28,16 +28,17 @@ describe('invite-codes', () => {
     await device.takeScreenshot('1- opened create account screen')
     await element(by.id('selectServiceButton')).tap()
     await device.takeScreenshot('2- selected other server')
+    await element(by.id('customSelectBtn')).tap()
     await element(by.id('customServerTextInput')).typeText(service)
     await element(by.id('customServerTextInput')).tapReturnKey()
-    await element(by.id('customServerSelectBtn')).tap()
+    await element(by.id('doneBtn')).tap()
     await device.takeScreenshot('3- input test server URL')
     await element(by.id('inviteCodeInput')).typeText(inviteCode)
     await element(by.id('emailInput')).typeText('example@test.com')
     await element(by.id('passwordInput')).typeText('hunter2')
     await device.takeScreenshot('4- entered account details')
     await element(by.id('nextBtn')).tap()
-    await element(by.id('phoneInput')).typeText('5558675309')
+    await element(by.id('phoneInput')).typeText('2345551234')
     await element(by.id('requestCodeBtn')).tap()
     await device.takeScreenshot('5- requested code')
     await element(by.id('codeInput')).typeText('000000')
@@ -46,12 +47,6 @@ describe('invite-codes', () => {
     await element(by.id('handleInput')).typeText('e2e-test')
     await device.takeScreenshot('7- entered handle')
     await element(by.id('nextBtn')).tap()
-    await expect(element(by.id('welcomeOnboarding'))).toBeVisible()
-    await element(by.id('continueBtn')).tap()
-    await expect(element(by.id('recommendedFeedsOnboarding'))).toBeVisible()
-    await element(by.id('continueBtn')).tap()
-    await expect(element(by.id('recommendedFollowsOnboarding'))).toBeVisible()
-    await element(by.id('continueBtn')).tap()
-    await expect(element(by.id('homeScreen'))).toBeVisible()
+    await expect(element(by.id('onboardingInterests'))).toBeVisible()
   })
 })
diff --git a/__e2e__/tests/mod-lists.test.ts b/__e2e__/tests/mod-lists.test.ts
index 5280920b4..c3d4149e0 100644
--- a/__e2e__/tests/mod-lists.test.ts
+++ b/__e2e__/tests/mod-lists.test.ts
@@ -2,7 +2,7 @@
 
 import {describe, beforeAll, it} from '@jest/globals'
 import {expect} from 'detox'
-import {openApp, loginAsAlice, loginAsBob, createServer, sleep} from '../util'
+import {openApp, loginAsAlice, loginAsBob, createServer} from '../util'
 
 describe('Mod lists', () => {
   beforeAll(async () => {
@@ -62,38 +62,39 @@ describe('Mod lists', () => {
       .withTimeout(5000)
   })
 
-  it('Set avi via the edit modlist modal', async () => {
-    await expect(element(by.id('userAvatarFallback'))).toExist()
-    await element(by.id('headerDropdownBtn')).tap()
-    await element(by.text('Edit list details')).tap()
-    await expect(element(by.id('createOrEditListModal'))).toBeVisible()
-    await element(by.id('changeAvatarBtn')).tap()
-    await element(by.text('Library')).tap()
-    await sleep(3e3)
-    await element(by.id('saveBtn')).tap()
-    await expect(element(by.id('createOrEditListModal'))).not.toBeVisible()
-    await expect(element(by.id('userAvatarImage'))).toExist()
-    // have to wait for the toast to clear
-    await waitFor(element(by.id('headerDropdownBtn')))
-      .toBeVisible()
-      .withTimeout(5000)
-  })
-
-  it('Remove avi via the edit modlist modal', async () => {
-    await expect(element(by.id('userAvatarImage'))).toExist()
-    await element(by.id('headerDropdownBtn')).tap()
-    await element(by.text('Edit list details')).tap()
-    await expect(element(by.id('createOrEditListModal'))).toBeVisible()
-    await element(by.id('changeAvatarBtn')).tap()
-    await element(by.text('Remove')).tap()
-    await element(by.id('saveBtn')).tap()
-    await expect(element(by.id('createOrEditListModal'))).not.toBeVisible()
-    await expect(element(by.id('userAvatarFallback'))).toExist()
-    // have to wait for the toast to clear
-    await waitFor(element(by.id('headerDropdownBtn')))
-      .toBeVisible()
-      .withTimeout(5000)
-  })
+  // DISABLED e2e environment is real finicky about avatar uploads -prf
+  // it('Set avi via the edit modlist modal', async () => {
+  //   await expect(element(by.id('userAvatarFallback'))).toExist()
+  //   await element(by.id('headerDropdownBtn')).tap()
+  //   await element(by.text('Edit list details')).tap()
+  //   await expect(element(by.id('createOrEditListModal'))).toBeVisible()
+  //   await element(by.id('changeAvatarBtn')).tap()
+  //   await element(by.text('Library')).tap()
+  //   await sleep(3e3)
+  //   await element(by.id('saveBtn')).tap()
+  //   await expect(element(by.id('createOrEditListModal'))).not.toBeVisible()
+  //   await expect(element(by.id('userAvatarImage'))).toExist()
+  //   // have to wait for the toast to clear
+  //   await waitFor(element(by.id('headerDropdownBtn')))
+  //     .toBeVisible()
+  //     .withTimeout(5000)
+  // })
+
+  // it('Remove avi via the edit modlist modal', async () => {
+  //   await expect(element(by.id('userAvatarImage'))).toExist()
+  //   await element(by.id('headerDropdownBtn')).tap()
+  //   await element(by.text('Edit list details')).tap()
+  //   await expect(element(by.id('createOrEditListModal'))).toBeVisible()
+  //   await element(by.id('changeAvatarBtn')).tap()
+  //   await element(by.text('Remove')).tap()
+  //   await element(by.id('saveBtn')).tap()
+  //   await expect(element(by.id('createOrEditListModal'))).not.toBeVisible()
+  //   await expect(element(by.id('userAvatarFallback'))).toExist()
+  //   // have to wait for the toast to clear
+  //   await waitFor(element(by.id('headerDropdownBtn')))
+  //     .toBeVisible()
+  //     .withTimeout(5000)
+  // })
 
   it('Delete the modlist', async () => {
     await element(by.id('headerDropdownBtn')).tap()
diff --git a/__e2e__/tests/profile-screen.test.ts b/__e2e__/tests/profile-screen.test.ts
index b4624e456..7ff43642f 100644
--- a/__e2e__/tests/profile-screen.test.ts
+++ b/__e2e__/tests/profile-screen.test.ts
@@ -147,7 +147,7 @@ describe('Profile screen', () => {
     const posts = by.id('feedItem-by-bob.test')
     await expect(
       element(by.id('likeCount').withAncestor(posts)).atIndex(0),
-    ).toHaveText('0')
+    ).not.toExist()
     await element(by.id('likeBtn').withAncestor(posts)).atIndex(0).tap()
     await expect(
       element(by.id('likeCount').withAncestor(posts)).atIndex(0),
@@ -155,14 +155,14 @@ describe('Profile screen', () => {
     await element(by.id('likeBtn').withAncestor(posts)).atIndex(0).tap()
     await expect(
       element(by.id('likeCount').withAncestor(posts)).atIndex(0),
-    ).toHaveText('0')
+    ).not.toExist()
   })
 
   it('Can repost posts', async () => {
     const posts = by.id('feedItem-by-bob.test')
     await expect(
       element(by.id('repostCount').withAncestor(posts)).atIndex(0),
-    ).toHaveText('0')
+    ).not.toExist()
     await element(by.id('repostBtn').withAncestor(posts)).atIndex(0).tap()
     await expect(element(by.id('repostModal'))).toBeVisible()
     await element(by.id('repostBtn').withAncestor(by.id('repostModal'))).tap()
@@ -176,7 +176,7 @@ describe('Profile screen', () => {
     await expect(element(by.id('repostModal'))).not.toBeVisible()
     await expect(
       element(by.id('repostCount').withAncestor(posts)).atIndex(0),
-    ).toHaveText('0')
+    ).not.toExist()
   })
 
   it('Can report posts', async () => {
diff --git a/__e2e__/tests/self-labeling.test.ts b/__e2e__/tests/self-labeling.test.ts
index f629f91a8..bba8ed484 100644
--- a/__e2e__/tests/self-labeling.test.ts
+++ b/__e2e__/tests/self-labeling.test.ts
@@ -28,6 +28,7 @@ describe('Self-labeling', () => {
     await element(by.id('composerPublishBtn')).tap()
     await expect(element(by.id('composeFAB'))).toBeVisible()
     const posts = by.id('feedItem-by-alice.test')
+    await element(by.id('e2eRefreshHome')).tap()
     await expect(
       element(by.id('contentHider-embed').withAncestor(posts)).atIndex(0),
     ).toExist()
diff --git a/__e2e__/tests/text-verification.test.ts b/__e2e__/tests/text-verification.test.ts
index 3c556c239..79b14aeca 100644
--- a/__e2e__/tests/text-verification.test.ts
+++ b/__e2e__/tests/text-verification.test.ts
@@ -18,9 +18,10 @@ describe('Create account', () => {
     await device.takeScreenshot('1- opened create account screen')
     await element(by.id('selectServiceButton')).tap()
     await device.takeScreenshot('2- selected other server')
+    await element(by.id('customSelectBtn')).tap()
     await element(by.id('customServerTextInput')).typeText(service)
     await element(by.id('customServerTextInput')).tapReturnKey()
-    await element(by.id('customServerSelectBtn')).tap()
+    await element(by.id('doneBtn')).tap()
     await device.takeScreenshot('3- input test server URL')
     await element(by.id('emailInput')).typeText('text-verification@test.com')
     await element(by.id('passwordInput')).typeText('hunter2')
@@ -40,13 +41,7 @@ describe('Create account', () => {
 
     await element(by.id('nextBtn')).tap()
 
-    await expect(element(by.id('welcomeOnboarding'))).toBeVisible()
-    await element(by.id('continueBtn')).tap()
-    await expect(element(by.id('recommendedFeedsOnboarding'))).toBeVisible()
-    await element(by.id('continueBtn')).tap()
-    await expect(element(by.id('recommendedFollowsOnboarding'))).toBeVisible()
-    await element(by.id('continueBtn')).tap()
-    await expect(element(by.id('homeScreen'))).toBeVisible()
+    await expect(element(by.id('onboardingInterests'))).toBeVisible()
   })
 
   it('failed text verification correctly goes back to the code input screen', async () => {
@@ -57,9 +52,10 @@ describe('Create account', () => {
     await device.takeScreenshot('1- opened create account screen')
     await element(by.id('selectServiceButton')).tap()
     await device.takeScreenshot('2- selected other server')
+    await element(by.id('customSelectBtn')).tap()
     await element(by.id('customServerTextInput')).typeText(service)
     await element(by.id('customServerTextInput')).tapReturnKey()
-    await element(by.id('customServerSelectBtn')).tap()
+    await element(by.id('doneBtn')).tap()
     await device.takeScreenshot('3- input test server URL')
     await element(by.id('emailInput')).typeText('text-verification2@test.com')
     await element(by.id('passwordInput')).typeText('hunter2')
diff --git a/__e2e__/tests/thread-screen.test.ts b/__e2e__/tests/thread-screen.test.ts
index e3cff12c9..646c828fd 100644
--- a/__e2e__/tests/thread-screen.test.ts
+++ b/__e2e__/tests/thread-screen.test.ts
@@ -49,7 +49,7 @@ describe('Thread screen', () => {
     const post = by.id('postThreadItem-by-carla.test')
     await expect(
       element(by.id('likeCount').withAncestor(post)).atIndex(0),
-    ).toHaveText('0')
+    ).not.toExist()
     await element(by.id('likeBtn').withAncestor(post)).atIndex(0).tap()
     await expect(
       element(by.id('likeCount').withAncestor(post)).atIndex(0),
@@ -57,7 +57,7 @@ describe('Thread screen', () => {
     await element(by.id('likeBtn').withAncestor(post)).atIndex(0).tap()
     await expect(
       element(by.id('likeCount').withAncestor(post)).atIndex(0),
-    ).toHaveText('0')
+    ).not.toExist()
   })
 
   it('Can repost the root post', async () => {
@@ -85,7 +85,7 @@ describe('Thread screen', () => {
     const post = by.id('postThreadItem-by-carla.test')
     await expect(
       element(by.id('repostCount').withAncestor(post)).atIndex(0),
-    ).toHaveText('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()
@@ -99,7 +99,7 @@ describe('Thread screen', () => {
     await expect(element(by.id('repostModal'))).not.toBeVisible()
     await expect(
       element(by.id('repostCount').withAncestor(post)).atIndex(0),
-    ).toHaveText('0')
+    ).not.toExist()
   })
 
   it('Can report the root post', async () => {
diff --git a/__e2e__/util.ts b/__e2e__/util.ts
index 8c47406c0..a7869a2e1 100644
--- a/__e2e__/util.ts
+++ b/__e2e__/util.ts
@@ -56,9 +56,10 @@ export async function login(
   if (takeScreenshots) {
     await device.takeScreenshot('2- opened service selector')
   }
+  await element(by.id('customSelectBtn')).tap()
   await element(by.id('customServerTextInput')).typeText(service)
   await element(by.id('customServerTextInput')).tapReturnKey()
-  await element(by.id('customServerSelectBtn')).tap()
+  await element(by.id('doneBtn')).tap()
   if (takeScreenshots) {
     await device.takeScreenshot('3- input custom service')
   }
diff --git a/src/lib/media/picker.e2e.tsx b/src/lib/media/picker.e2e.tsx
index 096667479..d7b608041 100644
--- a/src/lib/media/picker.e2e.tsx
+++ b/src/lib/media/picker.e2e.tsx
@@ -5,12 +5,13 @@ import {compressIfNeeded} from './manip'
 
 let _imageCounter = 0
 async function getFile() {
-  const files = await RNFS.readDir(
+  let files = await RNFS.readDir(
     RNFS.LibraryDirectoryPath.split('/')
       .slice(0, -5)
       .concat(['Media', 'DCIM', '100APPLE'])
       .join('/'),
   )
+  files = files.filter(file => file.path.endsWith('.JPG'))
   const file = files[_imageCounter++ % files.length]
   return await compressIfNeeded({
     path: file.path,
diff --git a/src/screens/Onboarding/StepInterests/index.tsx b/src/screens/Onboarding/StepInterests/index.tsx
index 5440dcd2b..4eaf0366e 100644
--- a/src/screens/Onboarding/StepInterests/index.tsx
+++ b/src/screens/Onboarding/StepInterests/index.tsx
@@ -139,7 +139,7 @@ export function StepInterests() {
   )
 
   return (
-    <View style={[a.align_start]}>
+    <View style={[a.align_start]} testID="onboardingInterests">
       <IconCircle
         icon={isError ? EmojiSad : Hashtag}
         style={[
diff --git a/src/state/models/media/image.e2e.ts b/src/state/models/media/image.e2e.ts
new file mode 100644
index 000000000..ccabd5047
--- /dev/null
+++ b/src/state/models/media/image.e2e.ts
@@ -0,0 +1,146 @@
+import {Image as RNImage} from 'react-native-image-crop-picker'
+import {makeAutoObservable} from 'mobx'
+import {POST_IMG_MAX} from 'lib/constants'
+import {ActionCrop} from 'expo-image-manipulator'
+import {Position} from 'react-avatar-editor'
+import {Dimensions} from 'lib/media/types'
+
+export interface ImageManipulationAttributes {
+  aspectRatio?: '4:3' | '1:1' | '3:4' | 'None'
+  rotate?: number
+  scale?: number
+  position?: Position
+  flipHorizontal?: boolean
+  flipVertical?: boolean
+}
+
+export class ImageModel implements Omit<RNImage, 'size'> {
+  path: string
+  mime = 'image/jpeg'
+  width: number
+  height: number
+  altText = ''
+  cropped?: RNImage = undefined
+  compressed?: RNImage = undefined
+
+  // Web manipulation
+  prev?: RNImage
+  attributes: ImageManipulationAttributes = {
+    aspectRatio: 'None',
+    scale: 1,
+    flipHorizontal: false,
+    flipVertical: false,
+    rotate: 0,
+  }
+  prevAttributes: ImageManipulationAttributes = {}
+
+  constructor(image: Omit<RNImage, 'size'>) {
+    makeAutoObservable(this)
+
+    this.path = image.path
+    this.width = image.width
+    this.height = image.height
+  }
+
+  setRatio(aspectRatio: ImageManipulationAttributes['aspectRatio']) {
+    this.attributes.aspectRatio = aspectRatio
+  }
+
+  setRotate(degrees: number) {
+    this.attributes.rotate = degrees
+    this.manipulate({})
+  }
+
+  flipVertical() {
+    this.attributes.flipVertical = !this.attributes.flipVertical
+    this.manipulate({})
+  }
+
+  flipHorizontal() {
+    this.attributes.flipHorizontal = !this.attributes.flipHorizontal
+    this.manipulate({})
+  }
+
+  get ratioMultipliers() {
+    return {
+      '4:3': 4 / 3,
+      '1:1': 1,
+      '3:4': 3 / 4,
+      None: this.width / this.height,
+    }
+  }
+
+  getUploadDimensions(
+    dimensions: Dimensions,
+    maxDimensions: Dimensions = POST_IMG_MAX,
+    as: ImageManipulationAttributes['aspectRatio'] = 'None',
+  ) {
+    const {width, height} = dimensions
+    const {width: maxWidth, height: maxHeight} = maxDimensions
+
+    return width < maxWidth && height < maxHeight
+      ? {
+          width,
+          height,
+        }
+      : this.getResizedDimensions(as, POST_IMG_MAX.width)
+  }
+
+  getResizedDimensions(
+    as: ImageManipulationAttributes['aspectRatio'] = 'None',
+    maxSide: number,
+  ) {
+    const ratioMultiplier = this.ratioMultipliers[as]
+
+    if (ratioMultiplier === 1) {
+      return {
+        height: maxSide,
+        width: maxSide,
+      }
+    }
+
+    if (ratioMultiplier < 1) {
+      return {
+        width: maxSide * ratioMultiplier,
+        height: maxSide,
+      }
+    }
+
+    return {
+      width: maxSide,
+      height: maxSide / ratioMultiplier,
+    }
+  }
+
+  setAltText(altText: string) {
+    this.altText = altText.trim()
+  }
+
+  // Only compress prior to upload
+  async compress() {
+    // do nothing
+  }
+
+  // Mobile
+  async crop() {
+    // do nothing
+  }
+
+  // Web manipulation
+  async manipulate(
+    _attributes: {
+      crop?: ActionCrop['crop']
+    } & ImageManipulationAttributes,
+  ) {
+    // do nothing
+  }
+
+  resetCropped() {
+    this.manipulate({})
+  }
+
+  previous() {
+    this.cropped = this.prev
+    this.attributes = this.prevAttributes
+  }
+}
diff --git a/src/view/com/auth/create/Step1.tsx b/src/view/com/auth/create/Step1.tsx
index 94e03ff7a..a7abbfaa8 100644
--- a/src/view/com/auth/create/Step1.tsx
+++ b/src/view/com/auth/create/Step1.tsx
@@ -88,7 +88,7 @@ export function Step1({
               style={[pal.textLight, {marginLeft: 14}]}
             />
             <TouchableOpacity
-              testID="loginSelectServiceButton"
+              testID="selectServiceButton"
               style={{
                 flexDirection: 'row',
                 flex: 1,
diff --git a/src/view/com/util/post-ctrls/PostCtrls.tsx b/src/view/com/util/post-ctrls/PostCtrls.tsx
index cc12467cf..bd21ddda2 100644
--- a/src/view/com/util/post-ctrls/PostCtrls.tsx
+++ b/src/view/com/util/post-ctrls/PostCtrls.tsx
@@ -208,7 +208,7 @@ let PostCtrls = ({
       {big && (
         <View style={styles.ctrlBig}>
           <TouchableOpacity
-            testID="likeBtn"
+            testID="shareBtn"
             style={[styles.btn]}
             onPress={onShare}
             accessibilityRole="button"