@duetds/components 8.5.5 → 8.6.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 (212) hide show
  1. package/hydrate/index.js +289 -113
  2. package/lib/cjs/duet-alert.cjs.entry.js +1 -1
  3. package/lib/cjs/duet-banner.cjs.entry.js +1 -1
  4. package/lib/cjs/duet-callout.cjs.entry.js +1 -1
  5. package/lib/cjs/duet-chip.cjs.entry.js +9 -2
  6. package/lib/cjs/duet-choice_2.cjs.entry.js +1 -1
  7. package/lib/cjs/duet-collapsible.cjs.entry.js +1 -1
  8. package/lib/cjs/duet-combobox.cjs.entry.js +260 -127
  9. package/lib/cjs/duet-date-picker.cjs.entry.js +1 -1
  10. package/lib/cjs/duet-fieldset.cjs.entry.js +1 -1
  11. package/lib/cjs/duet-hero.cjs.entry.js +1 -1
  12. package/lib/cjs/duet-input_2.cjs.entry.js +39 -3
  13. package/lib/cjs/duet-modal.cjs.entry.js +1 -1
  14. package/lib/cjs/duet-multiselect.cjs.entry.js +1 -1
  15. package/lib/cjs/duet-number-input.cjs.entry.js +1 -1
  16. package/lib/cjs/duet-promo-card.cjs.entry.js +1 -1
  17. package/lib/cjs/duet-radio_2.cjs.entry.js +1 -1
  18. package/lib/cjs/duet-scrollable_3.cjs.entry.js +1 -1
  19. package/lib/cjs/duet-select.cjs.entry.js +1 -1
  20. package/lib/cjs/duet-slideout-panel.cjs.entry.js +1 -1
  21. package/lib/cjs/duet-slideout.cjs.entry.js +1 -1
  22. package/lib/cjs/duet-textarea.cjs.entry.js +1 -1
  23. package/lib/cjs/duet.cjs.js +1 -1
  24. package/lib/cjs/loader.cjs.js +1 -1
  25. package/lib/cjs/{slot-utils-f5073417.js → slot-utils-03a40c78.js} +3 -1
  26. package/lib/collection/components/duet-chip/duet-chip.css +7 -0
  27. package/lib/collection/components/duet-chip/duet-chip.js +29 -2
  28. package/lib/collection/components/duet-combobox/duet-combobox-select-single.js +2 -2
  29. package/lib/collection/components/duet-combobox/duet-combobox.css +10 -2
  30. package/lib/collection/components/duet-combobox/duet-combobox.e2e.js +81 -51
  31. package/lib/collection/components/duet-combobox/duet-combobox.js +321 -142
  32. package/lib/collection/components/duet-input/duet-input.css +29 -0
  33. package/lib/collection/components/duet-input/duet-input.js +159 -3
  34. package/lib/collection/utils/slot-utils.js +3 -1
  35. package/lib/dist-custom-elements/duet-action-button.js +1 -1
  36. package/lib/dist-custom-elements/duet-alert.js +1 -1
  37. package/lib/dist-custom-elements/duet-banner.js +1 -1
  38. package/lib/dist-custom-elements/duet-breadcrumb.js +1 -1
  39. package/lib/dist-custom-elements/duet-callout.js +1 -1
  40. package/lib/dist-custom-elements/duet-card.js +1 -1
  41. package/lib/dist-custom-elements/duet-chip.js +1 -273
  42. package/lib/dist-custom-elements/duet-choice-group.js +5 -5
  43. package/lib/dist-custom-elements/duet-choice.js +2 -2
  44. package/lib/dist-custom-elements/duet-collapsible.js +2 -2
  45. package/lib/dist-custom-elements/duet-combobox.js +326 -132
  46. package/lib/dist-custom-elements/duet-cookie-consent.js +1 -1
  47. package/lib/dist-custom-elements/duet-date-picker.js +6 -6
  48. package/lib/dist-custom-elements/duet-editable-table.js +2 -2
  49. package/lib/dist-custom-elements/duet-fieldset.js +1 -1
  50. package/lib/dist-custom-elements/duet-footer.js +1 -1
  51. package/lib/dist-custom-elements/duet-header.js +1 -1
  52. package/lib/dist-custom-elements/duet-hero.js +1 -1
  53. package/lib/dist-custom-elements/duet-input.js +1 -1
  54. package/lib/dist-custom-elements/duet-menu-bar-dropdown-link.js +1 -1
  55. package/lib/dist-custom-elements/duet-menu-bar-dropdown.js +1 -1
  56. package/lib/dist-custom-elements/duet-modal.js +2 -2
  57. package/lib/dist-custom-elements/duet-multiselect.js +5 -5
  58. package/lib/dist-custom-elements/duet-notification-drawer.js +1 -1
  59. package/lib/dist-custom-elements/duet-notification.js +1 -1
  60. package/lib/dist-custom-elements/duet-number-input.js +6 -6
  61. package/lib/dist-custom-elements/duet-pagination.js +6 -6
  62. package/lib/dist-custom-elements/duet-popup-menu.js +1 -1
  63. package/lib/dist-custom-elements/duet-promo-card.js +1 -1
  64. package/lib/dist-custom-elements/duet-radio-group.js +5 -5
  65. package/lib/dist-custom-elements/duet-range-slider.js +1 -1
  66. package/lib/dist-custom-elements/duet-range-stepper.js +2 -2
  67. package/lib/dist-custom-elements/duet-scrollable.js +1 -1
  68. package/lib/dist-custom-elements/duet-select.js +1 -1
  69. package/lib/dist-custom-elements/duet-show-more.js +1 -1
  70. package/lib/dist-custom-elements/duet-slideout-panel.js +1 -1
  71. package/lib/dist-custom-elements/duet-slideout.js +2 -2
  72. package/lib/dist-custom-elements/duet-step.js +1 -1
  73. package/lib/dist-custom-elements/duet-submenu-bar-dropdown-link.js +1 -1
  74. package/lib/dist-custom-elements/duet-submenu-bar-dropdown.js +1 -1
  75. package/lib/dist-custom-elements/duet-submenu-bar-item.js +1 -1
  76. package/lib/dist-custom-elements/duet-submenu-bar-link.js +1 -1
  77. package/lib/dist-custom-elements/duet-tab-group.js +6 -6
  78. package/lib/dist-custom-elements/duet-tab.js +1 -1
  79. package/lib/dist-custom-elements/duet-textarea.js +4 -4
  80. package/lib/dist-custom-elements/duet-toggle.js +1 -1
  81. package/lib/dist-custom-elements/duet-toolbar-dropdown-link.js +1 -1
  82. package/lib/dist-custom-elements/duet-toolbar-dropdown.js +1 -1
  83. package/lib/dist-custom-elements/duet-tooltip-button.js +1 -1
  84. package/lib/dist-custom-elements/duet-tooltip-popup.js +1 -1
  85. package/lib/dist-custom-elements/duet-tooltip.js +1 -1
  86. package/lib/dist-custom-elements/duet-tray.js +1 -1
  87. package/lib/dist-custom-elements/duet-upload-item.js +1 -1
  88. package/lib/dist-custom-elements/duet-upload.js +5 -5
  89. package/lib/dist-custom-elements/{p-cff358b0.js → p-014c1177.js} +49 -8
  90. package/lib/dist-custom-elements/{p-c3d02eb2.js → p-03152b20.js} +1 -1
  91. package/lib/dist-custom-elements/{p-d87f6dd5.js → p-06e608ae.js} +3 -1
  92. package/lib/dist-custom-elements/{p-9cdbc360.js → p-0cee8a12.js} +1 -1
  93. package/lib/dist-custom-elements/{p-12a0876b.js → p-24693e9a.js} +1 -1
  94. package/lib/dist-custom-elements/{p-9a833e56.js → p-28ec3461.js} +1 -1
  95. package/lib/dist-custom-elements/{p-d191ba9e.js → p-45fd4d84.js} +1 -1
  96. package/lib/dist-custom-elements/{p-89d58b60.js → p-6d366100.js} +3 -3
  97. package/lib/dist-custom-elements/p-755dd68f.js +285 -0
  98. package/lib/dist-custom-elements/{p-e44c0eff.js → p-785686e3.js} +1 -1
  99. package/lib/dist-custom-elements/{p-e00d43f3.js → p-92a16064.js} +1 -1
  100. package/lib/dist-custom-elements/{p-f9f9e33d.js → p-a02e62f3.js} +3 -3
  101. package/lib/dist-custom-elements/{p-0d5c0a22.js → p-c8415e2f.js} +1 -1
  102. package/lib/dist-custom-elements/{p-d848b48d.js → p-e702eb52.js} +4 -4
  103. package/lib/duet/duet.esm.js +1 -1
  104. package/lib/duet/{p-88a46585.system.entry.js → p-061f4be0.system.entry.js} +1 -1
  105. package/lib/duet/p-06e608ae.js +4 -0
  106. package/lib/duet/{p-8ca813cb.system.entry.js → p-0778ccde.system.entry.js} +1 -1
  107. package/lib/duet/p-07ac7f3e.system.entry.js +4 -0
  108. package/lib/duet/p-15e24bf0.entry.js +4 -0
  109. package/lib/duet/{p-0dac34a4.system.entry.js → p-1ef0e5ca.system.entry.js} +1 -1
  110. package/lib/duet/{p-c9781f22.entry.js → p-2084a65f.entry.js} +1 -1
  111. package/lib/duet/{p-fd0bb0bf.entry.js → p-23cecf9f.entry.js} +1 -1
  112. package/lib/duet/{p-09e4195f.system.entry.js → p-257800b7.system.entry.js} +1 -1
  113. package/lib/duet/{p-1afd901a.entry.js → p-29491f9f.entry.js} +1 -1
  114. package/lib/duet/{p-3b5ff822.entry.js → p-3302d75d.entry.js} +1 -1
  115. package/lib/duet/{p-7629cd0a.entry.js → p-40375e30.entry.js} +1 -1
  116. package/lib/duet/{p-ba4445cf.system.entry.js → p-45bb3cd0.system.entry.js} +1 -1
  117. package/lib/duet/p-4781cd58.entry.js +4 -0
  118. package/lib/duet/p-4cb5943c.entry.js +4 -0
  119. package/lib/duet/{p-b2f2992f.system.entry.js → p-4de910bd.system.entry.js} +1 -1
  120. package/lib/duet/p-6151635f.system.js +1 -1
  121. package/lib/duet/{p-d349dd93.entry.js → p-67382632.entry.js} +1 -1
  122. package/lib/duet/{p-699a98b4.entry.js → p-76e54ff5.entry.js} +1 -1
  123. package/lib/duet/{p-4d2ef0e2.entry.js → p-7a161455.entry.js} +1 -1
  124. package/lib/duet/{p-3d38079c.entry.js → p-7ca15c93.entry.js} +1 -1
  125. package/lib/duet/{p-bb09fff0.system.entry.js → p-7de614df.system.entry.js} +1 -1
  126. package/lib/duet/{p-480f37b6.entry.js → p-83238fe7.entry.js} +1 -1
  127. package/lib/duet/{p-7c1db591.system.entry.js → p-8a4ba903.system.entry.js} +1 -1
  128. package/lib/duet/{p-4f32a7ee.entry.js → p-8ba91848.entry.js} +1 -1
  129. package/lib/duet/{p-708359ec.system.entry.js → p-999fff8d.system.entry.js} +1 -1
  130. package/lib/duet/{p-9d91a1dd.system.entry.js → p-9e75e5d8.system.entry.js} +1 -1
  131. package/lib/duet/{p-343d037e.entry.js → p-a3afb1af.entry.js} +1 -1
  132. package/lib/duet/{p-2ca6a8a0.system.entry.js → p-a3e90064.system.entry.js} +1 -1
  133. package/lib/duet/{p-892a5644.system.entry.js → p-aba91113.system.entry.js} +1 -1
  134. package/lib/duet/p-ae21ad57.system.js +4 -0
  135. package/lib/duet/{p-ce05fe6d.system.entry.js → p-b2fc4b72.system.entry.js} +1 -1
  136. package/lib/duet/{p-84778369.entry.js → p-b5595969.entry.js} +1 -1
  137. package/lib/duet/{p-bf51f8a5.system.entry.js → p-c68602c9.system.entry.js} +1 -1
  138. package/lib/duet/{p-f6530332.system.entry.js → p-d5721f0d.system.entry.js} +1 -1
  139. package/lib/duet/{p-c00fe4ed.entry.js → p-dc133655.entry.js} +1 -1
  140. package/lib/duet/p-de5054b6.system.entry.js +4 -0
  141. package/lib/duet/{p-61feb701.entry.js → p-df345202.entry.js} +1 -1
  142. package/lib/duet/{p-2628a322.entry.js → p-e0907f29.entry.js} +1 -1
  143. package/lib/duet/p-e333b9fc.system.entry.js +4 -0
  144. package/lib/duet/p-e411627f.entry.js +4 -0
  145. package/lib/duet/{p-da51c71f.system.entry.js → p-eafed149.system.entry.js} +1 -1
  146. package/lib/duet/p-f2279e1e.entry.js +4 -0
  147. package/lib/duet/{p-b1ab1664.system.entry.js → p-fa311641.system.entry.js} +1 -1
  148. package/lib/duet/{p-320318de.system.entry.js → p-fa72c79b.system.entry.js} +1 -1
  149. package/lib/esm/duet-alert.entry.js +1 -1
  150. package/lib/esm/duet-banner.entry.js +1 -1
  151. package/lib/esm/duet-callout.entry.js +1 -1
  152. package/lib/esm/duet-chip.entry.js +9 -2
  153. package/lib/esm/duet-choice_2.entry.js +1 -1
  154. package/lib/esm/duet-collapsible.entry.js +1 -1
  155. package/lib/esm/duet-combobox.entry.js +261 -128
  156. package/lib/esm/duet-date-picker.entry.js +1 -1
  157. package/lib/esm/duet-fieldset.entry.js +1 -1
  158. package/lib/esm/duet-hero.entry.js +1 -1
  159. package/lib/esm/duet-input_2.entry.js +39 -3
  160. package/lib/esm/duet-modal.entry.js +1 -1
  161. package/lib/esm/duet-multiselect.entry.js +1 -1
  162. package/lib/esm/duet-number-input.entry.js +1 -1
  163. package/lib/esm/duet-promo-card.entry.js +1 -1
  164. package/lib/esm/duet-radio_2.entry.js +1 -1
  165. package/lib/esm/duet-scrollable_3.entry.js +1 -1
  166. package/lib/esm/duet-select.entry.js +1 -1
  167. package/lib/esm/duet-slideout-panel.entry.js +1 -1
  168. package/lib/esm/duet-slideout.entry.js +1 -1
  169. package/lib/esm/duet-textarea.entry.js +1 -1
  170. package/lib/esm/duet.js +1 -1
  171. package/lib/esm/loader.js +1 -1
  172. package/lib/esm/{slot-utils-1115a819.js → slot-utils-b50aaef5.js} +3 -1
  173. package/lib/esm-es5/duet-alert.entry.js +1 -1
  174. package/lib/esm-es5/duet-banner.entry.js +1 -1
  175. package/lib/esm-es5/duet-callout.entry.js +1 -1
  176. package/lib/esm-es5/duet-chip.entry.js +1 -1
  177. package/lib/esm-es5/duet-choice_2.entry.js +1 -1
  178. package/lib/esm-es5/duet-collapsible.entry.js +1 -1
  179. package/lib/esm-es5/duet-combobox.entry.js +2 -2
  180. package/lib/esm-es5/duet-date-picker.entry.js +1 -1
  181. package/lib/esm-es5/duet-fieldset.entry.js +1 -1
  182. package/lib/esm-es5/duet-hero.entry.js +1 -1
  183. package/lib/esm-es5/duet-input_2.entry.js +2 -2
  184. package/lib/esm-es5/duet-modal.entry.js +1 -1
  185. package/lib/esm-es5/duet-multiselect.entry.js +1 -1
  186. package/lib/esm-es5/duet-number-input.entry.js +2 -2
  187. package/lib/esm-es5/duet-promo-card.entry.js +2 -2
  188. package/lib/esm-es5/duet-radio_2.entry.js +1 -1
  189. package/lib/esm-es5/duet-scrollable_3.entry.js +1 -1
  190. package/lib/esm-es5/duet-select.entry.js +1 -1
  191. package/lib/esm-es5/duet-slideout-panel.entry.js +1 -1
  192. package/lib/esm-es5/duet-slideout.entry.js +1 -1
  193. package/lib/esm-es5/duet-textarea.entry.js +1 -1
  194. package/lib/esm-es5/duet.js +1 -1
  195. package/lib/esm-es5/loader.js +1 -1
  196. package/lib/esm-es5/slot-utils-b50aaef5.js +4 -0
  197. package/lib/types/components/duet-chip/duet-chip.d.ts +4 -0
  198. package/lib/types/components/duet-combobox/duet-combobox.d.ts +49 -35
  199. package/lib/types/components/duet-input/duet-input.d.ts +30 -0
  200. package/lib/types/components.d.ts +44 -21
  201. package/package.json +2 -2
  202. package/lib/duet/p-7cf03aa8.system.js +0 -4
  203. package/lib/duet/p-92e1181c.entry.js +0 -4
  204. package/lib/duet/p-985c0c67.system.entry.js +0 -4
  205. package/lib/duet/p-9d27bc65.entry.js +0 -4
  206. package/lib/duet/p-afe29a3e.entry.js +0 -4
  207. package/lib/duet/p-cc4a8964.entry.js +0 -4
  208. package/lib/duet/p-d50ad3ed.entry.js +0 -4
  209. package/lib/duet/p-d87f6dd5.js +0 -4
  210. package/lib/duet/p-f1b01db9.system.entry.js +0 -4
  211. package/lib/duet/p-fa21a3b6.system.entry.js +0 -4
  212. package/lib/esm-es5/slot-utils-1115a819.js +0 -4
