Skip to content

Commit 0f2bd94

Browse files
committed
Make tests pass
1 parent c78ae89 commit 0f2bd94

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

app/components/flame-graph.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export default Ember.Component.extend({
116116
.size([clientWidth, clientHeight])
117117
.cellHeight(20)
118118
.zoomEnabled(true)
119-
.zoomAction((node, event) => console.log('Zoom: ', node, event))
119+
.zoomAction((node, event) => self.console.log('Zoom: ', node, event))
120120
.labelFunction(d => d.data.name + ' [' + d.data.time + ' / ' + d.data.percent + ']')
121121
.tooltip(tooltip).render();
122122
}

app/utils/d3-flame-graphs-v4/d3-flame-graph.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { select, event } from 'd3-selection';
22
import { scaleLinear, scaleQuantize } from 'd3-scale';
33
import { min, max, range } from 'd3-array';
4-
import { transition } from 'd3-transition';
54
import d3Tip from 'd3-tip';
65
import { partition, hierarchy } from 'd3-hierarchy';
76

@@ -316,7 +315,7 @@ class FlameGraph {
316315
};
317316
})(this),
318317
height: (function(_this) {
319-
return function(d) {
318+
return function(/* d */) {
320319
return _this.cellHeight();
321320
};
322321
})(this),
@@ -398,7 +397,7 @@ class FlameGraph {
398397
targetLabels.data(data, d => d.data ? d.data.location : d.location)
399398
.attr('class', 'label')
400399
.style('font-size', this.fontSize + "em")
401-
.transition().attr('dy', (this.fontSize / 2) + "em").attr('x', (function(_this) {
400+
.transition().attr('dy', (this.fontSize / 2) + "em").attr('x', (function() {
402401
return function(d) {
403402
return attrs.x(d) + 2;
404403
};
@@ -448,7 +447,6 @@ class FlameGraph {
448447
}
449448

450449
_renderAncestors() {
451-
let i;
452450
let j;
453451
let idx;
454452
let len;
@@ -474,8 +472,8 @@ class FlameGraph {
474472

475473
// FIXME: this is pretty ugly, but we need to add links between ancestors
476474
let renderAncestor = {
477-
x: (function(_this) {
478-
return function(d) {
475+
x: (function() {
476+
return function(/* d */) {
479477
return 0;
480478
};
481479
})(this),
@@ -486,7 +484,7 @@ class FlameGraph {
486484
})(this),
487485
width: this.width(),
488486
height: this.cellHeight(),
489-
text: (function(_this) {
487+
text: (function() {
490488
return function(d) {
491489
return "↩ " + (getClassAndMethodName(d.data ? d.data.name : d.name));
492490
};
@@ -514,7 +512,7 @@ class FlameGraph {
514512
return Math.round(_this.width() - _this.x(d.x1 - d.x0)) > 0 && ((ref = d.children) != null ? ref.length : void 0);
515513
}))(this);
516514

517-
this.container.selectAll('.node').classed('clickable', ((_this => d => clickable(d)))(this)).on('click', ((_this => d => {
515+
this.container.selectAll('.node').classed('clickable', ((() => d => clickable(d)))(this)).on('click', ((_this => d => {
518516
if (_this.tip) {
519517
_this.tip.hide();
520518
}

tests/integration/components/basic-tree-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ test('it renders', function(assert) {
1212

1313
this.render(hbs`{{basic-tree}}`);
1414

15-
assert.equal(this.$().text().trim(), '');
15+
assert.equal(this._element.textContent.trim(), '');
1616

1717
// Template block usage:
1818
this.render(hbs`
@@ -21,5 +21,5 @@ test('it renders', function(assert) {
2121
{{/basic-tree}}
2222
`);
2323

24-
assert.equal(this.$().text().trim(), '');
24+
assert.equal(this._element.textContent.trim(), '');
2525
});

0 commit comments

Comments
 (0)