Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jest #2

Merged
merged 6 commits into from
Dec 28, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Added Jest tests for viewer-* components
  • Loading branch information
texodus committed Dec 27, 2017
commit e6c39c54c80308283d422ac765cb109e47a639ce
176 changes: 89 additions & 87 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,87 +1,89 @@
# -*- mode: gitignore; -*-
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*

# Org-mode
.org-id-locations
*_archive

# flymake-mode
*_flymake.*

# eshell files
/eshell/history
/eshell/lastdir

# elpa packages
/elpa/

# reftex files
*.rel

# AUCTeX auto folder
/auto/

# cask packages
.cask/
dist/

# Flycheck
flycheck_*.el

# server auth directory
/server/

# projectiles files
.projectile

# directory configuration
.dir-locals.el

# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

build
CMakeCache.txt
CMakeFiles
cmake_install.cmake
compile_commands.json
node_modules
*.mem
ftpsync.settings
# -*- mode: gitignore; -*-
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*

# Org-mode
.org-id-locations
*_archive

# flymake-mode
*_flymake.*

# eshell files
/eshell/history
/eshell/lastdir

# elpa packages
/elpa/

# reftex files
*.rel

# AUCTeX auto folder
/auto/

# cask packages
.cask/
dist/

# Flycheck
flycheck_*.el

# server auth directory
/server/

# projectiles files
.projectile

# directory configuration
.dir-locals.el

# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

build
CMakeCache.txt
CMakeFiles
cmake_install.cmake
compile_commands.json
node_modules
*.mem
ftpsync.settings
*.log
*.png
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
dist: trusty
language: node_js
node_js:
- "7"
- "8"

