Skip to content
This repository was archived by the owner on Jul 29, 2019. It is now read-only.

Commit 4b489a1

Browse files
wimrijndersyotamberk
authored andcommitted
Added describe sections to PointItem unit tests (#3509)
1 parent 51a8977 commit 4b489a1

File tree

1 file changed

+38
-23
lines changed

1 file changed

+38
-23
lines changed

test/PointItem.test.js

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,19 @@ describe('Timeline PointItem', function () {
5959
assert(pointItem.isVisible(range));
6060
});
6161

62-
it('should redraw() and then not be dirty', function() {
62+
63+
describe('should redraw() and then', function () {
64+
65+
it('not be dirty', function() {
6366
var pointItem = new PointItem({start: now.toDate()}, null, {editable: false});
6467
pointItem.setParent(TestSupport.buildMockItemSet());
6568
assert(pointItem.dirty);
6669
pointItem.redraw();
6770
assert(!pointItem.dirty);
6871
});
6972

70-
it('should redraw() and then have point attached to its parent', function() {
73+
74+
it('have point attached to its parent', function() {
7175
var pointItem = new PointItem({start: now.toDate()}, null, {editable: false});
7276
var parent = TestSupport.buildMockItemSet();
7377
pointItem.setParent(parent);
@@ -76,7 +80,10 @@ describe('Timeline PointItem', function () {
7680
assert(parent.dom.foreground.hasChildNodes());
7781
});
7882

79-
it('should redraw() and then have the correct classname for a non-editable item', function() {
83+
84+
describe('have the correct classname for', function() {
85+
86+
it('a non-editable item', function() {
8087
var pointItem = new PointItem({start: now.toDate(), editable: false}, null, {editable: false});
8188
var parent = TestSupport.buildMockItemSet();
8289
pointItem.setParent(parent);
@@ -85,7 +92,7 @@ describe('Timeline PointItem', function () {
8592
assert.equal(pointItem.dom.point.className, "vis-item vis-point vis-readonly");
8693
});
8794

88-
it('should redraw() and then have the correct classname for an editable item (with object option)', function() {
95+
it('an editable item (with object option)', function() {
8996
var pointItem = new PointItem({start: now.toDate()}, null, {editable: {updateTime: true, updateGroup: false}});
9097
var parent = TestSupport.buildMockItemSet();
9198
pointItem.setParent(parent);
@@ -94,7 +101,7 @@ describe('Timeline PointItem', function () {
94101
assert.equal(pointItem.dom.point.className, "vis-item vis-point vis-editable");
95102
});
96103

97-
it('should redraw() and then have the correct classname for an editable item (with boolean option)', function() {
104+
it('an editable item (with boolean option)', function() {
98105
var pointItem = new PointItem({start: now.toDate()}, null, {editable: true});
99106
var parent = TestSupport.buildMockItemSet();
100107
pointItem.setParent(parent);
@@ -103,7 +110,7 @@ describe('Timeline PointItem', function () {
103110
assert.equal(pointItem.dom.point.className, "vis-item vis-point vis-editable");
104111
});
105112

106-
it('should redraw() and then have the correct classname for an editable:false override item (with boolean option)', function() {
113+
it('an editable:false override item (with boolean option)', function() {
107114
var pointItem = new PointItem({start: now.toDate(), editable: false}, null, {editable: true});
108115
var parent = TestSupport.buildMockItemSet();
109116
pointItem.setParent(parent);
@@ -112,7 +119,7 @@ describe('Timeline PointItem', function () {
112119
assert.equal(pointItem.dom.point.className, "vis-item vis-point vis-readonly");
113120
});
114121

115-
it('should redraw() and then have the correct classname for an editable:true override item (with boolean option)', function() {
122+
it('an editable:true override item (with boolean option)', function() {
116123
var pointItem = new PointItem({start: now.toDate(), editable: true}, null, {editable: false});
117124
var parent = TestSupport.buildMockItemSet();
118125
pointItem.setParent(parent);
@@ -121,7 +128,7 @@ describe('Timeline PointItem', function () {
121128
assert.equal(pointItem.dom.point.className, "vis-item vis-point vis-editable");
122129
});
123130

124-
it('should redraw() and then have the correct classname for an editable:false override item (with object option)', function() {
131+
it('an editable:false override item (with object option)', function() {
125132
var pointItem = new PointItem({start: now.toDate(), editable: false}, null, {editable: {updateTime: true, updateGroup: false}});
126133
var parent = TestSupport.buildMockItemSet();
127134
pointItem.setParent(parent);
@@ -130,7 +137,7 @@ describe('Timeline PointItem', function () {
130137
assert.equal(pointItem.dom.point.className, "vis-item vis-point vis-readonly");
131138
});
132139

133-
it('should redraw() and then have the correct classname for an editable:false override item (with object option for group change)', function() {
140+
it('an editable:false override item (with object option for group change)', function() {
134141
var pointItem = new PointItem({start: now.toDate(), editable: false}, null, {editable: {updateTime: false, updateGroup: true}});
135142
var parent = TestSupport.buildMockItemSet();
136143
pointItem.setParent(parent);
@@ -139,7 +146,7 @@ describe('Timeline PointItem', function () {
139146
assert.equal(pointItem.dom.point.className, "vis-item vis-point vis-readonly");
140147
});
141148

142-
it('should redraw() and then have the correct classname for an editable:true override item (with object option)', function() {
149+
it('an editable:true override item (with object option)', function() {
143150
var pointItem = new PointItem({start: now.toDate(), editable: true}, null, {editable: {updateTime: false, updateGroup: false}});
144151
var parent = TestSupport.buildMockItemSet();
145152
pointItem.setParent(parent);
@@ -148,7 +155,7 @@ describe('Timeline PointItem', function () {
148155
assert.equal(pointItem.dom.point.className, "vis-item vis-point vis-editable");
149156
});
150157

151-
it('should redraw() and then have the correct classname for an editable:true non-override item (with object option)', function() {
158+
it('an editable:true non-override item (with object option)', function() {
152159
var pointItem = new PointItem({start: now.toDate(), editable: true}, null, {editable: {updateTime: false, updateGroup: false, overrideItems: true}});
153160
var parent = TestSupport.buildMockItemSet();
154161
pointItem.setParent(parent);
@@ -157,7 +164,7 @@ describe('Timeline PointItem', function () {
157164
assert.equal(pointItem.dom.point.className, "vis-item vis-point vis-readonly");
158165
});
159166

160-
it('should redraw() and then have the correct classname for an editable:false non-override item (with object option)', function() {
167+
it('an editable:false non-override item (with object option)', function() {
161168
var pointItem = new PointItem({start: now.toDate(), editable: false}, null, {editable: {updateTime: true, updateGroup: false, overrideItems: true}});
162169
var parent = TestSupport.buildMockItemSet();
163170
pointItem.setParent(parent);
@@ -166,7 +173,7 @@ describe('Timeline PointItem', function () {
166173
assert.equal(pointItem.dom.point.className, "vis-item vis-point vis-editable");
167174
});
168175

169-
it('should redraw() and then have the correct property for an editable: {updateTime} override item (with boolean option)', function() {
176+
it('an editable: {updateTime} override item (with boolean option)', function() {
170177
var pointItem = new PointItem({start: now.toDate(), editable: {updateTime: true}}, null, {editable: true});
171178
var parent = TestSupport.buildMockItemSet();
172179
pointItem.setParent(parent);
@@ -176,7 +183,7 @@ describe('Timeline PointItem', function () {
176183
assert.equal(pointItem.editable.remove, undefined);
177184
});
178185

179-
it('should redraw() and then have the correct property for an editable: {updateTime} override item (with boolean option false)', function() {
186+
it('an editable: {updateTime} override item (with boolean option false)', function() {
180187
var pointItem = new PointItem({start: now.toDate(), editable: {updateTime: true}}, null, {editable: false});
181188
var parent = TestSupport.buildMockItemSet();
182189
pointItem.setParent(parent);
@@ -186,7 +193,7 @@ describe('Timeline PointItem', function () {
186193
assert.equal(pointItem.editable.remove, undefined);
187194
});
188195

189-
it('should redraw() and then have the correct property for an editable: {updateGroup} override item (with boolean option)', function() {
196+
it('an editable: {updateGroup} override item (with boolean option)', function() {
190197
var pointItem = new PointItem({start: now.toDate(), editable: {updateGroup: true}}, null, {editable: true});
191198
var parent = TestSupport.buildMockItemSet();
192199
pointItem.setParent(parent);
@@ -196,7 +203,12 @@ describe('Timeline PointItem', function () {
196203
assert.equal(pointItem.editable.remove, undefined);
197204
});
198205

199-
it('should redraw() and then have the correct property for an editable: {updateGroup} override item (with boolean option false)', function() {
206+
}); // have the correct classname for
207+
208+
209+
describe('have the correct property for', function() {
210+
211+
it('an editable: {updateGroup} override item (with boolean option false)', function() {
200212
var pointItem = new PointItem({start: now.toDate(), editable: {updateGroup: true}}, null, {editable: false});
201213
var parent = TestSupport.buildMockItemSet();
202214
pointItem.setParent(parent);
@@ -206,7 +218,7 @@ describe('Timeline PointItem', function () {
206218
assert.equal(pointItem.editable.remove, undefined);
207219
});
208220

209-
it('should redraw() and then have the correct property for an editable: {remove} override item (with boolean option)', function() {
221+
it('an editable: {remove} override item (with boolean option)', function() {
210222
var pointItem = new PointItem({start: now.toDate(), editable: {remove: true}}, null, {editable: true});
211223
var parent = TestSupport.buildMockItemSet();
212224
pointItem.setParent(parent);
@@ -216,7 +228,7 @@ describe('Timeline PointItem', function () {
216228
assert.equal(pointItem.editable.remove, true);
217229
});
218230

219-
it('should redraw() and then have the correct property for an editable: {remove} override item (with boolean option false)', function() {
231+
it('an editable: {remove} override item (with boolean option false)', function() {
220232
var pointItem = new PointItem({start: now.toDate(), editable: {remove: true}}, null, {editable: false});
221233
var parent = TestSupport.buildMockItemSet();
222234
pointItem.setParent(parent);
@@ -226,7 +238,7 @@ describe('Timeline PointItem', function () {
226238
assert.equal(pointItem.editable.remove, true);
227239
});
228240

229-
it('should redraw() and then have the correct property for an editable: {updateTime, remove} override item (with boolean option)', function() {
241+
it('an editable: {updateTime, remove} override item (with boolean option)', function() {
230242
var pointItem = new PointItem({start: now.toDate(), editable: {updateTime: true, remove: true}}, null, {editable: true});
231243
var parent = TestSupport.buildMockItemSet();
232244
pointItem.setParent(parent);
@@ -236,7 +248,7 @@ describe('Timeline PointItem', function () {
236248
assert.equal(pointItem.editable.remove, true);
237249
});
238250

239-
it('should redraw() and then have the correct property for an editable: {updateTime, remove} override item (with boolean option false)', function() {
251+
it('an editable: {updateTime, remove} override item (with boolean option false)', function() {
240252
var pointItem = new PointItem({start: now.toDate(), editable: {updateTime: true, remove: true}}, null, {editable: false});
241253
var parent = TestSupport.buildMockItemSet();
242254
pointItem.setParent(parent);
@@ -246,7 +258,7 @@ describe('Timeline PointItem', function () {
246258
assert.equal(pointItem.editable.remove, true);
247259
});
248260

249-
it('should redraw() and then have the correct property for an editable: {updateTime, updateGroup, remove} override item (with boolean option)', function() {
261+
it('an editable: {updateTime, updateGroup, remove} override item (with boolean option)', function() {
250262
var pointItem = new PointItem({start: now.toDate(), editable: {updateTime: true, updateGroup: true, remove: true}}, null, {editable: true});
251263
var parent = TestSupport.buildMockItemSet();
252264
pointItem.setParent(parent);
@@ -256,7 +268,7 @@ describe('Timeline PointItem', function () {
256268
assert.equal(pointItem.editable.remove, true);
257269
});
258270

259-
it('should redraw() and then have the correct property for an editable: {updateTime, updateGroup, remove} override item (with boolean option false)', function() {
271+
it('an editable: {updateTime, updateGroup, remove} override item (with boolean option false)', function() {
260272
var pointItem = new PointItem({start: now.toDate(), editable: {updateTime: true, updateGroup: true, remove: true}}, null, {editable: false});
261273
var parent = TestSupport.buildMockItemSet();
262274
pointItem.setParent(parent);
@@ -265,4 +277,7 @@ describe('Timeline PointItem', function () {
265277
assert.equal(pointItem.editable.updateGroup, true);
266278
assert.equal(pointItem.editable.remove, true);
267279
});
268-
});
280+
281+
}); // have the correct property for
282+
}); // should redraw() and then
283+
}); // Timeline PointItem

0 commit comments

Comments
 (0)