Front: Test Views
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user