kokopu-react 1.5.5 → 1.7.1

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.
Files changed (116) hide show
  1. package/.nycrc.yml +1 -1
  2. package/CHANGELOG.md +18 -0
  3. package/README.md +2 -2
  4. package/dist/lib/ArrowMarkerIcon.js +2 -2
  5. package/dist/lib/Chessboard.js +26 -18
  6. package/dist/lib/Movetext.js +41 -82
  7. package/dist/lib/formatmove.js +119 -0
  8. package/dist/lib/impl/HtmlSanitizer.js +8 -3
  9. package/dist/lib/impl/colorsets.js +44 -44
  10. package/dist/lib/impl/util.js +1 -1
  11. package/dist/lib/index.js +14 -0
  12. package/dist/lib/markers.js +7 -7
  13. package/doc_src/demo/PageChessboardInteraction.js +4 -3
  14. package/doc_src/demo/PageChessboardMove.js +36 -5
  15. package/doc_src/demo/demo.css +4 -0
  16. package/{graphic_test_app → graphic_test_src}/01_marker_icons.js +0 -0
  17. package/{graphic_test_app → graphic_test_src}/02_chessboard_simple.js +0 -0
  18. package/{graphic_test_app → graphic_test_src}/03_chessboard_flipped.js +0 -0
  19. package/{graphic_test_app → graphic_test_src}/04_chessboard_annotations.js +8 -8
  20. package/{graphic_test_app → graphic_test_src}/05_chessboard_move.js +4 -4
  21. package/{graphic_test_app → graphic_test_src}/06_chessboard_theme.js +2 -2
  22. package/{graphic_test_app → graphic_test_src}/07_chessboard_click_squares.js +0 -0
  23. package/{graphic_test_app → graphic_test_src}/08_chessboard_move_pieces.js +1 -1
  24. package/{graphic_test_app → graphic_test_src}/09_chessboard_edit_arrows.js +0 -0
  25. package/{graphic_test_app → graphic_test_src}/10_chessboard_play_moves.js +1 -1
  26. package/{graphic_test_app → graphic_test_src}/11_chessboard_play_promotions.js +0 -0
  27. package/{graphic_test_app → graphic_test_src}/12_movetext_simple.js +0 -0
  28. package/{graphic_test_app → graphic_test_src}/13_movetext_error.js +0 -0
  29. package/{graphic_test_app → graphic_test_src}/14_movetext_html.js +0 -0
  30. package/{graphic_test_app → graphic_test_src}/15_movetext_options.js +0 -4
  31. package/{graphic_test_app → graphic_test_src}/16_movetext_interaction.js +0 -0
  32. package/{graphic_test_app → graphic_test_src}/common/dummy.pgn +0 -0
  33. package/{graphic_test_app → graphic_test_src}/common/games.pgn +11 -5
  34. package/{graphic_test_app → graphic_test_src}/common/heartbeat.txt +0 -0
  35. package/graphic_test_src/common/smiley.png +0 -0
  36. package/{graphic_test_app → graphic_test_src}/common/test_app.css +0 -0
  37. package/{graphic_test_app → graphic_test_src}/common/test_app.js +3 -2
  38. package/graphics/chess_sprites/cburnett/bb.svg +45 -0
  39. package/graphics/chess_sprites/cburnett/bk.svg +47 -0
  40. package/graphics/chess_sprites/cburnett/bn.svg +37 -0
  41. package/graphics/chess_sprites/cburnett/bp.svg +19 -0
  42. package/graphics/chess_sprites/cburnett/bq.svg +58 -0
  43. package/graphics/chess_sprites/cburnett/br.svg +60 -0
  44. package/graphics/chess_sprites/cburnett/bx.svg +56 -0
  45. package/graphics/chess_sprites/cburnett/wb.svg +48 -0
  46. package/graphics/chess_sprites/cburnett/wk.svg +26 -0
  47. package/graphics/chess_sprites/cburnett/wn.svg +37 -0
  48. package/graphics/chess_sprites/cburnett/wp.svg +19 -0
  49. package/graphics/chess_sprites/cburnett/wq.svg +60 -0
  50. package/graphics/chess_sprites/cburnett/wr.svg +44 -0
  51. package/graphics/chess_sprites/cburnett/wx.svg +56 -0
  52. package/graphics/chess_sprites/generate_sprites.sh +135 -0
  53. package/graphics/chess_sprites/mmonge/celtic-bx.svg +112 -0
  54. package/graphics/chess_sprites/mmonge/celtic-wx.svg +111 -0
  55. package/graphics/chess_sprites/mmonge/celtic.svg +1576 -0
  56. package/graphics/chess_sprites/mmonge/eyes-spatial-bx.svg +101 -0
  57. package/graphics/chess_sprites/mmonge/eyes-spatial-wx.svg +100 -0
  58. package/graphics/chess_sprites/mmonge/eyes.svg +2538 -0
  59. package/graphics/chess_sprites/mmonge/fantasy-bx.svg +112 -0
  60. package/graphics/chess_sprites/mmonge/fantasy-wx.svg +111 -0
  61. package/graphics/chess_sprites/mmonge/fantasy.svg +5497 -0
  62. package/graphics/chess_sprites/mmonge/fantasy_alt.svg +3742 -0
  63. package/graphics/chess_sprites/mmonge/freak.svg +3479 -0
  64. package/graphics/chess_sprites/mmonge/prmi.svg +6776 -0
  65. package/graphics/chess_sprites/mmonge/skulls-bx.svg +124 -0
  66. package/graphics/chess_sprites/mmonge/skulls-wx.svg +111 -0
  67. package/graphics/chess_sprites/mmonge/skulls.svg +12978 -0
  68. package/graphics/chess_sprites/mmonge/spatial.svg +1223 -0
  69. package/package.json +28 -22
  70. package/scripts/{test_graphic/clean-graphic-output.js → clean-graphic-output.js} +1 -1
  71. package/scripts/docker-compose.yml +14 -0
  72. package/scripts/{test_graphic/webpack-config.js → test-graphic.webpack.config.js} +9 -5
  73. package/scripts/{test_headless.webpack-config.js → test-headless.webpack.config.js} +2 -1
  74. package/src/Chessboard.js +24 -16
  75. package/src/Movetext.js +37 -59
  76. package/src/formatmove.js +91 -0
  77. package/src/impl/HtmlSanitizer.js +8 -2
  78. package/src/impl/colorsets.js +44 -44
  79. package/src/impl/util.js +1 -1
  80. package/src/index.js +1 -0
  81. package/src/markers.js +7 -7
  82. package/test/1_markers.js +14 -14
  83. package/test/common/graphic.js +2 -2
  84. package/test/references/04_chessboard_annotations/0.png +0 -0
  85. package/test/references/04_chessboard_annotations/1.png +0 -0
  86. package/test/references/04_chessboard_annotations/2.png +0 -0
  87. package/test/references/04_chessboard_annotations/3.png +0 -0
  88. package/test/references/04_chessboard_annotations/4.png +0 -0
  89. package/test/references/04_chessboard_annotations/5.png +0 -0
  90. package/test/references/05_chessboard_move/3.png +0 -0
  91. package/test/references/05_chessboard_move/4.png +0 -0
  92. package/test/references/05_chessboard_move/5.png +0 -0
  93. package/test/references/05_chessboard_move/6.png +0 -0
  94. package/test/references/06_chessboard_theme/0.png +0 -0
  95. package/test/references/06_chessboard_theme/1.png +0 -0
  96. package/test/references/06_chessboard_theme/2.png +0 -0
  97. package/test/references/06_chessboard_theme/3.png +0 -0
  98. package/test/references/06_chessboard_theme/4.png +0 -0
  99. package/test/references/06_chessboard_theme/5.png +0 -0
  100. package/test/references/06_chessboard_theme/6.png +0 -0
  101. package/test/references/06_chessboard_theme/7.png +0 -0
  102. package/test/references/06_chessboard_theme/8.png +0 -0
  103. package/test/references/08_chessboard_move_pieces/over_arrow_marker.png +0 -0
  104. package/test/references/08_chessboard_move_pieces/over_square_marker.png +0 -0
  105. package/test/references/08_chessboard_move_pieces/over_text_marker.png +0 -0
  106. package/test/references/09_chessboard_edit_arrows/base_1.png +0 -0
  107. package/test/references/09_chessboard_edit_arrows/base_2.png +0 -0
  108. package/test/references/09_chessboard_edit_arrows/null_vector.png +0 -0
  109. package/test/references/09_chessboard_edit_arrows/over_arrow_marker.png +0 -0
  110. package/test/references/09_chessboard_edit_arrows/over_square_marker.png +0 -0
  111. package/test/references/10_chessboard_play_moves/castling_move.png +0 -0
  112. package/test/references/10_chessboard_play_moves/regular_move_2.png +0 -0
  113. package/test/references/14_movetext_html/0.png +0 -0
  114. package/test/references/14_movetext_html/1.png +0 -0
  115. package/test/references/14_movetext_html/2.png +0 -0
  116. package/scripts/test_graphic/docker-compose.yml +0 -14
