-
Notifications
You must be signed in to change notification settings - Fork 1.4k
regression: lock screen no longer appears full screen #7118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
59f925b
Remove justifyContent and alignItems from container...
Rohit3523 913bf14
Add story and unit test
Rohit3523 36dd0f5
chore: format code and fix lint issues
Rohit3523 8cec2f5
rerun ci
Rohit3523 efd7f1e
chore: format code and fix lint issues
Rohit3523 46530b4
revert
Rohit3523 4051de8
Merge branch 'modal-container-style' of https://github.com/RocketChat…
Rohit3523 9c72bee
Merge branch 'develop' into modal-container-style
Rohit3523 243123f
test update
Rohit3523 5652633
Merge branch 'modal-container-style' of https://github.com/RocketChat…
Rohit3523 2d6bc8c
test update
Rohit3523 fb4389e
chore: format code and fix lint issues
Rohit3523 a156f1c
rerun ci
Rohit3523 8cfe324
revert
Rohit3523 f5458ec
Merge branch 'modal-container-style' of https://github.com/RocketChat…
Rohit3523 a73fbe4
Story gor change passcode view and screen locked view
Rohit3523 5559ad6
chore: format code and fix lint issues
Rohit3523 7c5b817
format
Rohit3523 77943cd
Merge branch 'modal-container-style' of https://github.com/RocketChat…
Rohit3523 9dc2bec
Merge branch 'develop' into modal-container-style
Rohit3523 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| import React, { useRef } from 'react'; | ||
| import { View } from 'react-native'; | ||
|
|
||
| import Base, { type IBase } from '.'; | ||
| import { TYPE } from '../constants'; | ||
|
|
||
| export default { | ||
| title: 'Passcode/Base' | ||
| }; | ||
|
|
||
| const PasscodeBase = ({ ...props }) => { | ||
| const ref = useRef<IBase>(null); | ||
| return <Base ref={ref} type={TYPE.CHOOSE} title='Create Passcode' onEndProcess={() => {}} {...props} />; | ||
| }; | ||
|
|
||
| export const ChooseType = () => ( | ||
| <View style={{ flex: 1 }}> | ||
| <PasscodeBase type={TYPE.CHOOSE} title='Create Passcode' /> | ||
| </View> | ||
| ); | ||
|
|
||
| export const ConfirmType = () => ( | ||
| <View style={{ flex: 1 }}> | ||
| <PasscodeBase type={TYPE.CONFIRM} title='Confirm Passcode' previousPasscode='123456' onError={() => {}} /> | ||
| </View> | ||
| ); | ||
|
|
||
| export const EnterType = () => ( | ||
| <View style={{ flex: 1 }}> | ||
| <PasscodeBase type={TYPE.ENTER} title='Enter Passcode' /> | ||
| </View> | ||
| ); | ||
|
|
||
| export const WithSubtitle = () => ( | ||
| <View style={{ flex: 1 }}> | ||
| <PasscodeBase type={TYPE.CHOOSE} title='Create Passcode' subtitle='This passcode will protect your data' /> | ||
| </View> | ||
| ); | ||
|
|
||
| export const WithBiometry = () => ( | ||
| <View style={{ flex: 1 }}> | ||
| <PasscodeBase type={TYPE.ENTER} title='Enter Passcode' showBiometry onBiometryPress={() => {}} /> | ||
| </View> | ||
| ); | ||
|
|
||
| export const EnterWithSubtitleAndBiometry = () => ( | ||
| <View style={{ flex: 1 }}> | ||
| <PasscodeBase | ||
| type={TYPE.ENTER} | ||
| title='Unlock App' | ||
| subtitle='Authentication required' | ||
| showBiometry | ||
| onBiometryPress={() => {}} | ||
| /> | ||
| </View> | ||
| ); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| import React, { createRef } from 'react'; | ||
| import { render } from '@testing-library/react-native'; | ||
|
|
||
| import { generateSnapshots } from '../../../../.rnstorybook/generateSnapshots'; | ||
| import Base, { type IBase } from '.'; | ||
| import { TYPE } from '../constants'; | ||
| import * as stories from './Base.stories'; | ||
|
|
||
| const onEndProcessMock = jest.fn(); | ||
|
|
||
| const TestBase = ({ ...props }) => { | ||
| const ref = createRef<IBase>(); | ||
| return <Base ref={ref} type={TYPE.ENTER} title='Test Title' onEndProcess={onEndProcessMock} {...props} />; | ||
| }; | ||
|
|
||
| describe('Base Passcode Component', () => { | ||
| beforeEach(() => { | ||
| onEndProcessMock.mockClear(); | ||
| }); | ||
|
|
||
| test('should render with title', () => { | ||
| const { getByText } = render(<TestBase title='Enter Passcode' />); | ||
| expect(getByText('Enter Passcode')).toBeTruthy(); | ||
| }); | ||
|
|
||
| test('should render with subtitle when provided', () => { | ||
| const { getByText } = render(<TestBase title='Enter Passcode' subtitle='Authentication required' />); | ||
| expect(getByText('Authentication required')).toBeTruthy(); | ||
| }); | ||
|
|
||
| test('should not render subtitle when not provided', () => { | ||
| const { queryByText } = render(<TestBase title='Enter Passcode' />); | ||
| expect(queryByText('Authentication required')).toBeNull(); | ||
| }); | ||
|
|
||
| test('should expose ref methods', () => { | ||
| const ref = createRef<IBase>(); | ||
| render(<Base ref={ref} type={TYPE.ENTER} title='Enter Passcode' onEndProcess={onEndProcessMock} />); | ||
| expect(ref.current?.clearPasscode).toBeDefined(); | ||
| expect(ref.current?.wrongPasscode).toBeDefined(); | ||
| expect(ref.current?.animate).toBeDefined(); | ||
| }); | ||
|
|
||
| test('should render biometry button when showBiometry is true', () => { | ||
| const { getByTestId } = render(<TestBase type={TYPE.ENTER} title='Enter Passcode' showBiometry onBiometryPress={() => {}} />); | ||
| expect(getByTestId('biometry-button')).toBeTruthy(); | ||
| }); | ||
|
|
||
| test('should render all passcode buttons with testIDs', () => { | ||
| const { getByTestId } = render(<TestBase type={TYPE.ENTER} title='Enter Passcode' />); | ||
| // Number buttons 0-9 | ||
| for (let i = 0; i <= 9; i++) { | ||
| expect(getByTestId(`passcode-button-${i}`)).toBeTruthy(); | ||
| } | ||
| // backspace button | ||
| expect(getByTestId('passcode-button-backspace')).toBeTruthy(); | ||
| }); | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| }); | ||
|
|
||
| generateSnapshots(stories); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.