@json-editor/json-editor 2.14.0 → 2.15.0

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 (83) hide show
  1. package/.env +4 -0
  2. package/.eslintrc +4 -1
  3. package/.github/workflows/build.yml +5 -4
  4. package/CHANGELOG.md +31 -0
  5. package/README.md +32 -1
  6. package/config/webpack.common.js +2 -6
  7. package/dist/jsoneditor.js +1 -1
  8. package/dist/jsoneditor.js.LICENSE.txt +1 -1
  9. package/dist/nonmin/jsoneditor.js +4152 -3955
  10. package/dist/nonmin/jsoneditor.js.map +1 -1
  11. package/docs/meta-schema.html +793 -0
  12. package/package.json +13 -13
  13. package/src/core.js +5 -1
  14. package/src/defaults.js +9 -2
  15. package/src/editor.js +34 -15
  16. package/src/editors/array.js +10 -7
  17. package/src/editors/base64.js +3 -0
  18. package/src/editors/describedby.js +2 -2
  19. package/src/editors/enum.js +9 -1
  20. package/src/editors/info.js +8 -0
  21. package/src/editors/multiple.js +16 -3
  22. package/src/editors/object.js +26 -7
  23. package/src/editors/radio.js +9 -2
  24. package/src/editors/select.js +19 -8
  25. package/src/editors/select2.js +1 -1
  26. package/src/editors/starrating.js +5 -4
  27. package/src/editors/string.js +17 -1
  28. package/src/editors/table.js +2 -2
  29. package/src/iconlib.js +0 -1
  30. package/src/schemaloader.js +2 -2
  31. package/src/style.css +4 -0
  32. package/src/style.css.js +1 -1
  33. package/src/templates/default.js +2 -2
  34. package/src/theme.js +13 -3
  35. package/src/themes/bootstrap3.js +0 -9
  36. package/src/themes/index.js +0 -1
  37. package/src/validator.js +4 -4
  38. package/tests/Dockerfile +1 -1
  39. package/tests/codeceptjs/core_test.js +8 -2
  40. package/tests/codeceptjs/editors/array_test.js +11 -6
  41. package/tests/codeceptjs/editors/autocomplete_test.js +0 -1
  42. package/tests/codeceptjs/editors/integer_test.js +0 -4
  43. package/tests/codeceptjs/editors/object_test.js +8 -0
  44. package/tests/codeceptjs/editors/rating_test.js +1 -1
  45. package/tests/codeceptjs/editors/select_test.js +18 -0
  46. package/tests/codeceptjs/editors/starrating_test.js +15 -0
  47. package/tests/codeceptjs/editors/string_test.js +7 -0
  48. package/tests/codeceptjs/issues/issue-gh-1158_test.js +1 -1
  49. package/tests/codeceptjs/issues/issue-gh-1164_test.js +0 -1
  50. package/tests/codeceptjs/issues/issue-gh-1171_test.js +11 -0
  51. package/tests/codeceptjs/issues/issue-gh-1272_test.js +21 -0
  52. package/tests/codeceptjs/issues/issue-gh-1383_test.js +1 -1
  53. package/tests/codeceptjs/issues/issue-gh-1452_test.js +10 -0
  54. package/tests/codeceptjs/issues/issue-gh-1485_test.js +13 -0
  55. package/tests/codeceptjs/issues/issue-gh-1491_test.js +9 -0
  56. package/tests/codeceptjs/issues/issue-gh-1525_test.js +9 -0
  57. package/tests/codeceptjs/issues/issue-gh-1536_test.js +12 -0
  58. package/tests/codeceptjs/issues/issue-gh-1538_test.js +10 -0
  59. package/tests/codeceptjs/issues/issue-gh-1541_test.js +8 -0
  60. package/tests/docker-compose-local.yml +1 -2
  61. package/tests/docker-compose.yml +0 -1
  62. package/tests/pages/array-events-table.html +39 -31
  63. package/tests/pages/array-events.html +39 -31
  64. package/tests/pages/assets/autocomplete.css +1 -0
  65. package/tests/pages/assets/autocomplete.min.js +1 -0
  66. package/tests/pages/autocomplete.html +4 -4
  67. package/tests/pages/enforce-const.html +176 -0
  68. package/tests/pages/issues/issue-gh-1171.html +39 -0
  69. package/tests/pages/issues/issue-gh-1272.html +167 -0
  70. package/tests/pages/issues/issue-gh-1452.html +98 -0
  71. package/tests/pages/issues/issue-gh-1466.html +63 -0
  72. package/tests/pages/issues/issue-gh-1485.html +59 -0
  73. package/tests/pages/issues/issue-gh-1491.html +59 -0
  74. package/tests/pages/issues/issue-gh-1525.html +62 -0
  75. package/tests/pages/issues/issue-gh-1536.html +55 -0
  76. package/tests/pages/issues/issue-gh-1538.html +56 -0
  77. package/tests/pages/issues/issue-gh-1541.html +51 -0
  78. package/tests/pages/issues/issue-gh-1541.json +9 -0
  79. package/tests/pages/placeholder-options.html +57 -0
  80. package/tests/pages/prompt-paste-max-length-reached.html +51 -0
  81. package/tests/pages/remove-false-properties.html +85 -0
  82. package/tests/pages/starrating.html +86 -0
  83. package/tests/unit/editor.spec.js +1 -1
