@makechart/viewer 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Change Logs
2
2
 
3
+ ## v0.0.4
4
+
5
+ - upgrade `@makechart/base` to `^0.2.0` ( `lite/index.html` / `d3/index.html` ) and `@plotdb/chart` to
6
+ `^3.7.0` ( `chart.utils` ), so charts extending them can be tested without linking local packages
7
+
8
+
9
+ ## v0.0.3
10
+
11
+ - ignore empty `style=""` attributes when serializing and comparing: whether one is left depends on
12
+ how a style was set before ( e.g. `style.x = ''` ), not on what is drawn. existing baselines that
13
+ still contain it compare equal without updating
14
+
15
+
3
16
  ## v0.0.2
4
17
 
5
18
  - add playground ( `/playground` in `mctest serve` ): apply any test case's data / config / size,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makechart/viewer",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "makechart 圖表的 test suite engine: 用不同資料、參數跑圖, 比對輸出 snapshot, 並以 @plotdb/dash 測 crossfilter",
5
5
  "homepage": "https://github.com/makechart/viewer",
6
6
  "repository": {
@@ -30,9 +30,9 @@
30
30
  "license": "MIT",
31
31
  "dependencies": {
32
32
  "@loadingio/ldquery": "^3.0.7",
33
- "@makechart/base": "^0.1.1",
33
+ "@makechart/base": "^0.2.0",
34
34
  "@plotdb/block": "^5.3.0",
35
- "@plotdb/chart": "^3.5.0",
35
+ "@plotdb/chart": "^3.7.0",
36
36
  "@plotdb/csscope": "^5.0.3",
37
37
  "@plotdb/konfig": "^4.11.1",
38
38
  "@plotdb/layout": "^0.0.12",
@@ -47,5 +47,8 @@
47
47
  "proxise": "^1.0.1",
48
48
  "wrap-svg-text": "^0.0.8",
49
49
  "zmgr": "^2.2.3"
50
+ },
51
+ "devDependencies": {
52
+ "fedep": "^1.9.0"
50
53
  }
51
54
  }
package/src/suite.ls CHANGED
@@ -122,7 +122,9 @@ mctest.serialize = serialize = (root) ->
122
122
  if n.nodeType != 1 => return
123
123
  tag = n.tagName
124
124
  if !n.namespaceURI or n.namespaceURI == "http://www.w3.org/1999/xhtml" => tag = tag.toLowerCase!
125
+ # 空的 style 屬性對畫面沒有作用, 有沒有留下來卻看設定過的歷程 ( 例如 style.x = '' 之前有沒有值 ), 略過
125
126
  attrs = Array.from(n.attributes)
127
+ .filter -> !(it.name == \style and !it.value.trim!)
126
128
  .map -> [it.name, it.value]
127
129
  .sort (a, b) -> if a.0 < b.0 => -1 else if a.0 > b.0 => 1 else 0
128
130
  .map ([k, v]) -> " #k=\"#{esc-attr v}\""
@@ -284,6 +286,8 @@ mctest.compare = (c, snaps) ->
284
286
  .then (r) -> if r.status == 204 => null else r.text!
285
287
  .then (baseline) ->
286
288
  if !(baseline?) => return {status: \new, current}
289
+ # 舊的 baseline 可能還留著空的 style 屬性 ( serialize 現在會略過 )
290
+ baseline = baseline.replace /\s+style=""/g, ''
287
291
  if baseline.trim! == current.trim! => return {status: \pass, current, baseline}
288
292
  a = baseline.trim!split \\n
289
293
  b = current.trim!split \\n