Skip to content

Commit e446a4a

Browse files
committed
fixed failing test issue
1 parent ef9f03c commit e446a4a

File tree

5 files changed

+10
-13
lines changed

5 files changed

+10
-13
lines changed

src/app/__tests__/mainReducer.test.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ describe('mainReducer testing', () => {
9494
});
9595

9696
describe('empty', () => {
97-
xit('should empty snapshots except the first one', () => {
97+
it('should empty snapshots except the first one', () => {
9898
expect(mainReducer(state, emptySnapshots()).tabs[currentTab].sliderIndex).toEqual(0);
9999
expect(mainReducer(state, emptySnapshots()).tabs[currentTab].viewIndex).toEqual(-1);
100100
expect(mainReducer(state, emptySnapshots()).tabs[currentTab].playing).toEqual(false);

src/app/components/Chart.jsx

Lines changed: 5 additions & 7 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 {
@@ -36,15 +36,13 @@ class Chart extends Component {
3636

3737
maked3Tree() {
3838
this.removed3Tree();
39-
let width = 600;
40-
// let height = 1060;
4139
const margin = {
4240
top: 0,
4341
right: 60,
44-
bottom: 80,
42+
bottom: 200,
4543
left: 120,
4644
};
47-
// const width = 600 - margin.right - margin.left;
45+
const width = 600 - margin.right - margin.left;
4846
const height = 700 - margin.top - margin.bottom;
4947

5048
let chartContainer = d3.select(this.chartRef.current)
@@ -93,7 +91,7 @@ class Chart extends Component {
9391
});
9492

9593
node.append("circle")
96-
.attr("r", 12)
94+
.attr("r", 10)
9795

9896
//creating a d3.tip method where the html has a function that returns the data we passed into tip.show from line 120
9997
let tip = d3Tip()

src/app/reducers/mainReducer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export default (state, action) => produce(state, draft => {
7070
tabs[currentTab].playing = false;
7171
tabs[currentTab].snapshots.splice(1);
7272
// reset children in root node to reset graph
73-
tabs[currentTab].hierarchy.children = [];
73+
if (tabs[currentTab].hierarchy) tabs[currentTab].hierarchy.children = [];
7474
// reassigning pointer to the appropriate node to branch off of
7575
tabs[currentTab].currLocation = tabs[currentTab].hierarchy;
7676
// reset index

src/app/styles/components/d3graph.css

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,17 @@ body {
5555
font-family: "Overpass Mono", monospace;
5656
}
5757

58-
/* Creates a small triangle extender for the tooltip */
58+
/* Creates a small triangle extender for the tooltip
5959
.d3-tip:after {
6060
box-sizing: border-box;
6161
display: inline;
6262
font-size: 15px;
63-
width: 100%;
6463
line-height: 1;
6564
color: #9cf4df;
6665
content: "\25BC";
6766
position: absolute;
6867
text-align: center;
69-
}
68+
} */
7069

7170
/* Style northward tooltips specifically */
7271
.d3-tip.n:after {

src/extension/background.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ chrome.runtime.onMessage.addListener((request, sender) => {
155155
if (!persist) {
156156
tabsObj[tabId].snapshots.splice(1);
157157
// reset children in root node to reset graph
158-
tabsObj[tabId].hierarchy.children = [];
158+
if (tabsObj[tabId].hierarchy) tabsObj[tabId].hierarchy.children = [];
159159
// reassigning pointer to the appropriate node to branch off of
160160
tabsObj[tabId].currLocation = tabsObj[tabId].hierarchy;
161161
// reset index

0 commit comments

Comments
 (0)