1- import { shallow } from 'enzyme' ;
1+ import { shallow , mount } from 'enzyme' ;
22import React from 'react' ;
33
4- describe ( 'Enzyme testing suite' , ( ) => {
4+ import MainContainer from '../app/src/containers/MainContainer' ;
5+ import BottomPanel from '../app/src/components/bottom/BottomPanel' ;
6+ import BottomTabs from '../app/src/components/bottom/BottomTabs' ;
7+ import CodePreview from '../app/src/components/bottom/CodePreview' ;
8+ import CanvasContainer from '../app/src/components/main/CanvasContainer' ;
9+ import Canvas from '../app/src/components/main/Canvas' ;
510
6- it ( 'renders snapshots, too' , ( ) => {
7- const wrapper = shallow ( < div >
8- < h1 > Hello, Enzyme!</ h1 >
9- </ div > )
10- expect ( wrapper ) . toMatchSnapshot ( )
11+
12+ describe ( 'Test the CanvasContainer component' , ( ) => {
13+ const target = shallow ( < CanvasContainer /> ) ;
14+ it ( 'Matches snapshot' , ( ) => {
15+ expect ( target ) . toMatchSnapshot ( )
16+ } )
17+ it ( 'Contains Canvas component' , ( ) => {
18+ expect ( target . contains ( < Canvas /> ) ) . toBe ( true ) ;
19+ } )
20+ } )
21+
22+ describe ( 'Test the MainContainer component' , ( ) => {
23+ const target = shallow ( < MainContainer /> ) ;
24+ it ( 'Contains CanvasContainer component' , ( ) => {
25+ expect ( target . contains ( < CanvasContainer /> ) ) . toBe ( true ) ;
26+ } )
27+ it ( 'Contains BottomPanel component' , ( ) => {
28+ expect ( target . contains ( < BottomPanel /> ) ) . toBe ( true ) ;
1129 } )
12- } )
30+ } )
31+
32+ describe ( 'Test the BottomTabs component' , ( ) => {
33+ const target = shallow ( < BottomTabs /> ) ;
34+ it ( 'Matches snapshot' , ( ) => {
35+ expect ( target ) . toMatchSnapshot ( )
36+ } )
37+ it ( 'Contains a CodePreview component' , ( ) => {
38+ expect ( target . contains ( < CodePreview /> ) ) . toBe ( true ) ;
39+ } )
40+ } )
41+
0 commit comments