@@ -2,18 +2,27 @@
2
2
  * Built with Duet Design System
3
3
  */
4
4
  import { createPage } from "../../utils/test-utils";
5
+ const items = [
6
+ { id: 0, value: "49200", name: "Heinlahti" },
7
+ { id: 1, value: "49210", name: "Huutjarvi" },
8
+ { id: 2, value: "49220", name: "Siltakyla" },
9
+ { id: 3, value: "49240", name: "Purola" },
10
+ { id: 4, value: "49270", name: "Something" },
11
+ { id: 5, value: "49290", name: "Vastila" },
12
+ ];
5
13
  const createPageWithCombobox = async () => {
6
- const combobox = `<duet-combobox force="true"><duet-input label="Combobox Postalcode example" icon="form-location" expand caption="use arrow keys to navigate, type to search list"></duet-input></duet-combobox>`;
14
+ const combobox = `<duet-combobox><duet-input label="Example" expand></duet-input></duet-combobox>`;
7
15
  const page = await createPage(combobox);
8
16
  await page.$eval("duet-combobox", (combobox, props) => Object.assign(combobox, props), {
9
- items: [
10
- { id: 0, value: "49200", name: "Heinlahti" },
11
- { id: 1, value: "49210", name: "Huutjarvi" },
12
- { id: 2, value: "49220", name: "Siltakyla" },
13
- { id: 3, value: "49240", name: "Purola" },
14
- { id: 4, value: "49270", name: "Something" },
15
- { id: 5, value: "49290", name: "Vastila" },
16
- ],
17
+ items,
18
+ });
19
+ return page;
20
+ };
21
+ const createPageWithMultiCombobox = async () => {
22
+ const combobox = `<duet-combobox multiple></duet-combobox>`;
23
+ const page = await createPage(combobox);
24
+ await page.$eval("duet-combobox", (combobox, props) => Object.assign(combobox, props), {
25
+ items,
17
26
  });
18
27
  return page;
19
28
  };