package/src/style.css.js CHANGED
@@ -1,3 +1,3 @@
1
1
  /* eslint-disable */
2
- export default {".je-float-right-linkholder":"float:right;margin-left:10px",".je-modal":"background-color:white;border:1px%20solid%20black;box-shadow:3px%203px%20black;position:absolute;z-index:10",".je-infobutton-icon":"font-size:16px;font-weight:bold;padding:0.25rem;position:relative;display:inline-block",".je-infobutton-tooltip":"font-size:12px;font-weight:normal;font-family:sans-serif;visibility:hidden;background-color:rgba(50%2C%2050%2C%2050%2C%200.75);margin:0%200.25rem;color:%23fafafa;padding:0.5rem%201rem;border-radius:0.25rem;width:20rem;position:absolute",".je-not-loaded":"pointer-events:none",".je-header":"display:inline-block",".je-upload-preview img":"float:left;margin:0%200.5rem%200.5rem%200;max-width:100%25;max-height:5rem",".je-checkbox":"display:inline-block;width:auto",".je-checkbox-control--compact":"display:inline-block;margin-right:1rem",".je-radio":"display:inline-block;width:auto",".je-radio-control--compact":"display:inline-block;margin-right:1rem",".je-switcher":"background-color:transparent;display:inline-block;font-style:italic;font-weight:normal;height:auto;width:auto;margin-bottom:0;margin-left:5px;padding:0%200%200%203px",".je-textarea":"width:100%25;height:300px;box-sizing:border-box",".je-range-control":"text-align:center",".je-indented-panel":"padding-left:10px;margin-left:10px;border-left:1px%20solid%20%23ccc",".je-indented-panel--top":"padding-left:10px;margin-left:10px",".je-tabholder":"float:left;width:130px",".je-tabholder .content":"margin-left:120px",".je-tabholder--top":"margin-left:10px",".je-tabholder--clear":"clear:both",".je-tab":"border:1px%20solid%20%23ccc;border-width:1px%200%201px%201px;text-align:center;line-height:30px;border-radius:5px;border-bottom-right-radius:0;border-top-right-radius:0;font-weight:bold;cursor:pointer",".je-tab--top":"float:left;border:1px%20solid%20%23ccc;border-width:1px%201px%200px%201px;text-align:center;line-height:30px;border-radius:5px;padding-left:5px;padding-right:5px;border-bottom-right-radius:0;border-bottom-left-radius:0;font-weight:bold;cursor:pointer",".je-block-link":"display:block",".je-media":"width:100%25"}
2
+ export default {".table-responsive .autocomplete-result-list":"position:relative%20!important",".je-float-right-linkholder":"float:right;margin-left:10px",".je-modal":"background-color:white;border:1px%20solid%20black;box-shadow:3px%203px%20black;position:absolute;z-index:10",".je-infobutton-icon":"font-size:16px;font-weight:bold;padding:0.25rem;position:relative;display:inline-block",".je-infobutton-tooltip":"font-size:12px;font-weight:normal;font-family:sans-serif;visibility:hidden;background-color:rgba(50%2C%2050%2C%2050%2C%200.75);margin:0%200.25rem;color:%23fafafa;padding:0.5rem%201rem;border-radius:0.25rem;width:20rem;position:absolute",".je-not-loaded":"pointer-events:none",".je-header":"display:inline-block",".je-upload-preview img":"float:left;margin:0%200.5rem%200.5rem%200;max-width:100%25;max-height:5rem",".je-checkbox":"display:inline-block;width:auto",".je-checkbox-control--compact":"display:inline-block;margin-right:1rem",".je-radio":"display:inline-block;width:auto",".je-radio-control--compact":"display:inline-block;margin-right:1rem",".je-switcher":"background-color:transparent;display:inline-block;font-style:italic;font-weight:normal;height:auto;width:auto;margin-bottom:0;margin-left:5px;padding:0%200%200%203px",".je-textarea":"width:100%25;height:300px;box-sizing:border-box",".je-range-control":"text-align:center",".je-indented-panel":"padding-left:10px;margin-left:10px;border-left:1px%20solid%20%23ccc",".je-indented-panel--top":"padding-left:10px;margin-left:10px",".je-tabholder":"float:left;width:130px",".je-tabholder .content":"margin-left:120px",".je-tabholder--top":"margin-left:10px",".je-tabholder--clear":"clear:both",".je-tab":"border:1px%20solid%20%23ccc;border-width:1px%200%201px%201px;text-align:center;line-height:30px;border-radius:5px;border-bottom-right-radius:0;border-top-right-radius:0;font-weight:bold;cursor:pointer",".je-tab--top":"float:left;border:1px%20solid%20%23ccc;border-width:1px%201px%200px%201px;text-align:center;line-height:30px;border-radius:5px;padding-left:5px;padding-right:5px;border-bottom-right-radius:0;border-bottom-left-radius:0;font-weight:bold;cursor:pointer",".je-block-link":"display:block",".je-media":"width:100%25"}
3
3
  /* eslint-enable */
