forked from SuperMap/iClient-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSortbySpec.js
More file actions
31 lines (28 loc) · 954 Bytes
/
SortbySpec.js
File metadata and controls
31 lines (28 loc) · 954 Bytes
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
import { Sortby } from '@supermap/iclient-common/iServer';
var option = {
field: '属性名称',
direction: 'DESC'
};
describe('Sortby', () => {
it('constructor destroy', () => {
var parameter = new Sortby(option);
expect(parameter.field).toEqual('属性名称');
expect(parameter.direction).toEqual('DESC');
expect(parameter.CLASS_NAME).toEqual('SuperMap.Sortby');
parameter.destroy();
expect(parameter.field).toEqual(undefined);
expect(parameter.direction).toEqual('ASC');
});
it('constructFromObject', () => {
var obj = Sortby.constructFromObject(option);
var res = obj instanceof Sortby;
expect(res).toBeTruthy();
});
it('constructFromObject other key', () => {
var data = {
test: 'test'
};
var obj = Sortby.constructFromObject(data);
expect(obj.hasOwnProperty('test')).toBeFalsy();
});
});