@@ -25,42 +25,42 @@ export default {
25
25
  original: {
26
26
  b: '#b5876b',
27
27
  w: '#f0dec7',
28
- g: '#0e0',
29
- r: '#d00',
30
- y: '#db0',
31
- highlight: '#04f',
28
+ cb: '#04f',
29
+ cg: '#0e0',
30
+ cr: '#d00',
31
+ cy: '#db0',
32
32
  },
33
33
  gray: {
34
34
  b: '#bbbbbb',
35
35
  w: '#f8f8f8',
36
- g: '#0a0',
37
- r: '#d00',
38
- y: '#a90',
39
- highlight: '#04f',
36
+ cb: '#04f',
37
+ cg: '#0a0',
38
+ cr: '#d00',
39
+ cy: '#a90',
40
40
  },
41
41
  scid: {
42
42
  b: '#7389b6',
43
43
  w: '#f3f3f3',
44
- g: '#0e0',
45
- r: '#d00',
46
- y: '#db0',
47
- highlight: '#04f',
44
+ cb: '#04f',
45
+ cg: '#0e0',
46
+ cr: '#d00',
47
+ cy: '#db0',
48
48
  },
49
49
  wikipedia: {
50
50
  b: '#d18b47',
51
51
  w: '#ffce9e',
52
- g: '#0e0',
53
- r: '#d00',
54
- y: '#db0',
55
- highlight: '#04f',
52
+ cb: '#04f',
53
+ cg: '#0e0',
54
+ cr: '#d00',
55
+ cy: '#db0',
56
56
  },
57
57
  xboard: {
58
58
  b: '#77a26d',
59
59
  w: '#c8c365',
60
- g: '#0f0',
61
- r: '#d00',
62
- y: '#ff0',
63
- highlight: '#04f',
60
+ cb: '#04f',
61
+ cg: '#0f0',
62
+ cr: '#d00',
63
+ cy: '#ff0',
64
64
  },
65
65
 
66
66
  /*
@@ -70,50 +70,50 @@ export default {
70
70
  coral: {
71
71
  b: 'rgb(112,162,163)',
72
72
  w: 'rgb(177,228,185)',
73
- g: '#080',
74
- r: '#d00',
75
- y: '#ff0',
76
- highlight: '#04f',
73
+ cb: '#04f',
74
+ cg: '#080',
75
+ cr: '#d00',
76
+ cy: '#ff0',
77
77
  },
78
78
  dusk: {
79
79
  b: 'rgb(112,102,119)',
80
80
  w: 'rgb(204,183,174)',
81
- g: '#3f3',
82
- r: '#f20',
83
- y: '#ff0',
84
- highlight: '#04f',
81
+ cb: '#04f',
82
+ cg: '#3f3',
83
+ cr: '#f20',
84
+ cy: '#ff0',
85
85
  },
86
86
  emerald: {
87
87
  b: 'rgb(111,143,114)',
88
88
  w: 'rgb(173,189,143)',
89
- g: '#6f6',
90
- r: '#d00',
91
- y: '#ff0',
92
- highlight: '#04f',
89
+ cb: '#04f',
90
+ cg: '#6f6',
91
+ cr: '#d00',
92
+ cy: '#ff0',
93
93
  },
94
94
  marine: {
95
95
  b: 'rgb(111,115,210)',
96
96
  w: 'rgb(157,172,255)',
97
- g: '#6f6',
98
- r: '#f50',
99
- y: '#ff0',
100
- highlight: '#04f',
97
+ cb: '#04f',
98
+ cg: '#6f6',
99
+ cr: '#f50',
100
+ cy: '#ff0',
101
101
  },
102
102
  sandcastle: {
103
103
  b: 'rgb(184,139,74)',
104
104
  w: 'rgb(227,193,111)',
105
- g: '#0c3',
106
- r: '#d02',
107
- y: '#ff0',
108
- highlight: '#04f',
105
+ cb: '#04f',
106
+ cg: '#0c3',
107
+ cr: '#d02',
108
+ cy: '#ff0',
109
109
  },
110
110
  wheat: {
111
111
  b: 'rgb(187,190,100)',
112
112
  w: 'rgb(234,240,206)',
113
- g: '#0c3',
114
- r: '#d00',
115
- y: '#ff3',
116
- highlight: '#04f',
113
+ cb: '#04f',
114
+ cg: '#0c3',
115
+ cr: '#d00',
116
+ cy: '#ff3',
117
117
  },
118
118
 
119
119
  };
package/src/impl/util.js CHANGED
@@ -51,7 +51,7 @@ export function isValidVector(vect) {
51
51
 
52
52
 
53
53
  export function isValidColor(color) {
54
- return color === 'g' || color === 'r' || color === 'y';
54
+ return color === 'b' || color === 'g' || color === 'r' || color === 'y';
55
55
  }
56
56
 
57
57
 
package/src/index.js CHANGED
@@ -21,6 +21,7 @@
21
21
 
22
22
 
23
23
  export { flattenSquareMarkers, parseSquareMarkers, flattenTextMarkers, parseTextMarkers, flattenArrowMarkers, parseArrowMarkers } from './markers';
24
+ export { formatMove, moveFormatter } from './formatmove';
24
25
  export { default as i18n } from './i18n';
25
26
  export { default as Chessboard } from './Chessboard';
26
27
  export { default as ErrorBox } from './ErrorBox';
package/src/markers.js CHANGED
@@ -56,8 +56,8 @@ export function flattenTextMarkers(markers) {
56
56
  /**
57
57
  * Transform a set of arrow markers defined as a "squareFromSquareTo -> color" struct into a comma-separated string.
58
58
  *
59
- * @param {object} markers For example: `{ e2e4: 'g', g8f6: 'r', g8h6: 'y' }`
60
- * @returns {string} For example: `'Ge2e4,Rg8f6,Yg8h6'`
59
+ * @param {object} markers For example: `{ e2e4: 'g', g8f6: 'r', g8h6: 'b' }`
60
+ * @returns {string} For example: `'Ge2e4,Rg8f6,Bg8h6'`
61
61
  */
62
62
  export function flattenArrowMarkers(markers) {
63
63
  return Object.entries(markers)
@@ -83,7 +83,7 @@ function parseMarkers(markers, tokenParser) {
83
83
  */
84
84
  export function parseSquareMarkers(markers) {
85
85
  return parseMarkers(markers, token => {
86
- return /^([GRY])([a-h][1-8])$/.test(token) ? { key: RegExp.$2, value: RegExp.$1.toLowerCase() } : undefined;
86
+ return /^([BGRY])([a-h][1-8])$/.test(token) ? { key: RegExp.$2, value: RegExp.$1.toLowerCase() } : undefined;
87
87
  });
88
88
  }
89
89
 
@@ -96,7 +96,7 @@ export function parseSquareMarkers(markers) {
96
96
  */
97
97
  export function parseTextMarkers(markers) {
98
98
  return parseMarkers(markers, token => {
99
- return /^([GRY])(?:([A-Za-z0-9])|\((plus|times|dot|circle)\))([a-h][1-8])$/.test(token) ?
99
+ return /^([BGRY])(?:([A-Za-z0-9])|\((plus|times|dot|circle)\))([a-h][1-8])$/.test(token) ?
100
100
  { key: RegExp.$4, value: { symbol: RegExp.$2 || RegExp.$3, color: RegExp.$1.toLowerCase() } } : undefined;
101
101
  });
102
102
  }
@@ -105,11 +105,11 @@ export function parseTextMarkers(markers) {
105
105
  /**
106
106
  * Parse a set of arrow markers defined as a comma-separated string into a "squareFromSquareTo -> color" struct.
107
107
  *
108
- * @param {string} markers For example: `'Ge2e4,Rg8f6,Yg8h6'`
109
- * @returns {object} For example: `{ e2e4: 'g', g8f6: 'r', g8h6: 'y' }`
108
+ * @param {string} markers For example: `'Ge2e4,Rg8f6,Bg8h6'`
109
+ * @returns {object} For example: `{ e2e4: 'g', g8f6: 'r', g8h6: 'b' }`
110
110
  */
111
111
  export function parseArrowMarkers(markers) {
112
112
  return parseMarkers(markers, token => {
113
- return /^([GRY])([a-h][1-8][a-h][1-8])$/.test(token) ? { key: RegExp.$2, value: RegExp.$1.toLowerCase() } : undefined;
113
+ return /^([BGRY])([a-h][1-8][a-h][1-8])$/.test(token) ? { key: RegExp.$2, value: RegExp.$1.toLowerCase() } : undefined;
114
114
  });
115
115
  }
package/test/1_markers.js CHANGED
@@ -28,7 +28,7 @@ describe('Flatten square markers', () => {
28
28
 
29
29
  it('Re4', () => { test.value(flattenSquareMarkers({ e4: 'r' })).is('Re4'); });
30
30
  it('Gd3,Yh8', () => { test.value(flattenSquareMarkers({ h8: 'y', d3: 'g' })).is('Gd3,Yh8'); });
31
- it('Ga1,Yc5,Rd2,Rh7,Yh8', () => { test.value(flattenSquareMarkers({ c5: 'y', h8: 'y', a1: 'g', h7: 'r', d2: 'r' })).is('Ga1,Yc5,Rd2,Rh7,Yh8'); });
31
+ it('Ga1,Yc5,Rd2,Bh7,Yh8', () => { test.value(flattenSquareMarkers({ c5: 'y', h8: 'y', a1: 'g', h7: 'b', d2: 'r' })).is('Ga1,Yc5,Rd2,Bh7,Yh8'); });
32
32
  it('<empty>', () => { test.value(flattenSquareMarkers({})).is(''); });
33
33
 
34
34
  it('Wrong square', () => { test.value(flattenSquareMarkers({ e1: 'r', k9: 'g', whatever: 'y' })).is('Re1'); });
@@ -40,13 +40,13 @@ describe('Parse square markers', () => {
40
40
 
41
41
  it('Re4', () => { test.value(parseSquareMarkers('Re4')).is({ e4: 'r' }); });
42
42
  it('Gd3,Yh8', () => { test.value(parseSquareMarkers('Gd3,Yh8')).is({ h8: 'y', d3: 'g' }); });
43
- it('Ga1,Yc5,Rd2,Rh7,Yh8', () => { test.value(parseSquareMarkers(' Ga1, Yh8,Yc5 ,Rd2, Rh7 ')).is({ c5: 'y', h8: 'y', a1: 'g', h7: 'r', d2: 'r' }); });
43
+ it('Ga1,Yc5,Rd2,Bh7,Yh8', () => { test.value(parseSquareMarkers(' Ga1, Yh8,Yc5 ,Rd2, Bh7 ')).is({ c5: 'y', h8: 'y', a1: 'g', h7: 'b', d2: 'r' }); });
44
44
  it('<empty>', () => { test.value(parseSquareMarkers('')).is({}); });
45
45
  it('<blank>', () => { test.value(parseSquareMarkers(' ')).is({}); });
46
46
 
47
47
  it('Wrong square', () => { test.value(parseSquareMarkers('Rg9,Ye1')).is({ e1: 'y' }); });
48
48
  it('Duplicated square', () => { test.value(parseSquareMarkers('Ra3,Ya3')).is({ a3: 'y' }); });
49
- it('Wrong color', () => { test.value(parseSquareMarkers('Ga6,Bg5')).is({ a6: 'g' }); });
49
+ it('Wrong color', () => { test.value(parseSquareMarkers('Ga6,Cg5')).is({ a6: 'g' }); });
50
50
  it('Wrong format', () => { test.value(parseSquareMarkers('Something Ra2 invalid, Ye4, G g3')).is({ e4: 'y' }); });
51
51
  });
52
52
 
@@ -58,13 +58,13 @@ describe('Flatten text markers', () => {
58
58
  h8: { symbol: '1', color: 'y' },
59
59
  d3: { symbol: 'z', color: 'g' },
60
60
  })).is('Gzd3,Y1h8'); });
61
- it('G2a1,YMc5,RLd2,Rxh7,Ywh8', () => { test.value(flattenTextMarkers({
61
+ it('G2a1,YMc5,RLd2,Rxh7,Bwh8', () => { test.value(flattenTextMarkers({
62
62
  c5: { symbol: 'M', color: 'y' },
63
- h8: { symbol: 'w', color: 'y' },
63
+ h8: { symbol: 'w', color: 'b' },
64
64
  a1: { symbol: '2', color: 'g' },
65
65
  h7: { symbol: 'x', color: 'r' },
66
66
  d2: { symbol: 'L', color: 'r' },
67
- })).is('G2a1,YMc5,RLd2,Rxh7,Ywh8'); });
67
+ })).is('G2a1,YMc5,RLd2,Rxh7,Bwh8'); });
68
68
  it('Multi-character symbols', () => { test.value(flattenTextMarkers({
69
69
  a1: { symbol: 'A', color: 'y' },
70
70
  a7: { symbol: 'plus', color: 'g' },
@@ -104,9 +104,9 @@ describe('Parse text markers', () => {
104
104
  h8: { symbol: '1', color: 'y' },
105
105
  d3: { symbol: 'z', color: 'g' },
106
106
  }); });
107
- it('G2a1,YMc5,RLd2,Rxh7,Ywh8', () => { test.value(parseTextMarkers(' G2a1, Rxh7 ,YMc5 ,RLd2,Ywh8 ')).is({
107
+ it('G2a1,YMc5,RLd2,Rxh7,Bwh8', () => { test.value(parseTextMarkers(' G2a1, Rxh7 ,YMc5 ,RLd2,Bwh8 ')).is({
108
108
  c5: { symbol: 'M', color: 'y' },
109
- h8: { symbol: 'w', color: 'y' },
109
+ h8: { symbol: 'w', color: 'b' },
110
110
  a1: { symbol: '2', color: 'g' },
111
111
  h7: { symbol: 'x', color: 'r' },
112
112
  d2: { symbol: 'L', color: 'r' },
@@ -123,7 +123,7 @@ describe('Parse text markers', () => {
123
123
 
124
124
  it('Wrong square', () => { test.value(parseTextMarkers('RHg9,Yxe1')).is({ e1: { symbol: 'x', color: 'y' } }); });
125
125
  it('Duplicated square', () => { test.value(parseTextMarkers('Rka3,Gba3')).is({ a3: { symbol: 'b', color: 'g' } }); });
126
- it('Wrong color', () => { test.value(parseTextMarkers('G3a6,BAg5')).is({ a6: { symbol: '3', color: 'g' } }); });
126
+ it('Wrong color', () => { test.value(parseTextMarkers('G3a6,CAg5')).is({ a6: { symbol: '3', color: 'g' } }); });
127
127
  it('Wrong symbol', () => { test.value(parseTextMarkers('Rb2,RAg5,G.d3,Yabcde7')).is({ g5: { symbol: 'A', color: 'r' } }); });
128
128
  it('Wrong multi-character symbol', () => { test.value(parseTextMarkers('RZb2,Y(whatever)e4')).is({ b2: { symbol: 'Z', color: 'r' } }); });
129
129
  it('Wrong format', () => { test.value(parseTextMarkers('Something RHa2 invalid, Yqe4, G g3')).is({ e4: { symbol: 'q', color: 'y' } }); });
@@ -134,8 +134,8 @@ describe('Flatten arrow markers', () => {
134
134
 
135
135
  it('Re4d6', () => { test.value(flattenArrowMarkers({ e4d6: 'r' })).is('Re4d6'); });
136
136
  it('Gd3b4,Yh8h7', () => { test.value(flattenArrowMarkers({ h8h7: 'y', d3b4: 'g' })).is('Gd3b4,Yh8h7'); });
137
- it('Ga1h8,Yc5a1,Rd2d2,Rh7h8,Yh8c5', () => { test.value(flattenArrowMarkers({ c5a1: 'y', h8c5: 'y', a1h8: 'g', h7h8: 'r', d2d2: 'r' }))
138
- .is('Ga1h8,Yc5a1,Rd2d2,Rh7h8,Yh8c5'); });
137
+ it('Ga1h8,Yc5a1,Rd2d2,Rh7h8,Bh8c5', () => { test.value(flattenArrowMarkers({ c5a1: 'y', h8c5: 'b', a1h8: 'g', h7h8: 'r', d2d2: 'r' }))
138
+ .is('Ga1h8,Yc5a1,Rd2d2,Rh7h8,Bh8c5'); });
139
139
  it('<empty>', () => { test.value(flattenArrowMarkers({})).is(''); });
140
140
 
141
141
  it('Wrong vector', () => { test.value(flattenArrowMarkers({ e1c2: 'r', a1b9: 'g', c0d2: 'r', i3d4: 'r', f2k3: 'g', whatever: 'y' })).is('Re1c2'); });
@@ -147,13 +147,13 @@ describe('Parse arrow markers', () => {
147
147
 
148
148
  it('Re4d6', () => { test.value(parseArrowMarkers('Re4d6')).is({ e4d6: 'r' }); });
149
149
  it('Gd3b4,Yh8h7', () => { test.value(parseArrowMarkers('Gd3b4,Yh8h7')).is({ h8h7: 'y', d3b4: 'g' }); });
150
- it('Ga1h8,Yc5a1,Rd2d2,Rh7h8,Yh8c5', () => { test.value(parseArrowMarkers(' Yh8c5,Ga1h8 , Yc5a1 , Rd2d2,Rh7h8 '))
151
- .is({ c5a1: 'y', h8c5: 'y', a1h8: 'g', h7h8: 'r', d2d2: 'r' }); });
150
+ it('Ga1h8,Yc5a1,Rd2d2,Rh7h8,Bh8c5', () => { test.value(parseArrowMarkers(' Bh8c5,Ga1h8 , Yc5a1 , Rd2d2,Rh7h8 '))
151
+ .is({ c5a1: 'y', h8c5: 'b', a1h8: 'g', h7h8: 'r', d2d2: 'r' }); });
152
152
  it('<empty>', () => { test.value(parseArrowMarkers('')).is({}); });
153
153
  it('<blank>', () => { test.value(parseArrowMarkers(' ')).is({}); });
154
154
 
155
155
  it('Wrong vector', () => { test.value(parseArrowMarkers('Re1c2,Ga1b9,Rc0d2,Ri3d4,Gf2k3')).is({ e1c2: 'r' }); });
156
156
  it('Duplicated vector', () => { test.value(parseArrowMarkers('Ya3b4,Ra3b4')).is({ a3b4: 'r' }); });
157
- it('Wrong color', () => { test.value(parseArrowMarkers('Ga6c5,Bg5e2')).is({ a6c5: 'g' }); });
157
+ it('Wrong color', () => { test.value(parseArrowMarkers('Ga6c5,Cg5e2')).is({ a6c5: 'g' }); });
158
158
  it('Wrong format', () => { test.value(parseArrowMarkers('Something Rb1a2 invalid, Ye4c7, G g3b1')).is({ e4c7: 'y' }); });
159
159
  });
@@ -34,8 +34,8 @@ const coverageDir = rootDir + '/build/.nyc_output';
34
34
  const UNREACHABLE_TEST_CLIENT_MESSAGE =
35
35
  'Cannot reach the dockerized selenium webbrowser used for graphic tests (probably because the test environment is not running).\n' +
36
36
  '\n' +
37
- 'Use command `npm run start_test_env` to start the test environment.\n' +
38
- 'Do not forget to run `npm run stop_test_env` when finished.\n';
37
+ 'Use command `npm run test_env:start` to start the test environment.\n' +
38
+ 'Do not forget to run `npm run test_env:stop` when finished.\n';
39
39
 
40
40
 
41
41
  /**
@@ -1,14 +0,0 @@
1
- version: "3.7"
2
-
3
- services:
4
- web-client:
5
- image: selenium/standalone-firefox:4.1.4-20220427
6
- shm_size: '2gb'
7
- ports:
8
- - 4444:4444 # Driver (http://localhost:4444)
9
- - 7900:7900 # VNC (http://localhost:7900, pass: secret)
10
- volumes:
11
- - type: bind
12
- source: ../..
13
- target: /app
14
- read_only: true