all files / common/models/sort-on/ sort-on.mocha.js

100% Statements 6/6
100% Branches 0/0
100% Functions 2/2
100% Lines 6/6
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                                                                                       
"use strict";
var tester_1 = require('immutable-class/build/tester');
var plywood_1 = require('plywood');
var sort_on_1 = require('./sort-on');
describe('SortOn', function () {
    it('is an immutable class', function () {
        tester_1.testImmutableClass(sort_on_1.SortOn, [
            {
                measure: {
                    name: 'price',
                    title: 'Price',
                    expression: plywood_1.$('main').min('$price').toJS()
                }
            },
            {
                measure: {
                    expression: {
                        action: {
                            action: 'sum',
                            expression: {
                                name: 'price',
                                op: 'ref'
                            }
                        },
                        expression: {
                            name: 'main',
                            op: 'ref'
                        },
                        op: 'chain'
                    },
                    name: 'price',
                    title: 'Price'
                }
            },
            {
                dimension: {
                    name: 'country',
                    title: 'important countries',
                    'expression': {
                        'op': 'literal',
                        'value': { 'setType': 'STRING', 'elements': ['en'] },
                        'type': 'SET'
                    },
                    kind: 'string'
                }
            }
        ]);
    });
});