feat(release): prepare 1.1.0 candidate
This commit is contained in:
parent
5a34f66981
commit
5205dcdfa9
736 changed files with 115667 additions and 12203 deletions
43
apps/mobile-rn/__tests__/auth-privacy-ui.test.tsx
Normal file
43
apps/mobile-rn/__tests__/auth-privacy-ui.test.tsx
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import React from 'react'
|
||||
import { act, create } from 'react-test-renderer'
|
||||
|
||||
const mockRetry = jest.fn()
|
||||
|
||||
jest.mock('@d3ro/i18n', () => ({
|
||||
useI18n: () => ({ t: (key: string) => key }),
|
||||
I18nProvider: ({ children }: { children: React.ReactNode }) => children,
|
||||
}))
|
||||
jest.mock('../src/lib/preferences-context', () => ({
|
||||
useMobilePreferences: () => ({
|
||||
palette: {
|
||||
bg: { app: '#000' },
|
||||
text: { primary: '#fff', muted: '#999', onAccent: '#000' },
|
||||
accent: { main: '#fc0' },
|
||||
},
|
||||
}),
|
||||
MobilePreferencesProvider: ({ children }: { children: React.ReactNode }) => children,
|
||||
}))
|
||||
|
||||
import { PrivacyCleanupBlockedScreen } from '../App'
|
||||
|
||||
describe('auth privacy cleanup failure UI', () => {
|
||||
it('blocks app content, exposes no raw error, and offers an accessible retry', async () => {
|
||||
mockRetry.mockReset().mockResolvedValue(undefined)
|
||||
let renderer: ReturnType<typeof create>
|
||||
await act(async () => {
|
||||
renderer = create(<PrivacyCleanupBlockedScreen onRetry={mockRetry} />)
|
||||
await Promise.resolve()
|
||||
})
|
||||
expect(renderer!.root.findByProps({ testID: 'auth-privacy-cleanup-blocked' })).toBeTruthy()
|
||||
const retry = renderer!.root.findByProps({ testID: 'auth-privacy-cleanup-retry' })
|
||||
expect(retry.props.accessibilityLabel).toBe('mobile.auth.localDataCleanupRetry')
|
||||
|
||||
await act(async () => {
|
||||
retry.props.onPress()
|
||||
await Promise.resolve()
|
||||
})
|
||||
expect(mockRetry).toHaveBeenCalledTimes(1)
|
||||
expect(renderer!.root.findAllByProps({ children: 'private filesystem path' })).toHaveLength(0)
|
||||
act(() => renderer!.unmount())
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue