diff --git a/setup.ts b/setup.ts
index 8640f2ee..fe674494 100644
--- a/setup.ts
+++ b/setup.ts
@@ -1,4 +1,3 @@
-import '@testing-library/react-native/extend-expect';
// react-hook form setup for testing
// @ts-ignore
global.window = {};
diff --git a/src/ui/button.test.tsx b/src/ui/button.test.tsx
index 875033cd..2d6d429b 100644
--- a/src/ui/button.test.tsx
+++ b/src/ui/button.test.tsx
@@ -1,5 +1,6 @@
/* eslint-disable max-lines-per-function */
import React from 'react';
+import { Text } from 'react-native';
import { cleanup, fireEvent, render, screen } from '@/core/test-utils';
@@ -9,9 +10,17 @@ afterEach(cleanup);
describe('Button component ', () => {
it('should render correctly ', () => {
- render();
+ render();
expect(screen.getByTestId('button')).toBeOnTheScreen();
});
+ it('should render correctly if we add explicit child ', () => {
+ render(
+
+ );
+ expect(screen.getByText('Custom child')).toBeOnTheScreen();
+ });
it('should render the label correctly', () => {
render();
expect(screen.getByTestId('button')).toBeOnTheScreen();
diff --git a/src/ui/input.test.tsx b/src/ui/input.test.tsx
index 565db139..026e662b 100644
--- a/src/ui/input.test.tsx
+++ b/src/ui/input.test.tsx
@@ -1,5 +1,6 @@
/* eslint-disable max-lines-per-function */
import React from 'react';
+import { I18nManager } from 'react-native';
import { cleanup, fireEvent, render, screen } from '@/core/test-utils';
@@ -12,6 +13,21 @@ describe('Input component ', () => {
render();
expect(screen.getByTestId('input')).toBeOnTheScreen();
});
+ it('should use the right direction for rtl layout', () => {
+ I18nManager.isRTL = true;
+ render();
+ expect(screen.getByTestId('input')).toHaveStyle({
+ writingDirection: 'rtl',
+ });
+ });
+
+ it('should use the right direction for ltr layout', () => {
+ I18nManager.isRTL = false;
+ render();
+ expect(screen.getByTestId('input')).toHaveStyle({
+ writingDirection: 'ltr',
+ });
+ });
it('should render the placeholder correctly ', () => {
render();