Skip to content

Commit 4a425bf

Browse files
committed
tree testing
2 parents 3c9215c + d6924a6 commit 4a425bf

File tree

3 files changed

+48
-35
lines changed

3 files changed

+48
-35
lines changed

__tests__/tree.test.tsx

Lines changed: 45 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,48 @@
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';
25
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+
}) */}
3447

3548
})

app/electron/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ app.on('web-contents-created', (event, contents) => {
248248
selfHost,
249249
'http://localhost:5000',
250250
'https://reactype.herokuapp.com',
251-
'https://github.com/',
251+
'https://github.com',
252252
'https://nextjs.org',
253253
'https://developer.mozilla.org',
254254
'https://www.facebook.com',
@@ -439,7 +439,7 @@ ipcMain.on('github', event => {
439439
})
440440

441441
github.webContents.on('did-get-redirect-request', (e, oldUrl, newUrl) => handleCallback(newUrl));
442-
442+
443443
// Reset the authWindow on close
444444
github.on('close', () => authWindow = null, false);
445445

app/electron/menu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var MenuBuilder = function(mainWindow, appName) {
2727
contextIsolation: true,
2828
enableRemoteModule: false,
2929
zoomFactor: 1.0,
30-
// devTools: false
30+
devTools: false
3131
}
3232
});
3333
tutorial.loadURL(`http://localhost:8080/#/tutorial`);

0 commit comments

Comments
 (0)