feat(app): finish onboarding auth flow

This commit is contained in:
Timo Knuth
2026-07-06 14:32:20 +02:00
parent a1a3367ce4
commit 673ead2e3a
7 changed files with 708 additions and 817 deletions

View File

@@ -103,17 +103,17 @@ describe('StorageService', () => {
expect(result).toBe('en');
});
it('defaults to de when no language stored', async () => {
(AsyncStorage.getItem as jest.Mock).mockResolvedValue(null);
const result = await StorageService.getLanguage();
expect(result).toBe('de');
});
it('defaults to de on error', async () => {
(AsyncStorage.getItem as jest.Mock).mockRejectedValue(new Error('fail'));
const result = await StorageService.getLanguage();
expect(result).toBe('de');
});
it('defaults to en when no language stored', async () => {
(AsyncStorage.getItem as jest.Mock).mockResolvedValue(null);
const result = await StorageService.getLanguage();
expect(result).toBe('en');
});
it('defaults to en on error', async () => {
(AsyncStorage.getItem as jest.Mock).mockRejectedValue(new Error('fail'));
const result = await StorageService.getLanguage();
expect(result).toBe('en');
});
});
describe('saveLanguage', () => {
@@ -175,11 +175,11 @@ describe('StorageService', () => {
expect(result).toBe('Taylor');
});
it('falls back to default profile name when empty', async () => {
(AsyncStorage.getItem as jest.Mock).mockResolvedValue(' ');
const result = await StorageService.getProfileName();
expect(result).toBe('Alex Rivera');
});
it('falls back to default profile name when empty', async () => {
(AsyncStorage.getItem as jest.Mock).mockResolvedValue(' ');
const result = await StorageService.getProfileName();
expect(result).toBe('GreenLens User');
});
it('stores normalized profile name', async () => {
(AsyncStorage.setItem as jest.Mock).mockResolvedValue(undefined);