mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Load zeppelin.Transformation before zeppelin.PivotTransformation on test
This commit is contained in:
parent
9367b78fc5
commit
7517447640
3 changed files with 42 additions and 1 deletions
|
|
@ -29,7 +29,6 @@ zeppelin.PivotTransformation.prototype = Object.create(zeppelin.Transformation.p
|
|||
* Method will be invoked when tableData or config changes
|
||||
*/
|
||||
zeppelin.PivotTransformation.prototype.transform = function(tableData) {
|
||||
console.log('pivot config %o', this.config);
|
||||
return this.pivot(
|
||||
tableData,
|
||||
this.config.keys,
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ module.exports = function(config) {
|
|||
// endbower
|
||||
'src/app/app.js',
|
||||
'src/app/app.controller.js',
|
||||
'src/app/tabledata/transformation.js',
|
||||
'src/app/**/*.js',
|
||||
'src/components/**/*.js',
|
||||
'test/spec/**/*.js'
|
||||
|
|
|
|||
41
zeppelin-web/test/spec/tabledata/tabledata.js
Normal file
41
zeppelin-web/test/spec/tabledata/tabledata.js
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
describe('TableData build', function() {
|
||||
var td;
|
||||
|
||||
beforeEach(function() {
|
||||
var TableData = zeppelin.TableData;
|
||||
td = new TableData();
|
||||
});
|
||||
|
||||
it('should initialize the default value', function() {
|
||||
expect(td.columns.length).toBe(0);
|
||||
expect(td.rows.length).toBe(0);
|
||||
expect(td.comment).toBe('');
|
||||
});
|
||||
|
||||
it('should able to create Tabledata from paragraph result', function() {
|
||||
td.loadParagraphResult({
|
||||
type: 'TABLE',
|
||||
msg: 'key\tvalue\na\t10\nb\t20\n\nhello'
|
||||
});
|
||||
|
||||
expect(td.columns.length).toBe(2);
|
||||
expect(td.rows.length).toBe(2);
|
||||
expect(td.comment).toBe('hello');
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue