Skip to content

Commit 42ef300

Browse files
committed
fix(android): createNativeModules
1 parent ed76867 commit 42ef300

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

android/src/main/java/com/effx/secureview/SecureViewPackage.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@ class SecureViewPackage : ReactPackage {
1212
viewManagers.add(SecureViewManager())
1313
return viewManagers
1414
}
15+
16+
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
17+
return emptyList()
18+
}
1519
}

src/__tests__/index.test.tsx

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,30 @@
1-
it.todo('write a test');
1+
import { render } from '@testing-library/react-native';
2+
import SecureView from './SecureView';
3+
4+
describe('SecureView', () => {
5+
it('renders without crashing', () => {
6+
const { getByTestId } = render(<SecureView testID="secure-view" />);
7+
expect(getByTestId('secure-view')).toBeTruthy();
8+
});
9+
10+
it('renders with enable prop set to true', () => {
11+
const { getByTestId } = render(
12+
<SecureView testID="secure-view" enable={true} />
13+
);
14+
expect(getByTestId('secure-view')).toBeTruthy();
15+
});
16+
17+
it('renders with enable prop set to false', () => {
18+
const { getByTestId } = render(
19+
<SecureView testID="secure-view" enable={false} />
20+
);
21+
expect(getByTestId('secure-view')).toBeTruthy();
22+
});
23+
24+
it('accepts standard View props', () => {
25+
const { getByTestId } = render(
26+
<SecureView testID="secure-view" style={{ backgroundColor: 'red' }} />
27+
);
28+
expect(getByTestId('secure-view')).toBeTruthy();
29+
});
30+
});

0 commit comments

Comments
 (0)