Front: Test Views

This commit is contained in:
Arthi-chaud
2022-08-07 12:51:53 +02:00
parent ae712ae850
commit f135d20208
3 changed files with 26 additions and 11 deletions
-11
View File
@@ -1,11 +0,0 @@
import React from 'react';
import TestRenderer from 'react-test-renderer';
import { AppContent } from './App';
describe('<AppContent />', () => {
it('has 1 child', () => {
const tree = TestRenderer.create(<AppContent />).toJSON();
expect(tree.children.length).toBe(6);
});
});
+13
View File
@@ -0,0 +1,13 @@
import React from 'react';
import { Provider } from 'react-redux';
import TestRenderer from 'react-test-renderer';
import store from '../state/Store';
import AuthenticationView from '../views/AuthenticationView';
describe('<AuthenticationView />', () => {
it('has 3 children', () => {
const tree = TestRenderer.create(<Provider store={store}><AuthenticationView /></Provider>).toJSON();
expect(tree.children.length).toBe(3);
});
});
+13
View File
@@ -0,0 +1,13 @@
import React from 'react';
import { Provider } from 'react-redux';
import TestRenderer from 'react-test-renderer';
import store from '../state/Store';
import HomeView from '../views/HomeView';
describe('<HomeView />', () => {
it('has 2 children', () => {
const tree = TestRenderer.create(<Provider store={store}><HomeView /></Provider>).toJSON();
expect(tree.children.length).toBe(2);
});
});