File tree 1 file changed +10
-5
lines changed
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,8 @@ var toTree = require('../index.js');
6
6
var initial = [
7
7
{
8
8
id : 1 ,
9
- parent_id : null
9
+ parent_id : null ,
10
+ children : [ { id : 5 } ]
10
11
} ,
11
12
{
12
13
id : 2 ,
@@ -25,13 +26,17 @@ var initial = [
25
26
var current ;
26
27
27
28
describe ( 'array-to-tree' , function ( ) {
28
- describe ( 'with valid arguments' , function ( ) {
29
+ describe ( 'with default arguments' , function ( ) {
29
30
beforeEach ( function ( ) {
30
31
current = toTree ( initial ) ;
31
32
} ) ;
32
33
33
- it ( 'should not modify passed object' , function ( ) {
34
- expect ( initial ) . to . be . deep . equal ( initial ) ;
34
+ it ( 'should not modify given array' , function ( ) {
35
+ expect ( initial [ 0 ] ) . to . be . deep . equal ( {
36
+ id : 1 ,
37
+ parent_id : null ,
38
+ children : [ { id : 5 } ]
39
+ } ) ;
35
40
} ) ;
36
41
37
42
it ( 'should return an array' , function ( ) {
@@ -96,7 +101,7 @@ describe('array-to-tree', function() {
96
101
} ) ;
97
102
} ) ;
98
103
99
- describe ( 'with different options ' , function ( ) {
104
+ describe ( 'with custom arguments ' , function ( ) {
100
105
it ( 'should work with custom parents links' , function ( ) {
101
106
expect (
102
107
toTree (
You can’t perform that action at this time.
0 commit comments