| 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87 |
1×
1×
1×
1×
1×
1×
1×
1×
10×
1×
1×
1×
| "use strict";
var tester_1 = require('immutable-class/build/tester');
var immutable_1 = require('immutable');
var data_source_1 = require("../data-source/data-source");
var link_view_config_1 = require('./link-view-config');
describe('LinkViewConfig', function () {
var dataSourceJS = {
name: 'twitter',
title: 'Twitter',
engine: 'druid',
source: 'twitter',
introspection: 'none',
dimensions: [
{
expression: {
name: 'time',
op: 'ref'
},
kind: 'time',
name: 'time'
},
{
expression: '$statusCode',
kind: 'string',
name: 'statusCode'
}
],
measures: [
{
name: 'count',
expression: '$main.count()'
},
{
name: 'uniqueIp',
expression: '$main.countDistinct($ip)'
}
],
timeAttribute: 'time',
defaultTimezone: 'Etc/UTC',
defaultFilter: { op: 'literal', value: true },
defaultDuration: 'P3D',
defaultSortMeasure: 'count',
refreshRule: {
rule: "fixed",
time: new Date('2015-09-13T00:00:00Z')
}
};
var dataSources = immutable_1.List([data_source_1.DataSource.fromJS(dataSourceJS)]);
var visualizations = immutable_1.List([
{
id: 'vis1',
title: 'vis1',
handleCircumstance: function () {
return { 'isAutomatic': function () { return false; } };
}
}
]);
var context = { dataSources: dataSources, visualizations: visualizations };
it('is an immutable class', function () {
tester_1.testImmutableClass(link_view_config_1.LinkViewConfig, [
{
title: 'The Links Will Rise Again!',
linkItems: [
{
name: 'test1',
title: 'Test One',
description: 'I like testing',
group: 'Tests',
dataSource: 'twitter',
essence: {
visualization: 'vis1',
timezone: 'Etc/UTC',
filter: {
op: "literal",
value: true
},
pinnedDimensions: ['statusCode'],
selectedMeasures: ['count'],
splits: []
}
}
]
}
], { context: context });
});
});
|