Skip to content

Commit 94b4946

Browse files
committed
UI components cleaned up, package.json keywords updated, basic test case format added tbc
1 parent d6b3341 commit 94b4946

File tree

6 files changed

+56
-83
lines changed

6 files changed

+56
-83
lines changed

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
},
1313
"keywords": [
1414
"react",
15-
"time",
16-
"time travel",
15+
"useState",
16+
"state",
17+
"debug",
18+
"react dev tool",
1719
"reactime"
1820
],
1921
"repository": {

src/app/__tests__/Chart.test.jsx

Lines changed: 50 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,50 @@
1-
const TestRunner = require("jest-runner")
2-
3-
// Unit Test Cases for Charts
4-
// description: lifecycle methods
5-
// Component should call make3dTree upon mounting
6-
// object 'root' should be a deep clone of the snapshot
7-
// i.e.: this.props.snapshot !== root
8-
9-
// description: maked3Tree
10-
// Should call function 'removed3tree' only once
11-
// Should call appropriate function upon triggering a certain event on the tooltip div
12-
// i.e.:
13-
// 'mouseover' event -> 'tipMouseover' function
14-
// 'mouseout' event -> 'tipMouseout' function
15-
// Should call appropriate function upon triggering a certain event on a node (nested under the 'update' function)
16-
// i.e.:
17-
// 'mouseover' event -> 'mouseover' function
18-
// 'mouseout' event -> 'mouseout' function
19-
// 'click' event -> 'click' function
20-
// Should call function 'update' at least once
21-
22-
describe('placeholder', () => {
23-
xit('placeholder for tests', () => {
24-
expect(1+1).toEqual(2);
25-
})
26-
})
1+
import React from 'react';
2+
import Chart from '../components/Chart';
3+
import testRunner from 'jest-runner';
4+
5+
// Unit test cases for d3 functionality
6+
// Test the life cycle methods in Chart
7+
describe('Life cycle methods in Chart', () => {
8+
it('should call maked3Tree upon mounting', () => {
9+
// Component should call maked3Tree upon mounting
10+
// Use the mock function + .toBeCalled()
11+
// Test the method in the component
12+
});
13+
});
14+
15+
// Test the root object and hierarchy
16+
describe('Root object', () => {
17+
it('should be a deep clone of the hierarchy', () => {
18+
// object 'root' should be a deep clone of the hierarchy
19+
// create an empty object to mimic root
20+
// i.e.: this.props.hierarchy !== root
21+
// expect to !== this.props.hierarchy
22+
// expect to be a deep clone
23+
});
24+
});
25+
26+
// Test the maked3Tree method
27+
describe('maked3Tree method', () => {
28+
it('should call removed3tree once', () => {
29+
// Should call function 'removed3tree' only once
30+
// expect toBeCalled()
31+
// expect toHaveBeenCalled()
32+
});
33+
});
34+
// Test the tooltip functionality in maked3Tree method
35+
describe('tooltip functionality in maked3Tree', () => {
36+
// Should call appropriate function upon triggering
37+
// a certain event on the tooltip div
38+
// Should call appropriate function upon triggering mouseOver
39+
it('should invoke tip.show on mouseOver', () => {
40+
41+
});
42+
// Should call appropriate function upon triggering mouseOut
43+
it ('should invoke tip.hide on mouseOut', () => {
44+
45+
});
46+
});
47+
48+
49+
50+

src/app/__tests__/switchState.test.jsx

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/app/components/Chart.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
/* eslint-disable no-use-before-define */
44
/* eslint-disable react/no-string-refs */
55
import React, { Component } from 'react';
6-
import PropTypes from 'prop-types';
6+
//import PropTypes from 'prop-types';
77
import * as d3 from 'd3';
8-
import d3Tip from "d3-tip";
8+
import d3Tip from 'd3-tip';
99

1010
let root = {};
1111
class Chart extends Component {

src/app/components/SwitchState.jsx

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/app/containers/ActionContainer.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* eslint-disable react/no-array-index-key */
22
import React from 'react';
3-
//import SwitchStateDropdown from '../components/SwitchState';
43
import Action from '../components/Action';
54

65
import { emptySnapshots } from '../actions/actions';

0 commit comments

Comments
 (0)