Skip to content

Commit f4e221e

Browse files
committed
style(angular-sql-query.spec.js): reword datas to data
1 parent 2b420c3 commit f4e221e

File tree

1 file changed

+39
-42
lines changed

1 file changed

+39
-42
lines changed

src/angular-sql-query.spec.js

Lines changed: 39 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
return cb(executeSql);
1717
},
1818
};
19-
let datas = null;
20-
let backupDatas = null;
19+
let data = null;
20+
let backupData = null;
2121

2222
// load the controller's module
2323
beforeEach(() => {
24-
datas = [
24+
data = [
2525
{
2626
id: 1,
2727
test: 'test1',
@@ -48,10 +48,10 @@
4848
},
4949
},
5050
].map(data => angular.toJson(data));
51-
backupDatas = {
51+
backupData = {
5252
rows: {
53-
item: i => ({ payload: datas[i] }),
54-
length: datas.length,
53+
item: i => ({ payload: data[i] }),
54+
length: data.length,
5555
},
5656
};
5757

@@ -99,7 +99,7 @@
9999
//
100100
// ---------------
101101
describe('#listBackUp()', () => {
102-
it('should failed to list Backup datas', inject((
102+
it('should failed to list Backup data', inject((
103103
$q,
104104
$timeout,
105105
$exceptionHandler
@@ -118,10 +118,10 @@
118118
expect($exceptionHandler.errors).lengthOf(1);
119119
}));
120120

121-
it('should list Backup datas', inject(($q, $timeout) => {
121+
it('should list Backup data', inject(($q, $timeout) => {
122122
var data;
123123

124-
executeStub.yields('test', backupDatas);
124+
executeStub.yields('test', backupData);
125125

126126
backUp.listBackUp({ limit: 10, offset: 10 }).then(_data_ => {
127127
data = _data_;
@@ -183,7 +183,7 @@
183183
it('should get Backup data', inject(($q, $timeout) => {
184184
var data;
185185

186-
executeStub.yields('test', backupDatas);
186+
executeStub.yields('test', backupData);
187187

188188
backUp.getBackUp(1).then(_data_ => {
189189
data = _data_;
@@ -206,7 +206,7 @@
206206
// ---------------
207207
describe('#queryBackUp()', () => {
208208
describe('without data', () => {
209-
it('should failed to query Backup datas', inject((
209+
it('should failed to query Backup data', inject((
210210
$q,
211211
$timeout,
212212
$exceptionHandler
@@ -220,9 +220,9 @@
220220
}));
221221
});
222222
describe('with indexed fields', () => {
223-
it('should query Backup datas', inject(($q, $timeout) => {
223+
it('should query Backup data', inject(($q, $timeout) => {
224224
var data;
225-
const fakeDatas = [
225+
const fakeData = [
226226
{
227227
id: 1,
228228
test: 'test1',
@@ -238,8 +238,8 @@
238238

239239
executeStub.yields('test', {
240240
rows: {
241-
item: i => ({ payload: fakeDatas[i] }),
242-
length: fakeDatas.length,
241+
item: i => ({ payload: fakeData[i] }),
242+
length: fakeData.length,
243243
},
244244
});
245245

@@ -266,7 +266,7 @@
266266
expect(data[0].id).equal(1);
267267
}));
268268

269-
it('should query Backup datas with sort', inject(($q, $timeout) => {
269+
it('should query Backup data with sort', inject(($q, $timeout) => {
270270
let data;
271271

272272
function dbInstance() {
@@ -275,7 +275,7 @@
275275
backUp = new SqlQueryService('test', dbInstance, {
276276
indexed_fields: ['test'],
277277
});
278-
executeStub.yields('test', backupDatas);
278+
executeStub.yields('test', backupData);
279279

280280
// Common param
281281
backUp
@@ -302,17 +302,14 @@
302302
expect(data[0].id).equal(1);
303303
}));
304304

305-
it('should query Backup datas with sort desc', inject((
306-
$q,
307-
$timeout
308-
) => {
305+
it('should query Backup data with sort desc', inject(($q, $timeout) => {
309306
function dbInstance() {
310307
return $q.when(sqlInstance);
311308
}
312309
backUp = new SqlQueryService('test', dbInstance, {
313310
indexed_fields: ['test'],
314311
});
315-
executeStub.yields('test', backupDatas);
312+
executeStub.yields('test', backupData);
316313

317314
// Common param
318315
backUp
@@ -332,7 +329,7 @@
332329
);
333330
}));
334331

335-
it('should query Backup datas with multiple sort keys', inject((
332+
it('should query Backup data with multiple sort keys', inject((
336333
$q,
337334
$timeout
338335
) => {
@@ -342,7 +339,7 @@
342339
backUp = new SqlQueryService('test', dbInstance, {
343340
indexed_fields: ['test'],
344341
});
345-
executeStub.yields('test', backupDatas);
342+
executeStub.yields('test', backupData);
346343

347344
// With 2 sort keys
348345
backUp.queryBackUp(
@@ -360,7 +357,7 @@
360357
);
361358
}));
362359

363-
it('should query Backup datas with multiple indexed fields', inject((
360+
it('should query Backup data with multiple indexed fields', inject((
364361
$q,
365362
$timeout
366363
) => {
@@ -373,7 +370,7 @@
373370
indexed_fields: ['test', 'test2', 'test3'],
374371
});
375372

376-
executeStub.yields('test', backupDatas);
373+
executeStub.yields('test', backupData);
377374

378375
backUp
379376
.queryBackUp({
@@ -402,7 +399,7 @@
402399
expect(data).lengthOf(1);
403400
}));
404401

405-
it('should query Backup with a large number of datas', inject((
402+
it('should query Backup with a large number of data', inject((
406403
$q,
407404
$timeout
408405
) => {
@@ -425,7 +422,7 @@
425422
indexed_fields: ['test', 'test2', 'test3'],
426423
});
427424

428-
executeStub.returns($q.when(backupDatas));
425+
executeStub.returns($q.when(backupData));
429426

430427
for (let i = 0; 1010 > i; i++) {
431428
params.push(i + 1);
@@ -474,10 +471,10 @@
474471
}));
475472
});
476473
describe('with non indexed fields', () => {
477-
it('should query Backup datas', inject($timeout => {
474+
it('should query Backup data', inject($timeout => {
478475
var data;
479476

480-
executeStub.yields('test', backupDatas);
477+
executeStub.yields('test', backupData);
481478

482479
// Common param
483480
backUp
@@ -503,7 +500,7 @@
503500
it('should perform limit in memory', inject($timeout => {
504501
var data;
505502

506-
executeStub.yields('test', backupDatas);
503+
executeStub.yields('test', backupData);
507504

508505
// Common param
509506
backUp
@@ -591,7 +588,7 @@
591588
data = null;
592589
});
593590

594-
it('should failed to update Backup datas', inject((
591+
it('should failed to update Backup data', inject((
595592
$q,
596593
$timeout,
597594
$exceptionHandler
@@ -608,7 +605,7 @@
608605
expect(data).equal(null);
609606
}));
610607

611-
it('should succeed to update Backup datas', inject(($q, $timeout) => {
608+
it('should succeed to update Backup data', inject(($q, $timeout) => {
612609
executeStub.yields('test', 'ok');
613610

614611
backUp.updateBackUp(dataUpdate).then(_data_ => {
@@ -624,7 +621,7 @@
624621
expect(data).equal(dataUpdate);
625622
}));
626623

627-
it('should succeed to update Backup datas with indexed fields', inject((
624+
it('should succeed to update Backup data with indexed fields', inject((
628625
$q,
629626
$timeout
630627
) => {
@@ -660,7 +657,7 @@
660657
//
661658
// ---------------
662659
describe('#removeBackUp()', () => {
663-
it('should failed to remove Backup datas', inject((
660+
it('should failed to remove Backup data', inject((
664661
$q,
665662
$timeout,
666663
$exceptionHandler
@@ -679,7 +676,7 @@
679676
expect(err).equal(null);
680677
}));
681678

682-
it('should succeed to remove Backup datas', inject(($q, $timeout) => {
679+
it('should succeed to remove Backup data', inject(($q, $timeout) => {
683680
var data;
684681

685682
executeStub.yields('test', 'ok');
@@ -699,7 +696,7 @@
699696
});
700697

701698
describe('#removeQueryBackUp()', () => {
702-
it('should failed to remove Backup datas', inject((
699+
it('should failed to remove Backup data', inject((
703700
$q,
704701
$timeout,
705702
$exceptionHandler
@@ -722,7 +719,7 @@
722719
expect(err).equal(null);
723720
}));
724721

725-
it('should succeed to remove Backup datas', inject(($q, $timeout) => {
722+
it('should succeed to remove Backup data', inject(($q, $timeout) => {
726723
var data;
727724

728725
executeStub.yields('test', 'ok');
@@ -783,7 +780,7 @@
783780
expect(data).equal({}.undef);
784781
}));
785782

786-
it('should delete datas', inject(($q, $timeout) => {
783+
it('should delete data', inject(($q, $timeout) => {
787784
var data;
788785

789786
executeStub.yields('test', 'ok');
@@ -802,7 +799,7 @@
802799
expect(data).deep.equal(['ok']);
803800
}));
804801

805-
it('should modify datas', inject(($q, $timeout) => {
802+
it('should modify data', inject(($q, $timeout) => {
806803
var data;
807804

808805
executeStub.yields('test', 'ok');
@@ -821,7 +818,7 @@
821818
expect(data).deep.equal(['ok']);
822819
}));
823820

824-
it('should modify and delete datas', inject(($q, $timeout) => {
821+
it('should modify and delete data', inject(($q, $timeout) => {
825822
var data;
826823

827824
executeStub.yields('test', 'ok');
@@ -853,7 +850,7 @@
853850
expect(data).deep.equal(['ok', 'ok']);
854851
}));
855852

856-
it('should modify and delete datas whith indexed fields', inject((
853+
it('should modify and delete data whith indexed fields', inject((
857854
$q,
858855
$timeout
859856
) => {

0 commit comments

Comments
 (0)