Browse Source

Fix spec for api.focus

pull/990/head
Masayuki Tanaka 10 years ago
parent
commit
6004743921
  1. 52
      spec/api.focus-spec.js

52
spec/api.focus-spec.js

@ -1,5 +1,5 @@
describe('c3 api load', function () {
describe('c3 api focus', function () {
'use strict';
var chart, d3;
@ -37,7 +37,7 @@ describe('c3 api load', function () {
expect(item.classed('c3-legend-item-focused')).toBeTruthy();
});
done();
}, 500);
}, 1000);
});
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.data3.classed('c3-legend-item-focused')).toBeFalsy();
done();
}, 500);
}, 1000);
});
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.data3.classed('c3-legend-item-focused')).toBeFalsy();
done();
}, 500);
}, 1000);
});
});
@ -112,7 +112,7 @@ describe('c3 api load', function () {
expect(+item.style('opacity')).toBeCloseTo(0.3);
});
done();
}, 500);
}, 1000);
});
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.data3.style('opacity')).toBeCloseTo(1);
done();
}, 500);
}, 1000);
});
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.data3.style('opacity')).toBeCloseTo(1);
done();
}, 500);
}, 1000);
});
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.data3.style('opacity')).toBeCloseTo(1);
done();
}, 500);
});
}, 500);
}, 1000);
}, 1000);
});
});
@ -224,8 +224,8 @@ describe('c3 api load', function () {
expect(+item.style('opacity')).toBeCloseTo(1);
});
done();
}, 500);
}, 500);
}, 1000);
}, 1000);
});
it('should revert all targets after defocus', function (done) {
@ -246,8 +246,8 @@ describe('c3 api load', function () {
expect(+item.style('opacity')).toBeCloseTo(1);
});
done();
}, 500);
}, 500);
}, 1000);
}, 1000);
});
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.data3.style('opacity')).toBeCloseTo(1);
done();
}, 500);
}, 500);
}, 1000);
}, 1000);
});
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.data3.style('opacity')).toBeCloseTo(0.3);
done();
}, 500);
}, 500);
}, 1000);
}, 1000);
});
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.data3.style('opacity')).toBeCloseTo(1);
done();
}, 500);
}, 500);
}, 1000);
}, 1000);
});
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.data3.style('opacity')).toBeCloseTo(0.3);
done();
}, 500);
}, 500);
}, 1000);
}, 1000);
});
});
@ -386,7 +386,7 @@ describe('c3 api load', function () {
});
expect(legendItems.size()).toBeCloseTo(0);
done();
}, 500);
}, 1000);
});
it('should defocus all targets without showing legend', function (done) {
@ -402,7 +402,7 @@ describe('c3 api load', function () {
});
expect(legendItems.size()).toBeCloseTo(0);
done();
}, 500);
}, 1000);
});
it('should revert all targets after focus', function (done) {
@ -420,8 +420,8 @@ describe('c3 api load', function () {
});
expect(legendItems.size()).toBeCloseTo(0);
done();
}, 500);
}, 500);
}, 1000);
}, 1000);
});
});

Loading…
Cancel
Save