glib-web 4.1.0 → 4.1.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 (96) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +1 -0
  3. package/action.js +1 -1
  4. package/actions/auth/restart.js +0 -0
  5. package/actions/commands/copy.js +0 -0
  6. package/actions/components/replace.js +1 -1
  7. package/actions/components/set.js +4 -4
  8. package/actions/dialogs/close.js +0 -0
  9. package/actions/dialogs/notification.js +0 -0
  10. package/actions/dialogs/oauth.js +0 -0
  11. package/actions/dialogs/open.js +1 -1
  12. package/actions/dialogs/reload.js +0 -0
  13. package/actions/dialogs/show.js +1 -1
  14. package/actions/http/delete.js +0 -0
  15. package/actions/http/patch.js +0 -0
  16. package/actions/http/post.js +0 -0
  17. package/actions/http/put.js +0 -0
  18. package/actions/runMultiple.js +0 -0
  19. package/actions/sheets/select.js +0 -0
  20. package/actions/snackbars/select.js +0 -0
  21. package/actions/windows/openWeb.js +0 -0
  22. package/actions/windows/print.js +0 -0
  23. package/components/_message.vue +0 -0
  24. package/components/fields/_select.vue +1 -1
  25. package/components/fields/chipGroup.vue +0 -1
  26. package/components/fields/phone/countries.js +0 -0
  27. package/components/fields/phone/sprite.css +0 -0
  28. package/components/fields/radio.vue +110 -3
  29. package/components/h1.vue +0 -0
  30. package/components/h2.vue +0 -0
  31. package/components/h3.vue +0 -0
  32. package/components/h5.vue +0 -0
  33. package/components/h6.vue +0 -0
  34. package/components/hr.vue +0 -0
  35. package/components/html.vue +0 -0
  36. package/components/icon.vue +0 -0
  37. package/components/mixins/extension.js +0 -0
  38. package/components/mixins/longClick.js +0 -0
  39. package/components/mixins/scrolling.js +0 -0
  40. package/components/mixins/styles.js +7 -5
  41. package/components/mixins/table/export.js +0 -0
  42. package/components/mixins/table/import.js +0 -0
  43. package/components/mixins/text.js +0 -0
  44. package/components/multimedia/video.vue +0 -0
  45. package/cypress/e2e/glib-web/test_page.cy.ts +53 -0
  46. package/keys.js +0 -0
  47. package/nav/dialog.vue +7 -8
  48. package/package.json +1 -1
  49. package/static/plugins/alignment/alignment.js +0 -0
  50. package/static/plugins/alignment/alignment.min.js +0 -0
  51. package/static/plugins/beyondgrammar/beyondgrammar.js +0 -0
  52. package/static/plugins/beyondgrammar/beyondgrammar.min.js +0 -0
  53. package/static/plugins/blockcode/blockcode.js +0 -0
  54. package/static/plugins/blockcode/blockcode.min.js +0 -0
  55. package/static/plugins/clips/clips.js +0 -0
  56. package/static/plugins/clips/clips.min.js +0 -0
  57. package/static/plugins/counter/counter.js +0 -0
  58. package/static/plugins/counter/counter.min.js +0 -0
  59. package/static/plugins/definedlinks/definedlinks.js +0 -0
  60. package/static/plugins/definedlinks/definedlinks.min.js +0 -0
  61. package/static/plugins/handle/handle.js +0 -0
  62. package/static/plugins/handle/handle.min.js +0 -0
  63. package/static/plugins/icons/icons.js +0 -0
  64. package/static/plugins/icons/icons.min.js +0 -0
  65. package/static/plugins/imageposition/imageposition.js +0 -0
  66. package/static/plugins/imageposition/imageposition.min.js +0 -0
  67. package/static/plugins/inlineformat/inlineformat.js +0 -0
  68. package/static/plugins/inlineformat/inlineformat.min.js +0 -0
  69. package/static/plugins/removeformat/removeformat.js +0 -0
  70. package/static/plugins/removeformat/removeformat.min.js +0 -0
  71. package/static/plugins/selector/selector.js +0 -0
  72. package/static/plugins/selector/selector.min.js +0 -0
  73. package/static/plugins/specialchars/specialchars.js +0 -0
  74. package/static/plugins/specialchars/specialchars.min.js +0 -0
  75. package/static/plugins/textdirection/textdirection.js +0 -0
  76. package/static/plugins/textdirection/textdirection.min.js +0 -0
  77. package/static/plugins/textexpander/textexpander.js +0 -0
  78. package/static/plugins/textexpander/textexpander.min.js +0 -0
  79. package/static/plugins/underline/underline.js +0 -0
  80. package/static/plugins/underline/underline.min.js +0 -0
  81. package/static/redactorx.css +0 -0
  82. package/static/redactorx.min.css +0 -0
  83. package/static/redactorx.min.js +0 -0
  84. package/static/redactorx.usm.min.js +0 -0
  85. package/store.js +15 -5
  86. package/styles/test.sass +0 -0
  87. package/styles/test.scss +0 -0
  88. package/templates/unsupported.vue +0 -0
  89. package/utils/dom.js +0 -0
  90. package/utils/helper.js +0 -0
  91. package/utils/http.js +1 -1
  92. package/utils/launch.js +3 -3
  93. package/utils/type.js +0 -0
  94. package/cypress/e2e/glib-web/components_set.cy.ts +0 -8
  95. package/cypress/e2e/glib-web/picker.cy.ts +0 -9
  96. package/cypress/e2e/glib-web/select.cy.ts +0 -57
