-
-
Notifications
You must be signed in to change notification settings - Fork 69
/
deref.test.ts
47 lines (45 loc) · 1.04 KB
/
deref.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import {derefLayers} from './deref';
describe('deref', () => {
test('derefs a ref layer which follows its parent', () => {
expect(derefLayers([
{
'id': 'parent',
'type': 'line'
},
{
'id': 'child',
'ref': 'parent'
}
])).toEqual([
{
'id': 'parent',
'type': 'line'
},
{
'id': 'child',
'type': 'line'
}
]);
});
test('derefs a ref layer which precedes its parent', () => {
expect(derefLayers([
{
'id': 'child',
'ref': 'parent'
},
{
'id': 'parent',
'type': 'line'
}
])).toEqual([
{
'id': 'child',
'type': 'line'
},
{
'id': 'parent',
'type': 'line'
}
]);
});
});