|
|
@ -1,5 +1,5 @@ |
|
|
|
|
|
|
|
|
|
|
|
describe('c3 api load', function () { |
|
|
|
describe('c3 api focus', function () { |
|
|
|
'use strict'; |
|
|
|
'use strict'; |
|
|
|
|
|
|
|
|
|
|
|
var chart, d3; |
|
|
|
var chart, d3; |
|
|
@ -37,7 +37,7 @@ describe('c3 api load', function () { |
|
|
|
expect(item.classed('c3-legend-item-focused')).toBeTruthy(); |
|
|
|
expect(item.classed('c3-legend-item-focused')).toBeTruthy(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
done(); |
|
|
|
done(); |
|
|
|
}, 500); |
|
|
|
}, 1000); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('should focus one target', function (done) { |
|
|
|
it('should focus one target', function (done) { |
|
|
@ -62,7 +62,7 @@ describe('c3 api load', function () { |
|
|
|
expect(legendItems.data2.classed('c3-legend-item-focused')).toBeTruthy(); |
|
|
|
expect(legendItems.data2.classed('c3-legend-item-focused')).toBeTruthy(); |
|
|
|
expect(legendItems.data3.classed('c3-legend-item-focused')).toBeFalsy(); |
|
|
|
expect(legendItems.data3.classed('c3-legend-item-focused')).toBeFalsy(); |
|
|
|
done(); |
|
|
|
done(); |
|
|
|
}, 500); |
|
|
|
}, 1000); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('should focus multiple targets', function (done) { |
|
|
|
it('should focus multiple targets', function (done) { |
|
|
@ -87,7 +87,7 @@ describe('c3 api load', function () { |
|
|
|
expect(legendItems.data2.classed('c3-legend-item-focused')).toBeTruthy(); |
|
|
|
expect(legendItems.data2.classed('c3-legend-item-focused')).toBeTruthy(); |
|
|
|
expect(legendItems.data3.classed('c3-legend-item-focused')).toBeFalsy(); |
|
|
|
expect(legendItems.data3.classed('c3-legend-item-focused')).toBeFalsy(); |
|
|
|
done(); |
|
|
|
done(); |
|
|
|
}, 500); |
|
|
|
}, 1000); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
@ -112,7 +112,7 @@ describe('c3 api load', function () { |
|
|
|
expect(+item.style('opacity')).toBeCloseTo(0.3); |
|
|
|
expect(+item.style('opacity')).toBeCloseTo(0.3); |
|
|
|
}); |
|
|
|
}); |
|
|
|
done(); |
|
|
|
done(); |
|
|
|
}, 500); |
|
|
|
}, 1000); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('should defocus one target', function (done) { |
|
|
|
it('should defocus one target', function (done) { |
|
|
@ -140,7 +140,7 @@ describe('c3 api load', function () { |
|
|
|
expect(+legendItems.data2.style('opacity')).toBeCloseTo(0.3); |
|
|
|
expect(+legendItems.data2.style('opacity')).toBeCloseTo(0.3); |
|
|
|
expect(+legendItems.data3.style('opacity')).toBeCloseTo(1); |
|
|
|
expect(+legendItems.data3.style('opacity')).toBeCloseTo(1); |
|
|
|
done(); |
|
|
|
done(); |
|
|
|
}, 500); |
|
|
|
}, 1000); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('should defocus multiple targets', function (done) { |
|
|
|
it('should defocus multiple targets', function (done) { |
|
|
@ -168,7 +168,7 @@ describe('c3 api load', function () { |
|
|
|
expect(+legendItems.data2.style('opacity')).toBeCloseTo(0.3); |
|
|
|
expect(+legendItems.data2.style('opacity')).toBeCloseTo(0.3); |
|
|
|
expect(+legendItems.data3.style('opacity')).toBeCloseTo(1); |
|
|
|
expect(+legendItems.data3.style('opacity')).toBeCloseTo(1); |
|
|
|
done(); |
|
|
|
done(); |
|
|
|
}, 500); |
|
|
|
}, 1000); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('should defocus multiple targets after focused', function (done) { |
|
|
|
it('should defocus multiple targets after focused', function (done) { |
|
|
@ -198,9 +198,9 @@ describe('c3 api load', function () { |
|
|
|
expect(+legendItems.data2.style('opacity')).toBeCloseTo(0.3); |
|
|
|
expect(+legendItems.data2.style('opacity')).toBeCloseTo(0.3); |
|
|
|
expect(+legendItems.data3.style('opacity')).toBeCloseTo(1); |
|
|
|
expect(+legendItems.data3.style('opacity')).toBeCloseTo(1); |
|
|
|
done(); |
|
|
|
done(); |
|
|
|
}, 500); |
|
|
|
}, 1000); |
|
|
|
}); |
|
|
|
}, 1000); |
|
|
|
}, 500); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
@ -224,8 +224,8 @@ describe('c3 api load', function () { |
|
|
|
expect(+item.style('opacity')).toBeCloseTo(1); |
|
|
|
expect(+item.style('opacity')).toBeCloseTo(1); |
|
|
|
}); |
|
|
|
}); |
|
|
|
done(); |
|
|
|
done(); |
|
|
|
}, 500); |
|
|
|
}, 1000); |
|
|
|
}, 500); |
|
|
|
}, 1000); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('should revert all targets after defocus', function (done) { |
|
|
|
it('should revert all targets after defocus', function (done) { |
|
|
@ -246,8 +246,8 @@ describe('c3 api load', function () { |
|
|
|
expect(+item.style('opacity')).toBeCloseTo(1); |
|
|
|
expect(+item.style('opacity')).toBeCloseTo(1); |
|
|
|
}); |
|
|
|
}); |
|
|
|
done(); |
|
|
|
done(); |
|
|
|
}, 500); |
|
|
|
}, 1000); |
|
|
|
}, 500); |
|
|
|
}, 1000); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('should revert one target after focus', function (done) { |
|
|
|
it('should revert one target after focus', function (done) { |
|
|
@ -274,8 +274,8 @@ describe('c3 api load', function () { |
|
|
|
expect(+legendItems.data2.style('opacity')).toBeCloseTo(1); |
|
|
|
expect(+legendItems.data2.style('opacity')).toBeCloseTo(1); |
|
|
|
expect(+legendItems.data3.style('opacity')).toBeCloseTo(1); |
|
|
|
expect(+legendItems.data3.style('opacity')).toBeCloseTo(1); |
|
|
|
done(); |
|
|
|
done(); |
|
|
|
}, 500); |
|
|
|
}, 1000); |
|
|
|
}, 500); |
|
|
|
}, 1000); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('should revert one target after defocus', function (done) { |
|
|
|
it('should revert one target after defocus', function (done) { |
|
|
@ -302,8 +302,8 @@ describe('c3 api load', function () { |
|
|
|
expect(+legendItems.data2.style('opacity')).toBeCloseTo(1); |
|
|
|
expect(+legendItems.data2.style('opacity')).toBeCloseTo(1); |
|
|
|
expect(+legendItems.data3.style('opacity')).toBeCloseTo(0.3); |
|
|
|
expect(+legendItems.data3.style('opacity')).toBeCloseTo(0.3); |
|
|
|
done(); |
|
|
|
done(); |
|
|
|
}, 500); |
|
|
|
}, 1000); |
|
|
|
}, 500); |
|
|
|
}, 1000); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('should focus multiple targets after focus', function (done) { |
|
|
|
it('should focus multiple targets after focus', function (done) { |
|
|
@ -330,8 +330,8 @@ describe('c3 api load', function () { |
|
|
|
expect(+legendItems.data2.style('opacity')).toBeCloseTo(1); |
|
|
|
expect(+legendItems.data2.style('opacity')).toBeCloseTo(1); |
|
|
|
expect(+legendItems.data3.style('opacity')).toBeCloseTo(1); |
|
|
|
expect(+legendItems.data3.style('opacity')).toBeCloseTo(1); |
|
|
|
done(); |
|
|
|
done(); |
|
|
|
}, 500); |
|
|
|
}, 1000); |
|
|
|
}, 500); |
|
|
|
}, 1000); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('should focus multiple targets after defocus', function (done) { |
|
|
|
it('should focus multiple targets after defocus', function (done) { |
|
|
@ -358,8 +358,8 @@ describe('c3 api load', function () { |
|
|
|
expect(+legendItems.data2.style('opacity')).toBeCloseTo(1); |
|
|
|
expect(+legendItems.data2.style('opacity')).toBeCloseTo(1); |
|
|
|
expect(+legendItems.data3.style('opacity')).toBeCloseTo(0.3); |
|
|
|
expect(+legendItems.data3.style('opacity')).toBeCloseTo(0.3); |
|
|
|
done(); |
|
|
|
done(); |
|
|
|
}, 500); |
|
|
|
}, 1000); |
|
|
|
}, 500); |
|
|
|
}, 1000); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
@ -386,7 +386,7 @@ describe('c3 api load', function () { |
|
|
|
}); |
|
|
|
}); |
|
|
|
expect(legendItems.size()).toBeCloseTo(0); |
|
|
|
expect(legendItems.size()).toBeCloseTo(0); |
|
|
|
done(); |
|
|
|
done(); |
|
|
|
}, 500); |
|
|
|
}, 1000); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('should defocus all targets without showing legend', function (done) { |
|
|
|
it('should defocus all targets without showing legend', function (done) { |
|
|
@ -402,7 +402,7 @@ describe('c3 api load', function () { |
|
|
|
}); |
|
|
|
}); |
|
|
|
expect(legendItems.size()).toBeCloseTo(0); |
|
|
|
expect(legendItems.size()).toBeCloseTo(0); |
|
|
|
done(); |
|
|
|
done(); |
|
|
|
}, 500); |
|
|
|
}, 1000); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('should revert all targets after focus', function (done) { |
|
|
|
it('should revert all targets after focus', function (done) { |
|
|
@ -420,8 +420,8 @@ describe('c3 api load', function () { |
|
|
|
}); |
|
|
|
}); |
|
|
|
expect(legendItems.size()).toBeCloseTo(0); |
|
|
|
expect(legendItems.size()).toBeCloseTo(0); |
|
|
|
done(); |
|
|
|
done(); |
|
|
|
}, 500); |
|
|
|
}, 1000); |
|
|
|
}, 500); |
|
|
|
}, 1000); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|