package/LICENSE CHANGED
File without changes
package/README.md CHANGED
@@ -61,6 +61,7 @@ view.chipGroup styleClasses: ['custom']
61
61
  ## Prepare for publishing
62
62
 
63
63
  - Create a PR to the `master` branch
64
+ - Make sure test pass `yarn run test`
64
65
  - After approval, merge the PR.
65
66
 
66
67
  ## Publish package to npm
package/action.js CHANGED
@@ -228,7 +228,7 @@ export default class Action {
228
228
 
229
229
  if (response.header || response.body || response.footer) {
230
230
  Utils.http.forceComponentUpdate(() => {
231
- const dialog = dialogs.last();
231
+ const dialog = dialogs.value.last();
232
232
  const updateDialog = windowMode ? false : Utils.type.isObject(dialog);
233
233
  if (updateDialog) {
234
234
  dialog.updateContent(response);
File without changes
File without changes
@@ -5,7 +5,7 @@ export default class {
5
5
  execute(spec, component) {
6
6
  const target = GLib.component.findById(spec.targetId) || component;
7
7
  if (target) {
8
- Object.assign(target.spec, spec.newView);
8
+ target.action_merge(spec.newView);
9
9
  }
10
10
 
11
11
  Action.execute(spec.onReplace, target);
@@ -1,6 +1,6 @@
1
- const setFileModel = (component, value) => {
2
- component.fieldModel = component.$sanitizeValue(component.$externalizeValue(value));
3
- };
1
+ // const setFileModel = (component, value) => {
2
+ // component.fieldModel = component.$sanitizeValue(component.$externalizeValue(value));
3
+ // };
4
4
 
5
5
 
6
6
  export default class {
@@ -13,7 +13,7 @@ export default class {
13
13
 
14
14
  Utils.type.ifObject(spec.data, (data) => {
15
15
  targetComponent.action_merge(data);
16
- if (data.value) setFileModel(targetComponent, data.value);
16
+ // if (data.value) setFileModel(targetComponent, data.value);
17
17
  });
18
18
 
19
19
  GLib.action.execute(spec.onSet, targetComponent);
File without changes
File without changes
File without changes
@@ -2,7 +2,7 @@ import { dialogs } from "../../store";
2
2
 
3
3
  export default class {
4
4
  execute(spec, component) {
5
- const dialog = dialogs.last();
5
+ const dialog = dialogs.value.last();
6
6
  if (spec.updateExisting && dialog) {
7
7
  dialog.reload(spec);
8
8
 
File without changes
@@ -2,7 +2,7 @@ import { dialogs } from "../../store";
2
2
 
3
3
  export default class {
4
4
  execute(spec, component) {
5
- const dialog = dialogs.last();
5
+ const dialog = dialogs.value.last();
6
6
  if (spec.updateExisting && dialog) {
7
7
  dialog.updateContent(spec);
8
8
  return;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -49,7 +49,7 @@ export default {
49
49
  return {
50
50
  options: null,
51
51
  append: {},
52
- rules: [],
52
+ rules: this.$validation(),
53
53
  focused: false
54
54
  };
55
55
  },
@@ -13,7 +13,6 @@
13
13
  import { defineComponent } from "vue";
14
14
  import inputVariant from "../mixins/inputVariant";
15
15
  import { triggerOnInput } from "../composable/form";
16
- import { fieldModels } from "../composable/conditional";
17
16
 
18
17
  export default defineComponent({
19
18
  mixins: [inputVariant],
File without changes
File without changes
@@ -1,9 +1,20 @@
1
1
  <template>
2
2
  <div :class="$classes()" :style="$styles()">
3
- <v-radio :label="spec.label" :value="spec.value.presence() || vuetifyEmptyString" :readonly="spec.readOnly"
4
- :on-icon="spec.onIcon" :off-icon="spec.offIcon" @click="$onClick()" :color="gcolor" />
3
+ <v-radio :label="spec.label" :value="(spec.value || '').presence() || vuetifyEmptyString" :readonly="spec.readOnly"
4
+ :on-icon="spec.onIcon" :off-icon="spec.offIcon" @click="$onClick()" :color="gcolor"
5
+ :class="spec.imageUrl || spec.icon ? 'custom-radio' : ''">
6
+ <template v-slot:label v-if="spec.imageUrl || spec.icon">
7
+ <div class="custom-radio-content">
8
+ <img v-if="spec.imageUrl" :src="spec.imageUrl" alt="icon" class="custom-radio-icon" />
9
+ <v-icon v-if="spec.icon" class="aligner" :color="spec.iconColor" :size="spec.iconSize">
10
+ {{ spec.icon }}
11
+ </v-icon>
12
+ <div class="custom-radio-label">{{ spec.label }}</div>
13
+ </div>
14
+ </template>
15
+ </v-radio>
5
16
  <div v-if="spec.childViews" class="radio-childviews">
6
- <div v-for="(item, i) in spec.childViews" :key="i">
17
+ <div v-for="( item, i ) in spec.childViews " :key="i">
7
18
  <glib-component :spec="item" />
8
19
  </div>
9
20
  </div>
@@ -18,3 +29,99 @@ export default {
18
29
  }
19
30
  };
20
31
  </script>
32
+
33
+ <style scoped>
34
+ .custom-radio {
35
+ /* styles for custom-radio class */
36
+ display: flex;
37
+ align-items: center;
38
+ justify-content: center;
39
+ width: 240px;
40
+ height: 254px;
41
+ transition: border-color 0.3s, box-shadow 0.3s, color 0.3s;
42
+ text-align: center;
43
+ cursor: pointer;
44
+ padding: 16px;
45
+ position: relative;
46
+ border: 1px solid #E6E6E6;
47
+ border-radius: 24px;
48
+ }
49
+
50
+ .custom-radio:hover {
51
+ border: 2px solid;
52
+ border-radius: 24px;
53
+ border-color: #0A2A9E;
54
+ }
55
+
56
+ .custom-radio:hover .custom-radio-label {
57
+ font-size: 22px;
58
+ color: #0A2A9E;
59
+ }
60
+
61
+ .custom-radio .custom-radio-content {
62
+ display: flex;
63
+ flex-direction: column;
64
+ align-items: center;
65
+ justify-content: center;
66
+ width: 100%;
67
+ height: 100%;
68
+ margin-right: 30px;
69
+ }
70
+
71
+ .custom-radio .custom-radio-icon {
72
+ width: 80px;
73
+ height: 80px;
74
+ margin-bottom: 8px;
75
+ }
76
+
77
+ .custom-radio .custom-radio-label {
78
+ font-size: 22px;
79
+ color: inherit;
80
+ margin-top: 16px;
81
+ }
82
+
83
+ .custom-radio ::v-deep .v-selection-control__input {
84
+ width: 240px;
85
+ height: 254px;
86
+ background-color: transparent;
87
+ left: 50%;
88
+
89
+ >.v-icon {
90
+ opacity: 0;
91
+ }
92
+
93
+ }
94
+
95
+ .custom-radio ::v-deep .v-selection-control__input::before {
96
+ background-color: transparent
97
+ }
98
+
99
+ .custom-radio ::v-deep .v-ripple__container {
100
+ display: none;
101
+ }
102
+
103
+
104
+ .custom-radio .v-ripple__container {
105
+ display: none;
106
+ }
107
+
108
+ .radio--active .custom-radio {
109
+ border: 2px solid;
110
+ border-radius: 24px;
111
+ border-color: #0A2A9E;
112
+ }
113
+
114
+ .radio--active .custom-radio-label {
115
+ color: #0A2A9E;
116
+ font-weight: 700;
117
+ font-size: 22px;
118
+ }
119
+
120
+ .radio--active .v-icon {
121
+ color: #0A2A9E;
122
+ }
123
+
124
+ .radio-childviews {
125
+ margin-top: 16px;
126
+ }
127
+ </style>
package/components/h1.vue CHANGED
File without changes
package/components/h2.vue CHANGED
File without changes
package/components/h3.vue CHANGED
File without changes
package/components/h5.vue CHANGED
File without changes
package/components/h6.vue CHANGED
File without changes
package/components/hr.vue CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -266,11 +266,13 @@ export default {
266
266
  if (Utils.type.isNotNull(newSpec.displayed)) vm._show = newSpec.displayed;
267
267
  vm._submitWhenNotDisplayed = newSpec.submitWhenNotDisplayed;
268
268
 
269
- const els = vm.$el.querySelectorAll('input,textarea');
270
- if (!vm.submitWhenNotDisplayed) {
271
- els.forEach((el) => el.disabled = true);
272
- } else {
273
- els.forEach((el) => el.disabled = false);
269
+ if (vm.$el && vm.$el == typeof HTMLElement) {
270
+ const els = vm.$el.querySelectorAll('input,textarea');
271
+ if (!vm.submitWhenNotDisplayed) {
272
+ els.forEach((el) => el.disabled = true);
273
+ } else {
274
+ els.forEach((el) => el.disabled = false);
275
+ }
274
276
  }
275
277
 
276
278
  Object.assign(this.spec, newSpec);
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,53 @@
1
+ const TEST_PAGE = 'http://localhost:3000/glib/json_ui_garage?path=test_page%2Findex'
2
+
3
+ describe('reactivity', () => {
4
+ it('logics/set, components/set, components/replace', () => {
5
+ cy.visit(TEST_PAGE)
6
+
7
+ // submit button should be clickabl e
8
+ cy.contains('submit (if form valid)').should('not.have.class', 'v-btn--disabled')
9
+
10
+ cy.contains('components/set').click()
11
+ cy.contains('logics/set').click()
12
+ cy.contains('components/replace').click()
13
+
14
+ // submit button should be disabled
15
+ cy.contains('submit (if form valid)').should('have.class', 'v-btn--disabled')
16
+
17
+ cy.get('.fields-check input[type="checkbox"]').first().click()
18
+
19
+ // cy.contains('submit (if form valid)').should('have.class', 'v-btn--disabled')
20
+
21
+ cy.get('.fields-radio input[type="radio"]').first().click()
22
+
23
+ // cy.contains('submit (if form valid)').should('have.class', 'v-btn--disabled')
24
+
25
+ cy.get('.fields-chipGroup .v-chip').first().click()
26
+
27
+ // cy.contains('submit (if form valid)').should('not.have.class', 'v-btn--disabled')
28
+
29
+ cy.get('button').contains('submit').first().click()
30
+
31
+ const result = `Method: POST
32
+ Form Data:
33
+ {
34
+ "date": "2024-07-27",
35
+ "select": "option99",
36
+ "chip_group": "option99",
37
+ "text": "Doe John",
38
+ "textarea": "The quick brown fox jumps over the lazy dog"
39
+ }`
40
+
41
+ cy.get('.unformatted').should('contain.text', result)
42
+ })
43
+
44
+ it('dialog', () => {
45
+ cy.visit(TEST_PAGE)
46
+ cy.contains('Dialog updateExisting').click()
47
+ cy.get('.v-dialog h1').should('contain.text', 'Hello world')
48
+ cy.get('.v-dialog .v-icon').should('exist')
49
+ cy.get('.v-dialog').contains('change dialog content').click()
50
+ cy.get('.v-dialog h1').should('contain.text', 'Hello world (updated)')
51
+ cy.get('.v-dialog .v-icon').should('not.exist')
52
+ })
53
+ })
package/keys.js CHANGED
File without changes
package/nav/dialog.vue CHANGED
@@ -49,7 +49,7 @@ import { ref } from "vue";
49
49
  import { usePasteable } from "../components/composable/pasteable";
50
50
 
51
51
  export default {
52
- expose: ['isFormDirty', 'model'],
52
+ expose: ['isFormDirty', 'model', 'close'],
53
53
  setup(props) {
54
54
  const filePaster = ref(undefined);
55
55
  usePasteable(filePaster);
@@ -74,7 +74,6 @@ export default {
74
74
  model: null,
75
75
  url: null,
76
76
  urlLoaded: false,
77
- disableCloseButton: false,
78
77
  isMobile: false,
79
78
  formSpec: null,
80
79
  isFormDirty: false
@@ -101,10 +100,13 @@ export default {
101
100
  return `height: ${this.mainHeight}px;`;
102
101
  }
103
102
  return null;
103
+ },
104
+ disableCloseButton() {
105
+ return this.spec.disableCloseButton || Utils.type.isString(this.url);
104
106
  }
105
107
  },
106
108
  mounted() {
107
- dialogs.push(this);
109
+ dialogs.value.push(this);
108
110
  },
109
111
  created() {
110
112
  this.onResize();
@@ -135,7 +137,7 @@ export default {
135
137
  close() {
136
138
  if (!this.isDirty()) {
137
139
  this.filePaster = null;
138
- dialogs.remove(this);
140
+ dialogs.value.remove(this);
139
141
  this.model = false;
140
142
  }
141
143
  },
@@ -160,7 +162,6 @@ export default {
160
162
  show(reload) {
161
163
  const spec = this.spec;
162
164
  this.url ||= spec.url;
163
- this.disableCloseButton = this.spec.disableCloseButton || Utils.type.isString(this.url);
164
165
 
165
166
  if (Utils.type.isString(this.url)) {
166
167
  if (!this.urlLoaded) {
@@ -178,12 +179,10 @@ export default {
178
179
  this.urlLoaded = true;
179
180
  this.message = "";
180
181
  this.formSpec = response.fullPageForm;
181
- this.disableCloseButton = this.spec.disableCloseButton || false;
182
182
  this.updateContent(response);
183
183
  });
184
184
  },
185
185
  (error, response) => {
186
- this.disableCloseButton = false;
187
186
  Utils.launch.snackbar.error(error.toString(), this);
188
187
  }
189
188
  );
@@ -193,7 +192,6 @@ export default {
193
192
  // this.body = this.spec.body;
194
193
 
195
194
  this.message = this.spec.message;
196
- this.disableCloseButton = this.spec.disableCloseButton || false;
197
195
 
198
196
  this.updateContent(this.spec);
199
197
  }
@@ -205,6 +203,7 @@ export default {
205
203
  this.header = response.header;
206
204
  this.body = response.body;
207
205
  this.footer = response.footer;
206
+ this.spec.disableCloseButton = response.disableCloseButton;
208
207
 
209
208
  // Make sure action only executes after the content has finished populating.
210
209
  this.$nextTick(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glib-web",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/store.js CHANGED
@@ -1,4 +1,4 @@
1
- import { reactive } from 'vue';
1
+ import { reactive, ref } from 'vue';
2
2
  import { useDirtyState } from './components/composable/dirtyState';
3
3
  import Action from "./action";
4
4
 
@@ -26,11 +26,14 @@ export const vueApp = reactive({
26
26
 
27
27
  export const jsonView = reactive({ page: window.__page });
28
28
 
29
- export const dialogs = reactive([]);
29
+ export const dialogs = ref([]);
30
30
 
31
- export const closeAllDialog = () => dialogs.forEach((dialog) => dialog.model = false);
31
+ export const closeAllDialog = () => {
32
+ dialogs.value.forEach((dialog) => dialog.model = false);
33
+ dialogs.value = [];
34
+ };
32
35
 
33
- export const ctx = () => dialogs.slice(-1)[0] || vueApp;
36
+ export const ctx = () => dialogs.value.slice(-1)[0] || vueApp;
34
37
 
35
38
  export const glibevent = reactive({
36
39
  onbeforewindowsopen: null,
@@ -44,7 +47,14 @@ function glibEventHandler(e) {
44
47
  Action.execute(onUnload, {});
45
48
  }
46
49
 
47
- return !isDirty();
50
+ if (e) {
51
+ if (ctx().isFormDirty && !ctx().isFormSubmitted) {
52
+ e.preventDefault();
53
+ }
54
+ } else {
55
+ return !isDirty();
56
+ }
57
+
48
58
  }
49
59
  export const watchGlibEvent = () => {
50
60
  window.onbeforeunload = glibEventHandler;
package/styles/test.sass CHANGED
File without changes
package/styles/test.scss CHANGED
File without changes
File without changes
package/utils/dom.js CHANGED
File without changes
package/utils/helper.js CHANGED
File without changes
package/utils/http.js CHANGED
@@ -81,7 +81,7 @@ export default class {
81
81
  const htmlUrl = Utils.url.htmlUrl(properties["url"]);
82
82
 
83
83
  Utils.http.execute(properties, "GET", component, (data, response) => {
84
- const pushHistory = windowMode ? true : !Utils.type.isObject(dialogs.last());
84
+ const pushHistory = windowMode ? true : !Utils.type.isObject(dialogs.value.last());
85
85
  // TODO: Check if it is okay to remove this `if` statement so we always push even if it's the same URL.
86
86
  if (forcePushHistory || (htmlUrl !== currentUrl && pushHistory)) {
87
87
  const redirectUrl = Utils.url.htmlUrl(response.url);
package/utils/launch.js CHANGED
@@ -93,7 +93,7 @@ class LaunchDialog {
93
93
 
94
94
 
95
95
  static topDialog() {
96
- return dialogs.last();
96
+ return dialogs.value.last();
97
97
  }
98
98
 
99
99
  static open(properties, component) {
@@ -122,13 +122,13 @@ class LaunchDialog {
122
122
  }
123
123
 
124
124
  static reload(properties, component) {
125
- Utils.type.ifObject(dialogs.last(), dialog => {
125
+ Utils.type.ifObject(dialogs.value.last(), dialog => {
126
126
  dialog.reload(properties);
127
127
  });
128
128
  }
129
129
 
130
130
  static close(properties, component) {
131
- Utils.type.ifObject(dialogs.last(), dialog => {
131
+ Utils.type.ifObject(dialogs.value.last(), dialog => {
132
132
  dialog.close();
133
133
  });
134
134
 
package/utils/type.js CHANGED
File without changes
@@ -1,8 +0,0 @@
1
- describe('components set', () => {
2
- it('populate select options', () => {
3
- cy.visit('http://localhost:3000/glib/json_ui_garage?path=views%2Fcomponents_set')
4
- cy.get('.pages-body .v-btn').eq(0).click()
5
- cy.get('.fields-select').eq(0).click()
6
- cy.get('.v-overlay__content > .v-list').should('contain.text', 'Option1')
7
- })
8
- })
@@ -1,9 +0,0 @@
1
- describe('pick country and region', () => {
2
- it('autopopulate region', () => {
3
- cy.visit('http://localhost:3000/glib/json_ui_garage?path=forms%2Fpickers')
4
- cy.get('.fields-select').eq(0).click()
5
- cy.get('.v-overlay__content > .v-list').contains('Australia').click()
6
- cy.get('.fields-select').eq(1).click()
7
- cy.get('.v-overlay__content > .v-list').should('contain.text', 'ACT')
8
- })
9
- })
@@ -1,57 +0,0 @@
1
- describe('input select', () => {
2
- it('produce value', () => {
3
- const result = `Method: POST
4
- Form Data:
5
- {
6
- "city": "canberra",
7
- "cities": [
8
- "melbourne",
9
- "sydney"
10
- ],
11
- "language": "nl",
12
- "languages": [
13
- "ja",
14
- "de"
15
- ],
16
- "empty_default": "",
17
- "nil_default": "",
18
- "mixed_default": [
19
- "",
20
- "specified",
21
- ""
22
- ],
23
- "time_zone": "Asia/Jakarta"
24
- }`
25
-
26
- cy.visit('http://localhost:3000/glib/json_ui_garage?path=forms%2Fselects')
27
- cy.contains('Submit').click()
28
- cy.get('.unformatted').should('contain.text', result)
29
- })
30
-
31
- it('produce value (empty)', () => {
32
- const result = `Method: POST
33
- Form Data:
34
- {
35
- "city": "",
36
- "cities": [
37
- ""
38
- ],
39
- "language": "",
40
- "languages": [
41
- ""
42
- ],
43
- "empty_default": "",
44
- "nil_default": "",
45
- "mixed_default": [
46
- ""
47
- ],
48
- "time_zone": ""
49
- }`
50
-
51
- cy.visit('http://localhost:3000/glib/json_ui_garage?path=forms%2Fselects')
52
- cy.get('.v-field__clearable').click({ multiple: true })
53
- cy.contains('Submit').click()
54
-
55
- cy.get('.unformatted').should('contain.text', result)
56
- })
57
- })