Front: Fix unit test w/ React Paper integration
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import React from 'react';
|
||||
import TestRenderer from 'react-test-renderer';
|
||||
|
||||
import App from './App';
|
||||
import { AppContent } from './App';
|
||||
|
||||
describe('<App />', () => {
|
||||
describe('<AppContent />', () => {
|
||||
it('has 1 child', () => {
|
||||
const tree = TestRenderer.create(<App />).toJSON();
|
||||
const tree = TestRenderer.create(<AppContent />).toJSON();
|
||||
expect(tree.children.length).toBe(10);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -9,9 +9,8 @@ const ExampleBox = (props: { textColor: ColorValue, backgroundColor: ColorValue
|
||||
</View>
|
||||
)
|
||||
|
||||
export default function App() {
|
||||
export function AppContent() {
|
||||
return (
|
||||
<PaperProvider>
|
||||
<View style={styles.container}>
|
||||
<ExampleBox backgroundColor={ColorTheme.primary} textColor={ColorTheme.onPrimary}/>
|
||||
<ExampleBox backgroundColor={ColorTheme.primaryVariant} textColor={ColorTheme.onPrimary}/>
|
||||
@@ -31,6 +30,13 @@ export default function App() {
|
||||
/>
|
||||
<StatusBar style="auto" />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<PaperProvider>
|
||||
<AppContent/>
|
||||
</PaperProvider>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user