diff --git a/app/(tabs)/__tests__/_layout.test.tsx b/app/(tabs)/__tests__/_layout.test.tsx
new file mode 100644
index 0000000..38c88c4
--- /dev/null
+++ b/app/(tabs)/__tests__/_layout.test.tsx
@@ -0,0 +1,18 @@
+import React from 'react';
+import { render } from '@testing-library/react-native';
+import TabLayout from '../_layout';
+
+describe('TabLayout Navbar Icons', () => {
+ const tabs = ['index', 'activites', 'carte', 'finances', 'journal', 'profil'];
+
+ tabs.forEach((tabName) => {
+ test(`doit définir un icon de navbar (tabBarIcon) pour la tab ${tabName}`, () => {
+ const { getByTestId } = render();
+ const screenElement = getByTestId(`tab-screen-${tabName}`);
+ const options = screenElement.props.options;
+
+ expect(options).toBeDefined();
+ expect(typeof options.tabBarIcon).toBe('function');
+ });
+ });
+});
diff --git a/app/(tabs)/__tests__/carte.test.tsx b/app/(tabs)/__tests__/carte.test.tsx
new file mode 100644
index 0000000..91dea5e
--- /dev/null
+++ b/app/(tabs)/__tests__/carte.test.tsx
@@ -0,0 +1,10 @@
+import React from 'react';
+import { render } from '@testing-library/react-native';
+import CarteScreen from '../carte';
+
+describe('CarteScreen', () => {
+ test('doit afficher correctement l\'écran de carte avec SafeAreaView de react-native-safe-area-context', () => {
+ const { getByTestId } = render();
+ expect(getByTestId('map-view-container')).toBeTruthy();
+ });
+});
diff --git a/app/(tabs)/_layout.tsx b/app/(tabs)/_layout.tsx
index 64e82c4..1e5cb75 100644
--- a/app/(tabs)/_layout.tsx
+++ b/app/(tabs)/_layout.tsx
@@ -1,5 +1,6 @@
import React from 'react';
import { Tabs } from 'expo-router';
+import { Ionicons } from '@expo/vector-icons';
import { colors } from '@/shared/constants/theme';
export default function TabLayout() {
@@ -21,6 +22,9 @@ export default function TabLayout() {
options={{
title: 'Sorties',
headerTitle: 'Mes Sorties',
+ tabBarIcon: ({ color, focused, size }) => (
+
+ ),
}}
/>
(
+
+ ),
}}
/>
(
+
+ ),
}}
/>
(
+
+ ),
}}
/>
(
+
+ ),
}}
/>
(
+
+ ),
}}
/>
diff --git a/app/(tabs)/carte.tsx b/app/(tabs)/carte.tsx
index e2ce21b..93931df 100644
--- a/app/(tabs)/carte.tsx
+++ b/app/(tabs)/carte.tsx
@@ -1,5 +1,6 @@
import React from 'react';
-import { View, StyleSheet, SafeAreaView, Alert } from 'react-native';
+import { View, StyleSheet, Alert } from 'react-native';
+import { SafeAreaView } from 'react-native-safe-area-context';
import { colors, spacing } from '@/shared/constants/theme';
import {
MapViewComponent,
diff --git a/jest.setup.js b/jest.setup.js
index 579ebfb..783d06c 100644
--- a/jest.setup.js
+++ b/jest.setup.js
@@ -1,4 +1,9 @@
// Mock Expo Router
+const React = require('react');
+const MockTabs = ({ children }: any) => React.createElement('Tabs', null, children);
+MockTabs.Screen = ({ name, options }: any) =>
+ React.createElement('Tabs.Screen', { testID: `tab-screen-${name}`, name, options });
+
jest.mock('expo-router', () => ({
useRouter: () => ({
push: jest.fn(),
@@ -8,7 +13,7 @@ jest.mock('expo-router', () => ({
useSearchParams: () => ({}),
usePathname: () => '/',
Link: 'Link',
- Tabs: 'Tabs',
+ Tabs: MockTabs,
Stack: 'Stack',
}));