diff --git a/.maestro/helpers/logout.yaml b/.maestro/helpers/logout.yaml index ccc663c80a..70ddc19cfb 100644 --- a/.maestro/helpers/logout.yaml +++ b/.maestro/helpers/logout.yaml @@ -37,6 +37,11 @@ tags: - tapOn: id: 'sidebar-settings' +- scrollUntilVisible: + element: + id: 'settings-logout' + direction: DOWN + - assertVisible: id: 'settings-logout' diff --git a/.maestro/tests/onboarding/servers-history-small-screen.yaml b/.maestro/tests/onboarding/servers-history-small-screen.yaml new file mode 100644 index 0000000000..b3844e3dca --- /dev/null +++ b/.maestro/tests/onboarding/servers-history-small-screen.yaml @@ -0,0 +1,44 @@ +appId: ${APP_ID} +name: Servers History Small Screen +jsEngine: graaljs +onFlowStart: + - runFlow: '../../helpers/setup.yaml' +onFlowComplete: + - evalScript: ${output.utils.deleteCreatedUsers()} +tags: + - test-14 + - ios-only + +--- +- evalScript: ${output.user = output.utils.createUser()} + +- runFlow: + file: '../../helpers/login-with-deeplink.yaml' + env: + USERNAME: ${output.user.username} + PASSWORD: ${output.user.password} +- runFlow: '../../helpers/logout.yaml' + +# should fully render the Servers History action sheet on small screens +# (regression for small-screen ServersHistoryActionSheetContent on iPhone SE) +- extendedWaitUntil: + visible: + id: 'servers-history-button' + timeout: 60000 +- tapOn: + id: 'servers-history-button' +- waitForAnimationToEnd +- extendedWaitUntil: + visible: + id: 'action-sheet' + timeout: 60000 +- assertVisible: + id: 'servers-history-${output.data.server}' + +# tap the history item — would fail if it were clipped by the sheet bottom +- tapOn: + id: 'servers-history-${output.data.server}' +- extendedWaitUntil: + visible: + id: 'login-view-submit' + timeout: 60000 diff --git a/.maestro/tests/room/reaction-picker-small-screen.yaml b/.maestro/tests/room/reaction-picker-small-screen.yaml index f25910ac4a..aac33b961c 100644 --- a/.maestro/tests/room/reaction-picker-small-screen.yaml +++ b/.maestro/tests/room/reaction-picker-small-screen.yaml @@ -1,4 +1,4 @@ -appId: chat.rocket.reactnative +appId: ${APP_ID} name: Reaction Picker Small Screen jsEngine: graaljs onFlowStart: diff --git a/.maestro/tests/room/servers-list-small-screen.yaml b/.maestro/tests/room/servers-list-small-screen.yaml new file mode 100644 index 0000000000..685822b104 --- /dev/null +++ b/.maestro/tests/room/servers-list-small-screen.yaml @@ -0,0 +1,47 @@ +appId: ${APP_ID} +name: Servers List Small Screen +jsEngine: graaljs +onFlowStart: + - runFlow: '../../helpers/setup.yaml' +onFlowComplete: + - evalScript: ${output.utils.deleteCreatedUsers()} +tags: + - test-14 + - ios-only + +--- +- evalScript: ${output.user = output.utils.createUser()} + +- runFlow: + file: '../../helpers/login-with-deeplink.yaml' + env: + USERNAME: ${output.user.username} + PASSWORD: ${output.user.password} + +# should fully render the Workspaces action sheet on small screens +# (regression for small-screen ServersList — the Add Server button was cut off on iPhone SE) +- extendedWaitUntil: + visible: + id: 'rooms-list-header-servers-list-button' + timeout: 60000 +- tapOn: + id: 'rooms-list-header-servers-list-button' +- waitForAnimationToEnd +- extendedWaitUntil: + visible: + id: 'action-sheet' + timeout: 60000 +- extendedWaitUntil: + visible: + id: 'rooms-list-header-servers-list' + timeout: 60000 +- assertVisible: + id: 'rooms-list-header-server-add' + +# tap the Add Server button — would fail if it were clipped by the sheet bottom +- tapOn: + id: 'rooms-list-header-server-add' +- extendedWaitUntil: + visible: + id: 'new-server-view' + timeout: 60000 diff --git a/app/containers/ActionSheet/useActionSheetDetents.test.tsx b/app/containers/ActionSheet/useActionSheetDetents.test.tsx index 51be4312ff..63ddc6dddb 100644 --- a/app/containers/ActionSheet/useActionSheetDetents.test.tsx +++ b/app/containers/ActionSheet/useActionSheetDetents.test.tsx @@ -1,6 +1,6 @@ import { renderHook } from '@testing-library/react-native'; -import { useActionSheetDetents } from './useActionSheetDetents'; +import { HANDLE_HEIGHT, useActionSheetDetents } from './useActionSheetDetents'; describe('useActionSheetDetents', () => { const windowHeight = 1000; @@ -71,7 +71,7 @@ describe('useActionSheetDetents', () => { }) ); - expect(result.current.detents).toEqual([(300 + 50) / windowHeight]); + expect(result.current.detents).toEqual([(300 + 50 + HANDLE_HEIGHT) / windowHeight]); }); it('falls back to minimum height when no content or options', () => { diff --git a/app/containers/ActionSheet/useActionSheetDetents.ts b/app/containers/ActionSheet/useActionSheetDetents.ts index 7dd747fa93..e5c9eb543a 100644 --- a/app/containers/ActionSheet/useActionSheetDetents.ts +++ b/app/containers/ActionSheet/useActionSheetDetents.ts @@ -78,7 +78,7 @@ export function useActionSheetDetents({ detents = [heightToDetent(Math.round(measuredHeight), windowHeight)]; } } else if (contentHeight > 0) { - const rawContentDetent = (contentHeight + bottomInset) / windowHeight; + const rawContentDetent = (contentHeight + bottomInset + HANDLE_HEIGHT) / windowHeight; const contentDetent = Math.min( ACTION_SHEET_MAX_HEIGHT_FRACTION, Math.max(ACTION_SHEET_MIN_HEIGHT_FRACTION, rawContentDetent)