env:
global:
Expand Down
14 changes: 11 additions & 3 deletions packages/perspective-viewer-highcharts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@
],
"scripts": {
"highcharts": "webpack --config src/config/highcharts.plugin.config.js",
"start": "npm run highcharts",
"start": "npm run highcharts && npm run compile_test",
"compile_test": "cp test/html/* build",
"test": "jest 2>&1",
"clean": "find build -mindepth 1 -delete"
},
"jest": {
"roots": ["test/js"],
"verbose": true
},
"publishConfig": {
"access": "public"
},
Expand All @@ -30,10 +36,12 @@
"highcharts": "5.0.14",
"highcharts-grouped-categories": "1.1.2",
"highcharts-more": "^0.1.2",
"highcharts-heatmap": "^0.1.2",
"@jpmorganchase/perspective-common": "^0.0.0"
"highcharts-heatmap": "^0.1.2"
},
"devDependencies": {
"@jpmorganchase/perspective": "^0.0.0",
"@jpmorganchase/perspective-viewer": "^0.0.0",
"@jpmorganchase/perspective-common": "^0.0.0",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-polyfill": "^6.26.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ export function draw(mode) {
}

function resize(immediate) {
if (immediate) {
if (immediate && this._chart) {
this._chart.reflow();
} else {
if (this.resize_timer) {
Expand Down
42 changes: 42 additions & 0 deletions packages/perspective-viewer-highcharts/test/html/superstore.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!--

Copyright (c) 2017, the Perspective Authors.

This file is part of the Perspective library, distributed under the terms of
the Apache License 2.0. The full license can be found in the LICENSE file.

-->

<!DOCTYPE html>
<html>
<head>

<script src='https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/0.7.24/webcomponents.min.js'></script>
<script src="perspective.view.js"></script>
<script src="highcharts.plugin.js"></script>

<link rel='stylesheet' href="demo.css">

</head>
<body>

<perspective-viewer
columns='["Sales"]'>

</perspective-viewer>

<script>

window.addEventListener('WebComponentsReady', function () {
var xhr = new XMLHttpRequest();
xhr.open('GET', 'superstore.csv', true);
xhr.onload = function () {
document.getElementsByTagName('perspective-viewer')[0].load(xhr.response);
}
xhr.send(null);
});

</script>

</body>
</html>
10 changes: 10 additions & 0 deletions packages/perspective-viewer-highcharts/test/js/superstore.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/******************************************************************************
*
* Copyright (c) 2017, the Perspective Authors.
*
* This file is part of the Perspective library, distributed under the terms of
* the Apache License 2.0. The full license can be found in the LICENSE file.
*
*/

require('@jpmorganchase/perspective-viewer/test/js/superstore.spec.js');
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"shows a grid without any settings applied.":"0b72970cee991497863634d618af8d51","pivots by a row.":"4feefa957da0d2a9baf52c78c67920bd","pivots by two rows.":"3de5ec55ae3a158e23babca2f7a55bdd","pivots by a row and a column.":"108b0ee295cf9d200ed0fd9316355024","pivots by two rows and two columns.":"f6941cb564d89fcf4e1908da7c8a92dc","sorts by a numeric column.":"11fd50195316fe23ff614a178d8d24e6","sorts by an alpha column.":"5243c9815b2c95f7c0a8de8b7b8035b4","displays visible columns.":"dab914d3f619988f88ecbd89df9b2f55"}
112 changes: 62 additions & 50 deletions packages/perspective-viewer-hypergrid/package.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,62 @@
{
"name": "@jpmorganchase/perspective-viewer-hypergrid",
"version": "0.0.0",
"description": "Perspective.js",
"main": "src/js/hypergrid.js",
"directories": {
"test": "test"
},
"files": [
"src/*",
"build/*"
],
"scripts": {
"hypergrid": "webpack --config src/config/hypergrid.plugin.config.js",
"start": "npm run hypergrid",
"clean": "find build -mindepth 1 -delete"
},
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/jpmorganchase/perspective"
},
"author": "",
"license": "Apache",
"dependencies": {
"babel-runtime": "^6.26.0",
"fin-hypergrid": "2.0.2",
"underscore": "^1.8.3",
"@jpmorganchase/perspective-common": "^0.0.0"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-polyfill": "^6.26.0",
"babel-plugin-transform-es2015-for-of": "^6.23.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.6.0",
"chart.js": "^2.7.1",
"css-loader": "^0.28.7",
"html-loader": "^0.5.1",
"less": "^2.7.2",
"less-loader": "^4.0.5",
"style-loader": "^0.18.2",
"uglifyjs-webpack-plugin": "^0.4.6",
"webpack": "^3.5.6",
"@jpmorganchase/perspective-common": "^0.0.0"
}
}
{
"name": "@jpmorganchase/perspective-viewer-hypergrid",
"version": "0.0.0",
"description": "Perspective.js",
"main": "src/js/hypergrid.js",
"directories": {
"test": "test"
},
"files": [
"src/*",
"build/*"
],
"scripts": {
"hypergrid": "webpack --config src/config/hypergrid.plugin.config.js",
"start": "npm run hypergrid && npm run compile_test",
"compile_test": "cp test/html/* build",
"test": "jest 2>&1",
"clean": "find build -mindepth 1 -delete"
},
"jest": {
"roots": ["test/js"],
"verbose": true
},
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/jpmorganchase/perspective"
},
"author": "",
"license": "Apache",
"dependencies": {
"babel-runtime": "^6.26.0",
"fin-hypergrid": "2.0.2",
"underscore": "^1.8.3",
"@jpmorganchase/perspective-common": "^0.0.0"
},
"devDependencies": {
"@jpmorganchase/perspective": "^0.0.0",
"@jpmorganchase/perspective-common": "^0.0.0",
"@jpmorganchase/perspective-viewer": "^0.0.0",
"babel-core": "^6.26.0",
"babel-jest": "^22.0.4",
"babel-loader": "^7.1.2",
"babel-plugin-transform-es2015-for-of": "^6.23.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.0",
"chart.js": "^2.7.1",
"css-loader": "^0.28.7",
"html-loader": "^0.5.1",
"http-server": "^0.10.0",
"jest": "^22.0.4",
"less": "^2.7.2",
"less-loader": "^4.0.5",
"puppeteer": "^0.13.0",
"style-loader": "^0.18.2",
"uglifyjs-webpack-plugin": "^0.4.6",
"webpack": "^3.5.6"
}
}
Loading