Skip to content
5 changes: 5 additions & 0 deletions .maestro/helpers/logout.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ tags:
- tapOn:
id: 'sidebar-settings'

- scrollUntilVisible:
element:
id: 'settings-logout'
direction: DOWN

- assertVisible:
id: 'settings-logout'

Expand Down
44 changes: 44 additions & 0 deletions .maestro/tests/onboarding/servers-history-small-screen.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .maestro/tests/room/reaction-picker-small-screen.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
appId: chat.rocket.reactnative
appId: ${APP_ID}
name: Reaction Picker Small Screen
jsEngine: graaljs
onFlowStart:
Expand Down
47 changes: 47 additions & 0 deletions .maestro/tests/room/servers-list-small-screen.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions app/containers/ActionSheet/useActionSheetDetents.test.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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', () => {
Expand Down
2 changes: 1 addition & 1 deletion app/containers/ActionSheet/useActionSheetDetents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
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)
Expand All @@ -90,5 +90,5 @@
}

return { detents, maxHeight, scrollEnabled };
}, [bottomInset, contentHeight, hasCancel, headerHeight, itemHeight, optionsLength, snaps, windowHeight]);

Check warning on line 93 in app/containers/ActionSheet/useActionSheetDetents.ts

View workflow job for this annotation

GitHub Actions / format

React Hook useMemo has a missing dependency: 'CANCEL_HEIGHT'. Either include it or remove the dependency array

Check warning on line 93 in app/containers/ActionSheet/useActionSheetDetents.ts

View workflow job for this annotation

GitHub Actions / ESLint and Test / run-eslint-and-test

React Hook useMemo has a missing dependency: 'CANCEL_HEIGHT'. Either include it or remove the dependency array
}
Loading