1
- import tree from '../app/src/tree/TreeChart' ;
1
+ import TreeChart from '../app/src/tree/TreeChart' ;
2
+ import React , { useReducer } from 'react' ;
3
+ import '@testing-library/jest-dom' ;
4
+ import { render , fireEvent , cleanup , screen } from '@testing-library/react' ;
2
5
import { StateContext } from '../app/src/context/context' ;
3
- import { initialState , HTMLTypes } from '../app/src/context/initialState' ;
4
-
5
- xdescribe ( 'Testing the tree functionality' , function ( ) {
6
-
7
- //TEST 'ADD COMPONENT TO PAGE'
8
- xdescribe ( 'ADD COMPONENT TO PAGE' , ( ) => {
9
- it ( 'should add a new reusable component to page' , ( ) => {
10
-
11
- } )
12
- } )
13
-
14
- //TEST 'ADD COMPONENT TO ANOTHER COMPONENT'
15
- xdescribe ( 'ADD COMPONENT TO ANOTHER COMPONENT' , ( ) => {
16
- it ( 'should add child component to top-level component' , ( ) => {
17
-
18
- } )
19
- } )
20
-
21
- //TEST 'ADD A HTML ELEMENT TO A PAGE'
22
- xdescribe ( 'ADD CHILD TO COMPONENT' , ( ) => {
23
- it ( 'should add child component to top-level component' , ( ) => {
24
-
25
- } )
26
- } )
27
-
28
- //TEST 'ADD A HTML ELEMENT TO A COMPONENT'
29
- xdescribe ( '' , ( ) => {
30
- it ( '' , ( ) => {
31
-
32
- } )
33
- } )
6
+ import { State , Action , Component , ChildElement } from '../app/src/interfaces/Interfaces' ;
7
+ import initialState from '../app/src/context/initialState' ;
8
+ import reducer from '../app/src/reducers/componentReducer' ;
9
+
10
+
11
+ function Test ( ) {
12
+ const [ state , dispatch ] = useReducer ( reducer , initialState ) ;
13
+ return (
14
+ < StateContext . Provider value = { [ state , dispatch ] } >
15
+ < TreeChart />
16
+ </ StateContext . Provider >
17
+ ) ;
18
+ }
19
+
20
+ test ( 'Test the tree functionality' , function ( ) {
21
+ render ( < Test /> ) ;
22
+
23
+ screen . getByRole ( '' ) ;
24
+
25
+ { /*TEST 'ADD COMPONENT TO PAGE' */ }
26
+
27
+ { /* TEST 'ADD COMPONENT TO ANOTHER COMPONENT'
28
+ xdescribe('ADD COMPONENT TO ANOTHER COMPONENT', () => {
29
+ it('should add child component to top-level component', () => {
30
+
31
+ })
32
+ })
33
+
34
+ TEST 'ADD A HTML ELEMENT TO A PAGE'
35
+ xdescribe('ADD CHILD TO COMPONENT', () => {
36
+ it('should add child component to top-level component', () => {
37
+
38
+ })
39
+ })
40
+
41
+ TEST 'ADD A HTML ELEMENT TO A COMPONENT'
42
+ xdescribe('', () => {
43
+ it('', () => {
44
+
45
+ })
46
+ }) */ }
34
47
35
48
} )
0 commit comments