@@ -23,101 +32,122 @@ describe("duet-combobox", () => {
23
32
  const component = await page.find("duet-combobox");
24
33
  expect(component).not.toBeNull();
25
34
  });
26
- it("allow selection of items via keyboard, make sure tabbing away retains content", async () => {
35
+ it("allows typing in input", async () => {
36
+ const page = await createPageWithCombobox();
37
+ const element = await page.find("duet-combobox");
38
+ const input = await element.find("duet-input .duet-input");
39
+ await input.click();
40
+ await page.keyboard.type("Loremipsum", { delay: 150 });
41
+ expect(await input.getProperty("value")).toBe("Loremipsum");
42
+ expect(await element.getProperty("value")).toBeFalsy();
43
+ });
44
+ it("allows selecting item with keyboard", async () => {
27
45
  const page = await createPageWithCombobox();
28
46
  const element = await page.find("duet-combobox");
29
47
  const input = await element.find("duet-input .duet-input");
30
48
  await input.click();
31
- // type some chars that match the values in the combobox
32
49
  await page.keyboard.type("H", { delay: 150 });
33
50
  await page.keyboard.press("ArrowDown", { delay: 150 });
34
- // move cursor so we can test maintaining position
35
51
  await page.keyboard.press("Enter");
36
52
  await page.waitForChanges();
37
- // check the value
38
53
  expect(await input.getProperty("value")).toBe("Heinlahti");
39
- // type some chars that do not match the values in the combobox
40
- await page.keyboard.type("superMAN", { delay: 50 });
41
- // tab to input
54
+ expect(await element.getProperty("value")).toBe("49200");
55
+ });
56
+ it("keeps independent combobox and input values on blur", async () => {
57
+ const page = await createPageWithCombobox();
58
+ const element = await page.find("duet-combobox");
59
+ const input = await element.find("duet-input .duet-input");
60
+ await input.click();
61
+ await page.keyboard.type("H", { delay: 150 });
62
+ await page.keyboard.press("ArrowDown", { delay: 150 });
63
+ await page.keyboard.press("Enter");
64
+ await page.waitForChanges();
65
+ await page.keyboard.type("Loremipsum", { delay: 50 });
42
66
  await page.keyboard.press("Tab");
43
- // we should see value hasn't changed
44
67
  await page.waitForChanges();
45
- expect(await input.getProperty("value")).toBe("Heinlahti");
68
+ expect(await input.getProperty("value")).toBe("HeinlahtiLoremipsum");
69
+ expect(await element.getProperty("value")).toBe("49200");
46
70
  });
47
- it("closes via escape key with null values if forced", async () => {
71
+ it("clears input on blur if forced and no selection made", async () => {
48
72
  const page = await createPageWithCombobox();
49
73
  const element = await page.find("duet-combobox");
50
74
  const input = await element.find("duet-input .duet-input");
51
- // tab to input
75
+ element.setProperty("force", true);
76
+ await page.waitForChanges();
52
77
  await page.keyboard.press("Tab");
53
- // type some chars that match the values in the combobox
54
78
  await page.keyboard.type("Heinlah", { delay: 50 });
55
- // send escape
56
- await page.keyboard.press("Escape");
79
+ await page.keyboard.press("Tab");
57
80
  await page.waitForChanges();
58
- // check the value
59
81
  expect(await input.getProperty("value")).toBe("");
82
+ expect(await element.getProperty("value")).toBeFalsy();
60
83
  });
61
- it("closes via escape key with set values if forced", async () => {
84
+ it("reverts input value to the selected item on blur if forced", async () => {
62
85
  const page = await createPageWithCombobox();
63
- const targetValue = "Heinlahti";
64
86
  const element = await page.find("duet-combobox");
65
87
  const input = await element.find("duet-input .duet-input");
66
- // tab to input
88
+ element.setProperty("force", true);
89
+ await page.waitForChanges();
67
90
  await page.keyboard.press("Tab");
68
- // type some chars that match the values in the combobox
69
91
  await page.keyboard.type("Heinlah", { delay: 50 });
70
- // move cursor so we can test maintaining position
71
92
  await page.keyboard.press("ArrowDown");
72
93
  await page.keyboard.press("Enter");
73
- //for each letter there is in the string targetValue we need to press backspace
74
- for (let i = 0; i < targetValue.length; i++) {
75
- await page.keyboard.press("Backspace");
76
- }
77
- // type some chars that match the values in the combobox
78
- await page.keyboard.type("Pyhtää", { delay: 50 });
79
- // send escape
80
- await page.keyboard.press("Escape");
81
94
  await page.waitForChanges();
82
- const itemValue = await input.getProperty("value");
83
- // check the value
84
- expect(itemValue).toBe(targetValue);
95
+ await page.keyboard.type("Loremipsum", { delay: 50 });
96
+ await page.keyboard.press("Tab");
97
+ await page.waitForChanges();
98
+ expect(await input.getProperty("value")).toBe("Heinlahti");
99
+ expect(await element.getProperty("value")).toBe("49200");
85
100
  });
86
101
  it("shows dropdown navigable via keys", async () => {
87
102
  const page = await createPageWithCombobox();
88
103
  const element = await page.find("duet-combobox");
89
104
  const input = await element.find("duet-input .duet-input");
90
- // focus on input
91
105
  await input.click();
92
- // type some chars that match the values in the combobox
93
106
  await page.keyboard.type("H", { delay: 150 });
94
- // send keys to navigate
95
107
  await page.keyboard.press("ArrowDown", { delay: 150 });
96
108
  await page.keyboard.press("ArrowDown", { delay: 150 });
97
109
  await page.keyboard.press("Enter", { delay: 50 });
98
- // tab to input
99
110
  await page.keyboard.press("Tab", { delay: 500 });
100
111
  await page.waitForChanges();
101
- // check the value
102
112
  expect(await input.getProperty("value")).toBe("Huutjarvi");
113
+ expect(await element.getProperty("value")).toBe("49210");
103
114
  });
104
115
  it("allows filtering middle of string", async () => {
105
116
  const page = await createPageWithCombobox();
106
117
  const element = await page.find("duet-combobox");
118
+ const input = await element.find("duet-input .duet-input");
107
119
  element.setProperty("filterType", "includes");
108
120
  await page.waitForChanges();
109
- const input = await element.find("duet-input .duet-input");
110
- // focus on input
111
121
  await input.click();
112
- // type some chars that match the values in the combobox
113
122
  await page.keyboard.type("uu", { delay: 150 });
114
- // send keys to navigate
115
123
  await page.keyboard.press("ArrowDown", { delay: 150 });
116
124
  await page.keyboard.press("Enter", { delay: 50 });
117
- // tab to input
118
125
  await page.keyboard.press("Tab", { delay: 500 });
119
126
  await page.waitForChanges();
120
- // check the value
121
127
  expect(await input.getProperty("value")).toBe("Huutjarvi");
128
+ expect(await element.getProperty("value")).toBe("49210");
129
+ });
130
+ it("will add input if not provided in slot", async () => {
131
+ const page = await createPageWithMultiCombobox();
132
+ const element = await page.find("duet-combobox");
133
+ const input = await element.find("duet-input .duet-input");
134
+ expect(input).not.toBeNull();
135
+ });
136
+ it("allows selection of multiple items", async () => {
137
+ const page = await createPageWithMultiCombobox();
138
+ const element = await page.find("duet-combobox");
139
+ const input = await element.find("duet-input .duet-input");
140
+ await input.click();
141
+ // Select { id: 3, value: "49240", name: "Purola" }
142
+ await page.keyboard.type("pu", { delay: 150 });
143
+ await page.keyboard.press("ArrowDown", { delay: 150 });
144
+ await page.keyboard.press("Enter", { delay: 50 });
145
+ // Select { id: 5, value: "49290", name: "Vastila" }
146
+ await page.keyboard.type("va", { delay: 150 });
147
+ await page.keyboard.press("ArrowDown", { delay: 150 });
148
+ await page.keyboard.press("Enter", { delay: 50 });
149
+ expect(await input.getProperty("value")).toBe("");
150
+ expect(await element.find("duet-chip")).not.toBeNull();
151
+ expect(await element.getProperty("value")).toEqual(["49240", "49290"]);
122
152
  });
123
153
  });