@@ -34,7 +34,7 @@ export const defaultTemplate = () => ({
34
34
  r: func
35
35
  })
36
36
  }
37
- for (var i = 0; i < l; i++) {
37
+ for (let i = 0; i < l; i++) {
38
38
  getReplacement(i)
39
39
  }
40
40
 
@@ -42,7 +42,7 @@ export const defaultTemplate = () => ({
42
42
  return (vars) => {
43
43
  let ret = `${template}`
44
44
  let r
45
- for (i = 0; i < l; i++) {
45
+ for (let i = 0; i < l; i++) {
46
46
  r = replacements[i]
47
47
  ret = ret.replace(r.s, r.r(vars))
48
48
  }
package/src/theme.js CHANGED
@@ -202,9 +202,9 @@ export class AbstractTheme {
202
202
  return el
203
203
  }
204
204
 
205
- getSelectInput (options, multiple) {
205
+ getSelectInput (options, multiple, hasPlaceholderOption = false) {
206
206
  const select = document.createElement('select')
207
- if (options) this.setSelectOptions(select, options)
207
+ if (options) this.setSelectOptions(select, options, [], hasPlaceholderOption)
208
208
  return select
209
209
  }
210
210
 
@@ -222,8 +222,18 @@ export class AbstractTheme {
222
222
  this.setSelectOptions(switcher, options, titles)
223
223
  }
224
224
 
225
- setSelectOptions (select, options, titles = []) {
225
+ setSelectOptions (select, options, titles = [], hasPlaceholderOption = false, placeholderOptionText = ' ') {
226
226
  select.innerHTML = ''
227
+
228
+ if (hasPlaceholderOption) {
229
+ const option = document.createElement('option')
230
+ option.setAttribute('value', '_placeholder_')
231
+ option.textContent = placeholderOptionText
232
+ option.setAttribute('disabled', '')
233
+ option.setAttribute('hidden', '')
234
+ select.appendChild(option)
235
+ }
236
+
227
237
  for (let i = 0; i < options.length; i++) {
228
238
  const option = document.createElement('option')
229
239
  option.setAttribute('value', options[i])
@@ -22,11 +22,6 @@ export class bootstrap3Theme extends AbstractTheme {
22
22
  if (this.closest(input, '.compact')) {
23
23
  input.controlgroup.style.marginBottom = 0
24
24
  }
25
- if (this.queuedInputErrorText) {
26
- const text = this.queuedInputErrorText
27
- delete this.queuedInputErrorText
28
- this.addInputError(input, text)
29
- }
30
25
 
31
26
  /* TODO: use bootstrap slider */
32
27
  }
@@ -197,7 +192,6 @@ export class bootstrap3Theme extends AbstractTheme {
197
192
 
198
193
  addInputError (input, text) {
199
194
  if (!input.controlgroup) {
200
- this.queuedInputErrorText = text
201
195
  return
202
196
  }
203
197
  input.controlgroup.classList.add('has-error')
@@ -214,9 +208,6 @@ export class bootstrap3Theme extends AbstractTheme {
214
208
  }
215
209
 
216
210
  removeInputError (input) {
217
- if (!input.controlgroup) {
218
- delete this.queuedInputErrorText
219
- }
220
211
  if (!input.errmsg) return
221
212
  input.errmsg.style.display = 'none'
222
213
  input.controlgroup.classList.remove('has-error')
@@ -1,4 +1,3 @@
1
-
2
1
  import { htmlTheme } from './html.js'
3
2
  // import { bootstrap2Theme } from './bootstrap2'
4
3
  import { bootstrap3Theme } from './bootstrap3.js'
package/src/validator.js CHANGED
@@ -32,7 +32,7 @@ export class Validator {
32
32
  if (invalid) {
33
33
  errors.push({
34
34
  message: 'Must have the required properties: ' + missingProperties.join(', '),
35
- path: path
35
+ path
36
36
  })
37
37
  }
38
38
  }
@@ -72,14 +72,14 @@ export class Validator {
72
72
  if (minContainsInvalid) {
73
73
  errors.push({
74
74
  message: this.translate('error_minContains', [counter, schema.minContains], schema),
75
- path: path
75
+ path
76
76
  })
77
77
  }
78
78
  } else {
79
79
  if (containsInvalid) {
80
80
  errors.push({
81
81
  message: this.translate('error_contains', null, schema),
82
- path: path
82
+ path
83
83
  })
84
84
  }
85
85
  }
@@ -90,7 +90,7 @@ export class Validator {
90
90
  if (maxContainsInvalid) {
91
91
  errors.push({
92
92
  message: this.translate('error_maxContains', [counter, schema.maxContains], schema),
93
- path: path
93
+ path
94
94
  })
95
95
  }
96
96
  }
package/tests/Dockerfile CHANGED
@@ -1,3 +1,3 @@
1
- FROM node:12
1
+ FROM node:18
2
2
 
3
3
  ENV PATH=/repo/node_modules/.bin:$PATH
@@ -5,6 +5,12 @@ const { DEFAULT_WAIT_TIME } = require('./test-config')
5
5
 
6
6
  Feature('core')
7
7
 
8
+ Scenario('should enforce const @enforce_const', async ({ I }) => {
9
+ I.amOnPage('enforce-const.html')
10
+ I.waitForElement('.je-ready')
11
+ I.waitForValue('#value', '{"string":"Alice","integer":5,"number":5.5,"string-enum":"Bob","boolean":true,"boolean-checkbox":true,"boolean-choices":true,"object":{"name":"Alice"},"array":[{"name":"Alice"},{"name":"Bob"}],"array-table":[{"name":"Alice"},{"name":"Bob"}],"array-tabs":[{"name":"Alice"},{"name":"Bob"}],"array-of-strings":["Alice","Bob"],"array-enum":["Carl","Dennis"],"object-enum":{"name":"Bob"}}')
12
+ })
13
+
8
14
  Scenario('should hide titles @titleHidden', async ({ I }) => {
9
15
  I.amOnPage('title-hidden.html')
10
16
  I.waitForElement('.je-ready')
@@ -155,7 +161,7 @@ Scenario('should watch form for changes @core @change', async ({ I }) => {
155
161
 
156
162
  Scenario('should change the form if form_name_root option is set @core', async ({ I }) => {
157
163
  I.amOnPage('form-name.html')
158
- I.see('Property must be set.', '.invalid-feedback')
164
+ I.see('Value must be one of the enumerated values', '.invalid-feedback')
159
165
  I.seeElement('[data-schemapath="form_1"]')
160
166
  I.seeElement('[data-schemapath="form_2"]')
161
167
  I.seeElement('[name="form_1"]')
@@ -174,7 +180,7 @@ Scenario('should change the form if form_name_root option is set @core', async (
174
180
  I.seeElement('[for="form_2[2]"]')
175
181
  I.click('[for="form_1[0]"]')
176
182
  I.click('[for="form_2[1]"]')
177
- I.dontSee('Property must be set.', '.invalid-feedback')
183
+ I.dontSee('Value must be one of the enumerated values', '.invalid-feedback')
178
184
  I.click('#get-value-form-1')
179
185
  I.waitForValue('#value-form-1', '"yes"')
180
186
  I.click('#get-value-form-2')
@@ -177,33 +177,38 @@ Scenario('should array editor events @array-events', async ({ I }) => {
177
177
  I.waitForValue('.debug', '["A","B"]')
178
178
 
179
179
  I.click('.json-editor-btn-moveup')
180
- I.waitForValue('.action', 'moveRow')
180
+ I.waitForValue('#action1', 'moveRow')
181
181
  I.click('.get-value')
182
182
  I.waitForValue('.debug', '["B","A"]')
183
183
 
184
184
  I.click('.json-editor-btn-movedown')
185
- I.waitForValue('.action', 'moveRow')
185
+ I.waitForValue('#action1', 'moveRow')
186
186
  I.click('.get-value')
187
187
  I.waitForValue('.debug', '["A","B"]')
188
188
 
189
189
  I.click('.json-editor-btntype-add')
190
- I.waitForValue('.action', 'addRow')
190
+ I.waitForValue('#action1', 'addRow')
191
191
  I.click('.get-value')
192
192
  I.waitForValue('.debug', '["A","B",""]')
193
193
 
194
+ I.click('.json-editor-btntype-copy')
195
+ I.waitForValue('#action2', 'copyRow')
196
+ I.click('.get-value')
197
+ I.waitForValue('.debug', '["A","B","","A"]')
198
+
194
199
  I.amAcceptingPopups()
195
200
  I.click('.json-editor-btntype-deletelast')
196
201
  I.seeInPopup('Are you sure you want to remove this item?')
197
202
  I.acceptPopup()
198
- I.waitForValue('.action', 'deleteRow')
203
+ I.waitForValue('#action1', 'deleteRow')
199
204
  I.click('.get-value')
200
- I.waitForValue('.debug', '["A","B"]')
205
+ I.waitForValue('.debug', '["A","B",""]')
201
206
 
202
207
  I.amAcceptingPopups()
203
208
  I.click('.json-editor-btntype-deleteall')
204
209
  I.seeInPopup('Are you sure you want to remove this item?')
205
210
  I.acceptPopup()
206
- I.waitForValue('.action', 'deleteAllRows')
211
+ I.waitForValue('#action1', 'deleteAllRows')
207
212
  I.click('.get-value')
208
213
  I.waitForValue('.debug', '[]')
209
214
  })
@@ -11,6 +11,5 @@ Scenario('autocomplete should work @autocomplete', async ({ I }) => {
11
11
  I.waitForText('iran', 20, '.autocomplete-result-list')
12
12
  I.waitForText('iraq', 20, '.autocomplete-result-list')
13
13
  I.click('iraq', '.autocomplete-result:nth-child(2)')
14
- I.wait(1)
15
14
  I.waitForValue('.value', '"iraq"')
16
15
  })
@@ -71,13 +71,9 @@ Scenario('should be readonly if specified and not disabled @readOnly', async ({
71
71
 
72
72
  Scenario('should update output when (method) setValue is called', async ({ I }) => {
73
73
  I.amOnPage('integer.html')
74
- I.saveScreenshot('integer-setvalue-1.png')
75
74
  I.waitForText('5', DEFAULT_WAIT_TIME, '[data-schemapath="root.integer_range"] output')
76
- I.saveScreenshot('integer-setvalue-2.png')
77
75
  I.click('.set-value')
78
- I.saveScreenshot('integer-setvalue-3.png')
79
76
  I.waitForText('2', DEFAULT_WAIT_TIME, '[data-schemapath="root.integer_range"] output')
80
- I.saveScreenshot('integer-setvalue-4.png')
81
77
  })
82
78
 
83
79
  Scenario('should validate value', async ({ I }) => {
@@ -327,3 +327,11 @@ Scenario('should open and close the properties modal', ({ I }) => {
327
327
  I.click('textarea')
328
328
  I.dontSeeElement('.je-modal .property-selector')
329
329
  })
330
+
331
+ Scenario('should remove false properties @remove_false_properties', ({ I }) => {
332
+ I.amOnPage('remove-false-properties.html')
333
+ I.waitForElement('.je-ready')
334
+ I.waitForValue('#value', '{}')
335
+ I.click('[for="root[a]"]')
336
+ I.waitForValue('#value', '{"a":true}')
337
+ })
@@ -1,6 +1,6 @@
1
1
  /* global Feature Scenario */
2
2
 
3
- Feature('rating')
3
+ Feature('readonly')
4
4
 
5
5
  Scenario('should be disabled if "readonly" is specified @readOnly', async ({ I }) => {
6
6
  I.amOnPage('read-only.html')
@@ -2,6 +2,24 @@
2
2
 
3
3
  Feature('select')
4
4
 
5
+ Scenario('Should render a non selectable placeholder options for not in enum values @placeholderOption', async ({ I }) => {
6
+ I.amOnPage('placeholder-options.html')
7
+ I.waitForElement('.je-ready')
8
+ I.waitForElement('option[value="_placeholder_"][disabled][hidden]')
9
+ I.waitForElement('option[value="a"]')
10
+ I.waitForElement('option[value="b"]')
11
+ I.click('#set-value')
12
+ I.waitForText('-select-')
13
+ I.waitForText('Value must be one of the enumerated values')
14
+ I.waitForValue('#value', '"other"')
15
+ I.selectOption('[name="root"]', 'a')
16
+ I.waitForValue('#value', '"a"')
17
+ I.dontSee('Value must be one of the enumerated values')
18
+ I.selectOption('[name="root"]', 'b')
19
+ I.waitForValue('#value', '"b"')
20
+ I.dontSee('Value must be one of the enumerated values')
21
+ })
22
+
5
23
  Scenario('should return correct booleans values when selected @readOnly', async ({ I }) => {
6
24
  I.amOnPage('select.html')
7
25
  I.click('.get-value')
@@ -0,0 +1,15 @@
1
+ /* global Feature Scenario */
2
+
3
+ Feature('starrating')
4
+
5
+ Scenario('should set and get values properly @starrating', async ({ I }) => {
6
+ I.amOnPage('starrating.html')
7
+ I.waitForElement('.je-ready')
8
+ I.waitForValue('#value', '{"integer_rating":0,"string_rating":"","starrating":"Beginner","starrating2":"Beginner","starrating3":"5 Stars"}')
9
+ I.click('[for="root[integer_rating]3"]')
10
+ I.click('[for="root[string_rating]3"]')
11
+ I.click('[for="root[starrating]3"]')
12
+ I.click('[for="root[starrating2]3"]')
13
+ I.click('[for="root[starrating3]10"]')
14
+ I.waitForValue('#value', '{"integer_rating":3,"string_rating":"3","starrating":"Experienced","starrating2":"Experienced","starrating3":"10 Stars"}')
15
+ })
@@ -116,3 +116,10 @@ Scenario('should work with cleave.js library', async ({ I }) => {
116
116
  I.click('.get-value')
117
117
  I.waitForValue('.debug', JSON.stringify({ cleave_test: '1234.567.890-1234' }))
118
118
  })
119
+
120
+ Scenario('ace editor should have correct initial @prompt-paste-max-length-reached', async ({ I }) => {
121
+ I.amOnPage('prompt-paste-max-length-reached.html')
122
+ I.waitForElement('.je-ready')
123
+ I.click('#paste')
124
+ I.seeInPopup('Pasted text exceeded maximum length of 5 and will be clipped.')
125
+ })
@@ -2,7 +2,7 @@
2
2
 
3
3
  Feature('issues')
4
4
 
5
- Scenario('GitHub issue 1158 should remain fixed @issue-1158 @optional', async ({ I }) => {
5
+ Scenario('GitHub issue 1158 should remain fixed @issue-1158', async ({ I }) => {
6
6
  I.amOnPage('issues/issue-gh-1158.html')
7
7
  I.seeElement('[name="root[name]"]')
8
8
  })
@@ -5,6 +5,5 @@ Feature('GitHub issue 1164')
5
5
  Scenario('GitHub issue 1164 should remain fixed @issue-1164', ({ I }) => {
6
6
  I.amOnPage('issues/issue-gh-1164.html')
7
7
  I.waitForElement('.je-ready')
8
- I.waitForInvisible('option[value="undefined"]')
9
8
  I.waitForValue('#value', '{"arrayEnumSelect":["one"],"stringEnumRadio":"one","numberEnumRadio":1.1,"integerEnumRadio":1}')
10
9
  })
@@ -0,0 +1,11 @@
1
+ /* global Feature Scenario */
2
+
3
+ Feature('issues')
4
+
5
+ Scenario('GitHub issue 1171 should remain fixed @issue-1171', async ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-1171.html')
7
+ I.waitForElement('.je-ready')
8
+ I.dontSeeCheckedAttribute('[id="root[1]"]')
9
+ I.checkOption('[id="root[1]"]')
10
+ I.dontSeeCheckedAttribute('[id="root[0]"]')
11
+ })
@@ -0,0 +1,21 @@
1
+ /* global Feature Scenario */
2
+
3
+ Feature('issues')
4
+
5
+ Scenario('GitHub issue 1272 should remain fixed @issue-1272', async ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-1272.html')
7
+ I.waitForElement('.je-ready')
8
+ I.selectOption('[name="root[recorder][albums]"]', 'album2')
9
+ I.waitForText('song1')
10
+ I.dontSee('array editor')
11
+ I.selectOption('[data-schemapath="root.recorder.album2"] .je-switcher', 'SideB')
12
+ I.waitForText('array editor')
13
+ I.dontSee('song1')
14
+ I.selectOption('[data-schemapath="root.recorder.album2"] .je-switcher', 'SideA')
15
+ I.waitForText('song1')
16
+ I.dontSee('array editor')
17
+ I.selectOption('[name="root[recorder][albums]"]', 'album1')
18
+ I.selectOption('[name="root[recorder][albums]"]', 'album2')
19
+ I.waitForText('song1')
20
+ I.dontSee('array editor')
21
+ })
@@ -2,7 +2,7 @@
2
2
 
3
3
  Feature('issues')
4
4
 
5
- Scenario('GitHub issue 1383 should remain fixed @issue-1383 @optional', async ({ I }) => {
5
+ Scenario('GitHub issue 1383 should remain fixed @issue-1383', async ({ I }) => {
6
6
  I.amOnPage('issues/issue-gh-1383.html')
7
7
  I.waitForElement('.je-ready')
8
8
  I.waitForText('activity-timeout')
@@ -0,0 +1,10 @@
1
+ /* global Feature Scenario */
2
+
3
+ Feature('issues')
4
+
5
+ Scenario('GitHub issue 1452 should remain fixed @issue-1452', async ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-1452.html')
7
+ I.click('#set-value')
8
+ I.selectOption('[id="root[category]"]', 'Vegetables')
9
+ I.waitForElement('[id="root[subcategory2]"]')
10
+ })
@@ -0,0 +1,13 @@
1
+ /* global Feature Scenario */
2
+
3
+ Feature('issues')
4
+
5
+ Scenario('GitHub issue 1485 should remain fixed @issue-1485', async ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-1485.html')
7
+ I.waitForElement('.je-ready')
8
+ I.fillField('[name="root[first_name]"]', 'John')
9
+ I.pressKey('Tab')
10
+ I.fillField('[name="root[last_name]"]', 'Doe')
11
+ I.pressKey('Tab')
12
+ I.waitForValue('[name="root[full_name]"]', 'John Doe')
13
+ })
@@ -0,0 +1,9 @@
1
+ /* global Feature Scenario */
2
+
3
+ Feature('issues')
4
+
5
+ Scenario('GitHub issue 1491 should remain fixed @issue-1491', async ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-1491.html')
7
+ I.waitForElement('.je-ready')
8
+ I.dontSee('Value required')
9
+ })
@@ -0,0 +1,9 @@
1
+ /* /* global Feature Scenario */
2
+
3
+ Feature('issues')
4
+
5
+ Scenario('GitHub issue 1525 should remain fixed @issue-1525', async ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-1525.html')
7
+ I.waitForElement('.je-ready')
8
+ I.waitForValue('#value', '{"example":"dd"}')
9
+ })
@@ -0,0 +1,12 @@
1
+ /* global Feature Scenario */
2
+
3
+ Feature('issues')
4
+
5
+ Scenario('GitHub issue 1536 should remain fixed @issue-1536', async ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-1536.html')
7
+ I.waitForElement('.je-ready')
8
+ I.checkOption('[name="root[dependency_chain_head]')
9
+ I.waitForText('dependent_field_one')
10
+ I.checkOption('[name="root[dependent_field_one]')
11
+ I.waitForText('dependent_field_two')
12
+ })
@@ -0,0 +1,10 @@
1
+ /* global Feature Scenario */
2
+
3
+ Feature('issues')
4
+
5
+ Scenario('GitHub issue 1538 should remain fixed @issue-1538', async ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-1538.html')
7
+ I.waitForElement('.je-ready')
8
+ I.checkOption('[name="root[watched_field]')
9
+ I.waitForText('dependent_field')
10
+ })
@@ -0,0 +1,8 @@
1
+ /* /* global Feature Scenario */
2
+
3
+ Feature('issues')
4
+
5
+ Scenario('GitHub issue 1541 should remain fixed @issue-1541 ', async ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-1541.html')
7
+ I.waitForElement('.je-ready')
8
+ })
@@ -1,4 +1,3 @@
1
- version: '3'
2
1
  services:
3
2
  chrome:
4
- image: seleniarm/standalone-chromium:114.0
3
+ image: seleniarm/standalone-chromium:114.0
@@ -1,4 +1,3 @@
1
- version: '3'
2
1
  services:
3
2
  node:
4
3
  build: .
@@ -1,9 +1,9 @@
1
1
  <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
- <title>array events table</title>
5
- <meta charset="utf-8"/>
6
- <script src="../../dist/jsoneditor.js"></script>
4
+ <title>array events table</title>
5
+ <meta charset="utf-8"/>
6
+ <script src="../../dist/jsoneditor.js"></script>
7
7
  </head>
8
8
  <body>
9
9
 
@@ -14,9 +14,9 @@
14
14
  <div class='container'></div>
15
15
 
16
16
  <script>
17
- var container = document.querySelector('.container');
18
- var debug = document.querySelector('.debug');
19
- var schema = {
17
+ const container = document.querySelector('.container');
18
+ const debug = document.querySelector('.debug');
19
+ const schema = {
20
20
  "type": "array",
21
21
  "title": "Strings",
22
22
  "format": "table",
@@ -25,37 +25,45 @@
25
25
  "title": "String"
26
26
  }
27
27
  };
28
- var editor = new JSONEditor(container, {
28
+
29
+ const editor = new JSONEditor(container, {
29
30
  schema: schema,
30
31
  enable_array_copy: true
31
32
  });
33
+
32
34
  editor.promise.then(() => {
33
35
  document.querySelector('.get-value').addEventListener('click', function () {
34
- debug.value = JSON.stringify(editor.getValue());
35
- });
36
- editor.setValue(["A","B","C","D","E"]);
37
- editor.on('copyRow', function () {
38
- alert('copyRow');
39
- console.log('copyRow');
40
- });
41
- editor.on('moveRow', function () {
42
- alert('moveRow');
43
- console.log('moveRow');
44
- });
45
- editor.on('addRow', function () {
46
- alert('addRow');
47
- console.log('addRow');
48
- });
49
- editor.on('deleteRow', function () {
50
- alert('deleteRow');
51
- console.log('deleteRow');
52
- });
53
- editor.on('deleteAllRows', function () {
54
- alert('deleteAllRows');
55
- console.log('deleteAllRows');
56
- });
36
+ debug.value = JSON.stringify(editor.getValue());
37
+ });
38
+
39
+ editor.setValue(["A", "B", "C", "D", "E"]);
40
+
41
+ editor.on('copyRow', function () {
42
+ alert('copyRow');
43
+ console.log('copyRow');
44
+ });
45
+
46
+ editor.on('moveRow', function () {
47
+ alert('moveRow');
48
+ console.log('moveRow');
49
+ });
50
+
51
+ editor.on('addRow', function () {
52
+ alert('addRow');
53
+ console.log('addRow');
54
+ });
55
+
56
+ editor.on('deleteRow', function () {
57
+ alert('deleteRow');
58
+ console.log('deleteRow');
59
+ });
60
+
61
+ editor.on('deleteAllRows', function () {
62
+ alert('deleteAllRows');
63
+ console.log('deleteAllRows');
64
+ });
57
65
  })
58
-
66
+
59
67
  </script>
60
68
 
61
69
  </body>