Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: chat.rocket.reactnative
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
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: chat.rocket.reactnative
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