@ukic/web-components 2.29.0 → 2.29.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/ic-alert.cjs.entry.js +1 -1
- package/dist/cjs/ic-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-popover-menu.cjs.entry.js +18 -12
- package/dist/cjs/ic-popover-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-search-bar.cjs.entry.js +14 -27
- package/dist/cjs/ic-search-bar.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-select.cjs.entry.js +5 -5
- package/dist/cjs/ic-select.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab-context.cjs.entry.js +68 -145
- package/dist/cjs/ic-tab-context.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab-panel.cjs.entry.js +5 -13
- package/dist/cjs/ic-tab-panel.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-tab.cjs.entry.js +9 -10
- package/dist/cjs/ic-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-text-field.cjs.entry.js +1 -1
- package/dist/cjs/ic-text-field.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-typography.cjs.entry.js +3 -1
- package/dist/cjs/ic-typography.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ic-alert/ic-alert.css +5 -0
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.js +45 -12
- package/dist/collection/components/ic-popover-menu/ic-popover-menu.js.map +1 -1
- package/dist/collection/components/ic-search-bar/ic-search-bar.js +14 -27
- package/dist/collection/components/ic-search-bar/ic-search-bar.js.map +1 -1
- package/dist/collection/components/ic-select/ic-select.js +5 -5
- package/dist/collection/components/ic-select/ic-select.js.map +1 -1
- package/dist/collection/components/ic-tab/ic-tab.js +9 -10
- package/dist/collection/components/ic-tab/ic-tab.js.map +1 -1
- package/dist/collection/components/ic-tab-context/ic-tab-context.js +68 -145
- package/dist/collection/components/ic-tab-context/ic-tab-context.js.map +1 -1
- package/dist/collection/components/ic-tab-context/test/basic/ic-tab-context.spec.js +2 -2
- package/dist/collection/components/ic-tab-context/test/basic/ic-tab-context.spec.js.map +1 -1
- package/dist/collection/components/ic-tab-panel/ic-tab-panel.js +5 -73
- package/dist/collection/components/ic-tab-panel/ic-tab-panel.js.map +1 -1
- package/dist/collection/components/ic-text-field/ic-text-field.js +1 -1
- package/dist/collection/components/ic-text-field/ic-text-field.js.map +1 -1
- package/dist/collection/components/ic-typography/ic-typography.js +3 -1
- package/dist/collection/components/ic-typography/ic-typography.js.map +1 -1
- package/dist/components/ic-alert2.js +1 -1
- package/dist/components/ic-alert2.js.map +1 -1
- package/dist/components/ic-popover-menu.js +20 -13
- package/dist/components/ic-popover-menu.js.map +1 -1
- package/dist/components/ic-search-bar.js +14 -27
- package/dist/components/ic-search-bar.js.map +1 -1
- package/dist/components/ic-select.js +5 -5
- package/dist/components/ic-select.js.map +1 -1
- package/dist/components/ic-tab-context.js +68 -145
- package/dist/components/ic-tab-context.js.map +1 -1
- package/dist/components/ic-tab-panel.js +6 -17
- package/dist/components/ic-tab-panel.js.map +1 -1
- package/dist/components/ic-tab.js +9 -10
- package/dist/components/ic-tab.js.map +1 -1
- package/dist/components/ic-text-field2.js +1 -1
- package/dist/components/ic-text-field2.js.map +1 -1
- package/dist/components/ic-typography2.js +3 -1
- package/dist/components/ic-typography2.js.map +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-dcd475cc.entry.js → p-0432d31a.entry.js} +2 -2
- package/dist/core/p-0432d31a.entry.js.map +1 -0
- package/dist/core/{p-227f6a41.entry.js → p-2889cc17.entry.js} +2 -2
- package/dist/core/p-2889cc17.entry.js.map +1 -0
- package/dist/core/{p-60746e10.entry.js → p-4f0e9434.entry.js} +2 -2
- package/dist/core/p-4f0e9434.entry.js.map +1 -0
- package/dist/core/{p-4562904d.entry.js → p-72b0a5be.entry.js} +2 -2
- package/dist/core/{p-4562904d.entry.js.map → p-72b0a5be.entry.js.map} +1 -1
- package/dist/core/p-72b350bc.entry.js +2 -0
- package/dist/core/p-72b350bc.entry.js.map +1 -0
- package/dist/core/{p-db52d416.entry.js → p-8a8bf98c.entry.js} +2 -2
- package/dist/core/{p-db52d416.entry.js.map → p-8a8bf98c.entry.js.map} +1 -1
- package/dist/core/p-9df32798.entry.js +2 -0
- package/dist/core/p-9df32798.entry.js.map +1 -0
- package/dist/core/p-bb4b7dcb.entry.js +2 -0
- package/dist/core/p-bb4b7dcb.entry.js.map +1 -0
- package/dist/core/{p-ed2b2bd7.entry.js → p-dd4ef67f.entry.js} +2 -2
- package/dist/core/{p-ed2b2bd7.entry.js.map → p-dd4ef67f.entry.js.map} +1 -1
- package/dist/esm/core.js +1 -1
- package/dist/esm/ic-alert.entry.js +1 -1
- package/dist/esm/ic-alert.entry.js.map +1 -1
- package/dist/esm/ic-popover-menu.entry.js +18 -12
- package/dist/esm/ic-popover-menu.entry.js.map +1 -1
- package/dist/esm/ic-search-bar.entry.js +14 -27
- package/dist/esm/ic-search-bar.entry.js.map +1 -1
- package/dist/esm/ic-select.entry.js +5 -5
- package/dist/esm/ic-select.entry.js.map +1 -1
- package/dist/esm/ic-tab-context.entry.js +68 -145
- package/dist/esm/ic-tab-context.entry.js.map +1 -1
- package/dist/esm/ic-tab-panel.entry.js +5 -13
- package/dist/esm/ic-tab-panel.entry.js.map +1 -1
- package/dist/esm/ic-tab.entry.js +9 -10
- package/dist/esm/ic-tab.entry.js.map +1 -1
- package/dist/esm/ic-text-field.entry.js +1 -1
- package/dist/esm/ic-text-field.entry.js.map +1 -1
- package/dist/esm/ic-typography.entry.js +3 -1
- package/dist/esm/ic-typography.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ic-popover-menu/ic-popover-menu.d.ts +2 -2
- package/dist/types/components/ic-tab-context/ic-tab-context.d.ts +9 -6
- package/dist/types/components/ic-tab-panel/ic-tab-panel.d.ts +0 -12
- package/dist/types/components.d.ts +4 -3
- package/hydrate/index.js +128 -220
- package/package.json +2 -2
- package/dist/collection/components/ic-radio-group/test/basic/ic-radio-group.e2e.js +0 -343
- package/dist/collection/components/ic-radio-group/test/basic/ic-radio-group.e2e.js.map +0 -1
- package/dist/collection/components/ic-search-bar/test/basic/ic-search-bar.e2e.js +0 -1106
- package/dist/collection/components/ic-search-bar/test/basic/ic-search-bar.e2e.js.map +0 -1
- package/dist/collection/components/ic-stepper/test/basic/ic-stepper.e2e.js +0 -49
- package/dist/collection/components/ic-stepper/test/basic/ic-stepper.e2e.js.map +0 -1
- package/dist/collection/components/ic-tab-panel/test/basic/ic-tab-panel.spec.js +0 -65
- package/dist/collection/components/ic-tab-panel/test/basic/ic-tab-panel.spec.js.map +0 -1
- package/dist/collection/components/ic-tooltip/test/basic/ic-tooltip.e2e.js +0 -109
- package/dist/collection/components/ic-tooltip/test/basic/ic-tooltip.e2e.js.map +0 -1
- package/dist/collection/components/ic-typography/test/basic/ic-typography.e2e.js +0 -39
- package/dist/collection/components/ic-typography/test/basic/ic-typography.e2e.js.map +0 -1
- package/dist/core/p-227f6a41.entry.js.map +0 -1
- package/dist/core/p-60746e10.entry.js.map +0 -1
- package/dist/core/p-9e15d0e1.entry.js +0 -2
- package/dist/core/p-9e15d0e1.entry.js.map +0 -1
- package/dist/core/p-cb14349b.entry.js +0 -2
- package/dist/core/p-cb14349b.entry.js.map +0 -1
- package/dist/core/p-dcd475cc.entry.js.map +0 -1
- package/dist/core/p-e735d773.entry.js +0 -2
- package/dist/core/p-e735d773.entry.js.map +0 -1
@@ -1,1106 +0,0 @@
|
|
1
|
-
import { newE2EPage } from "@stencil/core/testing";
|
2
|
-
beforeAll(() => {
|
3
|
-
jest.spyOn(console, "warn").mockImplementation(jest.fn());
|
4
|
-
});
|
5
|
-
describe("ic-search-bar", () => {
|
6
|
-
const options = [
|
7
|
-
{ label: "foo", value: "foo" },
|
8
|
-
{ label: "bar", value: "bar" },
|
9
|
-
{ label: "baz", value: "qux" },
|
10
|
-
];
|
11
|
-
const longOptions = [
|
12
|
-
{ label: "item 1", value: "item-1" },
|
13
|
-
{ label: "item 2", value: "item-2" },
|
14
|
-
{ label: "item 3", value: "item-3" },
|
15
|
-
{ label: "item 4", value: "item-4" },
|
16
|
-
{ label: "item 5", value: "item-5" },
|
17
|
-
];
|
18
|
-
const focusAndTypeIntoInput = async (value, page) => {
|
19
|
-
await page.$eval("ic-search-bar", (el) => {
|
20
|
-
const textfield = el.shadowRoot.querySelector("ic-text-field");
|
21
|
-
const input = textfield.shadowRoot.querySelector("#ic-search-bar-input-0");
|
22
|
-
input.focus();
|
23
|
-
});
|
24
|
-
value.split("").forEach(async (char) => {
|
25
|
-
await page.keyboard.press(char);
|
26
|
-
});
|
27
|
-
};
|
28
|
-
it("renders clear button when value present", async () => {
|
29
|
-
const page = await newE2EPage();
|
30
|
-
await page.setContent('<ic-search-bar label="Test Label"></ic-search-bar>');
|
31
|
-
await page.waitForChanges();
|
32
|
-
let clearButton = await page.find("ic-search-bar >>> ic-text-field .clear-button");
|
33
|
-
expect(await clearButton.isVisible()).toBeFalsy();
|
34
|
-
await focusAndTypeIntoInput("foo", page);
|
35
|
-
await page.waitForChanges();
|
36
|
-
clearButton = await page.find("ic-search-bar >>> ic-text-field .clear-button");
|
37
|
-
expect(await clearButton.isVisible()).toBeTruthy();
|
38
|
-
});
|
39
|
-
it("should clear value when clear button pressed", async () => {
|
40
|
-
const page = await newE2EPage();
|
41
|
-
await page.setContent('<ic-search-bar label="Test Label"></ic-search-bar>');
|
42
|
-
const searchBar = await page.find("ic-search-bar");
|
43
|
-
const icClear = await page.spyOnEvent("icClear");
|
44
|
-
await focusAndTypeIntoInput("foo", page);
|
45
|
-
await page.waitForChanges();
|
46
|
-
const clearButton = await page.find("ic-search-bar >>> ic-text-field .clear-button");
|
47
|
-
await clearButton.click();
|
48
|
-
await page.waitForChanges();
|
49
|
-
const activeElId = await page.$eval("ic-search-bar", (el) => el.shadowRoot.querySelector("ic-text-field").shadowRoot.activeElement.id);
|
50
|
-
expect(await searchBar.getProperty("value")).toBe("");
|
51
|
-
expect(activeElId).toBe("ic-search-bar-input-0");
|
52
|
-
expect(icClear).toHaveReceivedEvent;
|
53
|
-
});
|
54
|
-
it("should emit icSubmitSearch when submit is clicked", async () => {
|
55
|
-
const page = await newE2EPage();
|
56
|
-
await page.setContent(`<ic-search-bar label="Test Label"></ic-search-bar>`);
|
57
|
-
await page.waitForChanges();
|
58
|
-
await focusAndTypeIntoInput("foo", page);
|
59
|
-
const searchSubmitButton = await page.find("ic-search-bar >>> ic-text-field ic-button.search-submit-button");
|
60
|
-
const icSubmitSearch = await page.spyOnEvent("icSubmitSearch");
|
61
|
-
await searchSubmitButton.click();
|
62
|
-
expect(icSubmitSearch).toHaveReceivedEventDetail({
|
63
|
-
value: "foo",
|
64
|
-
});
|
65
|
-
});
|
66
|
-
it("should invoke submit event when search textfield is in a form", async () => {
|
67
|
-
const page = await newE2EPage();
|
68
|
-
await page.setContent(`
|
69
|
-
<form>
|
70
|
-
<ic-search-bar label="Test Label" name="search01"></ic-search-bar>
|
71
|
-
</form>
|
72
|
-
<p id="text">idle</p>
|
73
|
-
<script>
|
74
|
-
document.querySelector('form').addEventListener('submit', (ev) => {
|
75
|
-
ev.preventDefault();
|
76
|
-
document.querySelector('#text').innerText = 'submitted';
|
77
|
-
})
|
78
|
-
</script>
|
79
|
-
`);
|
80
|
-
const icSubmitSearch = await page.spyOnEvent("icSubmitSearch");
|
81
|
-
await focusAndTypeIntoInput("foo", page);
|
82
|
-
await page.waitForChanges();
|
83
|
-
const searchSubmitButton = await page.find("ic-search-bar >>> ic-text-field ic-button.search-submit-button");
|
84
|
-
await searchSubmitButton.click();
|
85
|
-
await page.waitForChanges();
|
86
|
-
expect(icSubmitSearch).toHaveReceivedEventDetail({
|
87
|
-
value: "foo",
|
88
|
-
});
|
89
|
-
const p = await page.find("#text");
|
90
|
-
expect(p.innerText).toBe("submitted");
|
91
|
-
});
|
92
|
-
it("should render options", async () => {
|
93
|
-
const page = await newE2EPage();
|
94
|
-
await page.setContent(`
|
95
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
96
|
-
`);
|
97
|
-
const searchBar = await page.find("ic-search-bar");
|
98
|
-
searchBar.setProperty("options", options);
|
99
|
-
await page.waitForChanges();
|
100
|
-
let menu = await page.find("ic-search-bar >>> ic-text-field ic-menu");
|
101
|
-
expect(menu).toBeNull();
|
102
|
-
await focusAndTypeIntoInput("ba", page);
|
103
|
-
await page.waitForChanges();
|
104
|
-
menu = await page.find("ic-search-bar >>> ic-text-field ic-menu");
|
105
|
-
await page.waitForChanges();
|
106
|
-
await page.waitForTimeout(500);
|
107
|
-
const menuItems = menu.findAll("li");
|
108
|
-
expect((await menuItems).length).toBe(2);
|
109
|
-
expect(await menu.isVisible()).toBeTruthy();
|
110
|
-
});
|
111
|
-
it("should begin with no aria-owns attribute and then add one when the menu appears", async () => {
|
112
|
-
const page = await newE2EPage();
|
113
|
-
await page.setContent(`
|
114
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
115
|
-
`);
|
116
|
-
const searchBar = await page.find("ic-search-bar");
|
117
|
-
searchBar.setProperty("options", options);
|
118
|
-
await page.waitForChanges();
|
119
|
-
let textField = await page.find("ic-search-bar >>> ic-text-field");
|
120
|
-
let menu = await textField.find("ic-menu");
|
121
|
-
expect(textField).not.toHaveAttribute("aria-owns");
|
122
|
-
expect(menu).toBeNull();
|
123
|
-
await focusAndTypeIntoInput("ba", page);
|
124
|
-
await page.waitForChanges();
|
125
|
-
textField = await page.find("ic-search-bar >>> ic-text-field");
|
126
|
-
menu = await textField.find("ic-menu");
|
127
|
-
expect(textField).toHaveAttribute("aria-owns");
|
128
|
-
expect(menu).not.toBeNull();
|
129
|
-
});
|
130
|
-
it("should focus on input when menu is initially displayed", async () => {
|
131
|
-
const page = await newE2EPage();
|
132
|
-
await page.setContent(`
|
133
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
134
|
-
`);
|
135
|
-
await page.waitForChanges();
|
136
|
-
const searchBar = await page.find("ic-search-bar");
|
137
|
-
searchBar.setProperty("options", options);
|
138
|
-
await page.waitForChanges();
|
139
|
-
await focusAndTypeIntoInput("ba", page);
|
140
|
-
await page.waitForChanges();
|
141
|
-
await page.waitForTimeout(500);
|
142
|
-
const menu = await page.find("ic-search-bar >>> ic-text-field ic-menu");
|
143
|
-
const activeElId = await page.$eval("ic-search-bar", (el) => {
|
144
|
-
const textfield = el.shadowRoot.querySelector("ic-text-field");
|
145
|
-
return textfield.shadowRoot.activeElement.id;
|
146
|
-
});
|
147
|
-
expect(await menu.isVisible()).toBeTruthy();
|
148
|
-
expect(activeElId).toBe("ic-search-bar-input-0");
|
149
|
-
});
|
150
|
-
it("should remove menu when input value is cleared", async () => {
|
151
|
-
const page = await newE2EPage();
|
152
|
-
await page.setContent(`
|
153
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
154
|
-
`);
|
155
|
-
const searchBar = await page.find("ic-search-bar");
|
156
|
-
searchBar.setProperty("options", options);
|
157
|
-
await page.waitForChanges();
|
158
|
-
await focusAndTypeIntoInput("ba", page);
|
159
|
-
await page.waitForTimeout(500);
|
160
|
-
let menu = await page.find("ic-search-bar >>> ic-text-field ic-menu");
|
161
|
-
expect(await menu.isVisible()).toBeTruthy();
|
162
|
-
const clearButton = await page.find("ic-search-bar >>> ic-text-field .clear-button");
|
163
|
-
await clearButton.click();
|
164
|
-
menu = await page.find("ic-search-bar >>> ic-text-field ic-menu");
|
165
|
-
expect(menu).toBeNull();
|
166
|
-
});
|
167
|
-
it("should not update value when options are highlighted", async () => {
|
168
|
-
const page = await newE2EPage();
|
169
|
-
await page.setContent(`
|
170
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
171
|
-
`);
|
172
|
-
const searchBar = await page.find("ic-search-bar");
|
173
|
-
searchBar.setProperty("options", options);
|
174
|
-
await page.waitForChanges();
|
175
|
-
await focusAndTypeIntoInput("ba", page);
|
176
|
-
await page.waitForChanges();
|
177
|
-
await searchBar.press("ArrowDown");
|
178
|
-
await page.waitForChanges();
|
179
|
-
expect(await searchBar.getProperty("value")).toBe("ba");
|
180
|
-
});
|
181
|
-
it("should focus on menu on ArrowDown from input", async () => {
|
182
|
-
const page = await newE2EPage();
|
183
|
-
await page.setContent(`
|
184
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
185
|
-
`);
|
186
|
-
const searchBar = await page.find("ic-search-bar");
|
187
|
-
searchBar.setProperty("options", options);
|
188
|
-
await page.waitForChanges();
|
189
|
-
await focusAndTypeIntoInput("ba", page);
|
190
|
-
await page.waitForChanges();
|
191
|
-
await searchBar.press("ArrowDown");
|
192
|
-
await page.waitForChanges();
|
193
|
-
const activeElId = await page.$eval("ic-search-bar", (el) => {
|
194
|
-
return el.shadowRoot.activeElement.id;
|
195
|
-
});
|
196
|
-
expect(activeElId).toBe("ic-search-bar-input-0-menu-qux");
|
197
|
-
});
|
198
|
-
it("should focus on menu on ArrowUp from input", async () => {
|
199
|
-
const page = await newE2EPage();
|
200
|
-
await page.setContent(`
|
201
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
202
|
-
`);
|
203
|
-
const searchBar = await page.find("ic-search-bar");
|
204
|
-
searchBar.setProperty("options", options);
|
205
|
-
await page.waitForChanges();
|
206
|
-
await focusAndTypeIntoInput("ba", page);
|
207
|
-
await page.waitForChanges();
|
208
|
-
await searchBar.press("ArrowUp");
|
209
|
-
await page.waitForChanges();
|
210
|
-
const activeElId = await page.$eval("ic-search-bar", (el) => {
|
211
|
-
return el.shadowRoot.activeElement.id;
|
212
|
-
});
|
213
|
-
expect(activeElId).toBe("ic-search-bar-input-0-menu-qux");
|
214
|
-
});
|
215
|
-
it("should highlight first and last options using Home and End and move focus to menu", async () => {
|
216
|
-
const page = await newE2EPage();
|
217
|
-
await page.setContent(`
|
218
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
219
|
-
`);
|
220
|
-
const searchBar = await page.find("ic-search-bar");
|
221
|
-
searchBar.setProperty("options", options);
|
222
|
-
await page.waitForChanges();
|
223
|
-
await focusAndTypeIntoInput("ba", page);
|
224
|
-
await page.waitForChanges();
|
225
|
-
await page.keyboard.press("End");
|
226
|
-
await page.waitForChanges();
|
227
|
-
let menuOptions = await page.findAll("ic-search-bar >>> ic-text-field ic-menu li");
|
228
|
-
expect(menuOptions[0]).not.toHaveClass("focused-option");
|
229
|
-
expect(menuOptions[1]).toHaveClass("focused-option");
|
230
|
-
let activeElId = await page.$eval("ic-search-bar", (el) => {
|
231
|
-
return el.shadowRoot.activeElement.id;
|
232
|
-
});
|
233
|
-
expect(activeElId).toBe("ic-search-bar-input-0-menu-qux");
|
234
|
-
await page.keyboard.press("Home");
|
235
|
-
await page.waitForChanges();
|
236
|
-
menuOptions = await page.findAll("ic-search-bar >>> ic-text-field ic-menu li");
|
237
|
-
expect(menuOptions[0]).toHaveClass("focused-option");
|
238
|
-
expect(menuOptions[1]).not.toHaveClass("focused-option");
|
239
|
-
activeElId = await page.$eval("ic-search-bar", (el) => {
|
240
|
-
return el.shadowRoot.activeElement.id;
|
241
|
-
});
|
242
|
-
expect(activeElId).toBe("ic-search-bar-input-0-menu-bar");
|
243
|
-
});
|
244
|
-
it("should select first option and update value as label on Enter", async () => {
|
245
|
-
const page = await newE2EPage();
|
246
|
-
await page.setContent(`
|
247
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
248
|
-
`);
|
249
|
-
await page.waitForChanges();
|
250
|
-
const searchBar = await page.find("ic-search-bar");
|
251
|
-
searchBar.setProperty("options", options);
|
252
|
-
await page.waitForChanges();
|
253
|
-
await focusAndTypeIntoInput("ba", page);
|
254
|
-
await page.waitForChanges();
|
255
|
-
const menu = await page.find("ic-search-bar >>> ic-text-field ic-menu");
|
256
|
-
await menu.press("Enter");
|
257
|
-
expect(await searchBar.getProperty("value")).toBe("bar");
|
258
|
-
});
|
259
|
-
it("should keep the input value on Enter when searchMode is set to `query`", async () => {
|
260
|
-
const page = await newE2EPage();
|
261
|
-
await page.setContent(`
|
262
|
-
<ic-search-bar label="Test Label" search-mode="query"></ic-search-bar>
|
263
|
-
`);
|
264
|
-
await page.waitForChanges();
|
265
|
-
const searchBar = await page.find("ic-search-bar");
|
266
|
-
searchBar.setProperty("options", options);
|
267
|
-
await page.waitForChanges();
|
268
|
-
await focusAndTypeIntoInput("ba", page);
|
269
|
-
await page.waitForChanges();
|
270
|
-
const menu = await page.find("ic-search-bar >>> ic-text-field ic-menu");
|
271
|
-
await menu.press("Enter");
|
272
|
-
expect(await searchBar.getProperty("value")).toBe("ba");
|
273
|
-
});
|
274
|
-
it("should not highlight options when typing and searchMode is `query`", async () => {
|
275
|
-
const page = await newE2EPage();
|
276
|
-
await page.setContent(`
|
277
|
-
<ic-search-bar label="Test Label" search-mode="query"></ic-search-bar>
|
278
|
-
`);
|
279
|
-
await page.waitForChanges();
|
280
|
-
const searchBar = await page.find("ic-search-bar");
|
281
|
-
searchBar.setProperty("options", options);
|
282
|
-
await page.waitForChanges();
|
283
|
-
await focusAndTypeIntoInput("bar", page);
|
284
|
-
await page.waitForChanges();
|
285
|
-
const menuOptions = await page.findAll("ic-search-bar >>> ic-text-field ic-menu li");
|
286
|
-
expect(menuOptions[0]).not.toHaveClass("focused-option");
|
287
|
-
});
|
288
|
-
it("should move focus to first option after one ArrowDown press when searchMode is set to `query`", async () => {
|
289
|
-
const page = await newE2EPage();
|
290
|
-
await page.setContent(`
|
291
|
-
<ic-search-bar label="Test Label" search-mode="query"></ic-search-bar>
|
292
|
-
`);
|
293
|
-
await page.waitForChanges();
|
294
|
-
const searchBar = await page.find("ic-search-bar");
|
295
|
-
searchBar.setProperty("options", options);
|
296
|
-
await page.waitForChanges();
|
297
|
-
await focusAndTypeIntoInput("ba", page);
|
298
|
-
await page.waitForChanges();
|
299
|
-
await page.keyboard.press("ArrowDown");
|
300
|
-
await page.waitForChanges();
|
301
|
-
const menuOptions = await page.findAll("ic-search-bar >>> ic-text-field ic-menu li");
|
302
|
-
expect(menuOptions[0]).toHaveClass("focused-option");
|
303
|
-
});
|
304
|
-
it("should add a space to value on Space", async () => {
|
305
|
-
const page = await newE2EPage();
|
306
|
-
await page.setContent(`
|
307
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
308
|
-
`);
|
309
|
-
await page.waitForChanges();
|
310
|
-
const searchBar = await page.find("ic-search-bar");
|
311
|
-
searchBar.setProperty("options", options);
|
312
|
-
await page.waitForChanges();
|
313
|
-
await focusAndTypeIntoInput("ba", page);
|
314
|
-
await page.waitForChanges();
|
315
|
-
const menu = await page.find("ic-search-bar >>> ic-text-field ic-menu");
|
316
|
-
await menu.press("Space");
|
317
|
-
expect(await searchBar.getProperty("value")).toBe("ba ");
|
318
|
-
});
|
319
|
-
it("should remove a character from value on Backspace", async () => {
|
320
|
-
const page = await newE2EPage();
|
321
|
-
await page.setContent(`
|
322
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
323
|
-
`);
|
324
|
-
await page.waitForChanges();
|
325
|
-
const searchBar = await page.find("ic-search-bar");
|
326
|
-
searchBar.setProperty("options", options);
|
327
|
-
await page.waitForChanges();
|
328
|
-
await focusAndTypeIntoInput("ba", page);
|
329
|
-
await page.waitForChanges();
|
330
|
-
const menu = await page.find("ic-search-bar >>> ic-text-field ic-menu");
|
331
|
-
await menu.press("Backspace");
|
332
|
-
expect(await searchBar.getProperty("value")).toBe("b");
|
333
|
-
});
|
334
|
-
it("should set value to last option when pressing up on input", async () => {
|
335
|
-
const page = await newE2EPage();
|
336
|
-
await page.setContent(`
|
337
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
338
|
-
`);
|
339
|
-
await page.waitForChanges();
|
340
|
-
const searchBar = await page.find("ic-search-bar");
|
341
|
-
searchBar.setProperty("options", options);
|
342
|
-
await page.waitForChanges();
|
343
|
-
await focusAndTypeIntoInput("ba", page);
|
344
|
-
await page.waitForChanges();
|
345
|
-
await searchBar.press("ArrowUp");
|
346
|
-
const menu = await page.find("ic-search-bar >>> ic-text-field ic-menu");
|
347
|
-
await menu.press("Enter");
|
348
|
-
expect(await searchBar.getProperty("value")).toBe("qux");
|
349
|
-
});
|
350
|
-
it("should close menu on escape", async () => {
|
351
|
-
const page = await newE2EPage();
|
352
|
-
await page.setContent(`
|
353
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
354
|
-
`);
|
355
|
-
await page.waitForChanges();
|
356
|
-
const searchBar = await page.find("ic-search-bar");
|
357
|
-
searchBar.setProperty("options", options);
|
358
|
-
await page.waitForChanges();
|
359
|
-
await focusAndTypeIntoInput("ba", page);
|
360
|
-
await page.waitForChanges();
|
361
|
-
await page.keyboard.press("ArrowUp");
|
362
|
-
let menu = await page.find("ic-search-bar >>> ic-text-field ic-menu");
|
363
|
-
expect(await menu.isVisible()).toBeTruthy();
|
364
|
-
await menu.press("Escape");
|
365
|
-
menu = await page.find("ic-search-bar >>> ic-text-field ic-menu");
|
366
|
-
expect(menu).toBeNull();
|
367
|
-
});
|
368
|
-
it("should close menu when blurred and open when focused", async () => {
|
369
|
-
const page = await newE2EPage();
|
370
|
-
await page.setContent(`
|
371
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
372
|
-
`);
|
373
|
-
await page.waitForChanges();
|
374
|
-
const searchBar = await page.find("ic-search-bar");
|
375
|
-
searchBar.setProperty("options", options);
|
376
|
-
await page.waitForChanges();
|
377
|
-
await focusAndTypeIntoInput("ba", page);
|
378
|
-
await page.waitForChanges();
|
379
|
-
// Will focus clear button then blur
|
380
|
-
await page.keyboard.press("Tab");
|
381
|
-
await page.keyboard.press("Tab");
|
382
|
-
await page.waitForChanges();
|
383
|
-
let menu = await page.find("ic-search-bar >>> ic-text-field ic-menu");
|
384
|
-
expect(menu).toBeNull;
|
385
|
-
await page.keyboard.down("Shift");
|
386
|
-
await page.keyboard.press("Tab");
|
387
|
-
await page.waitForChanges();
|
388
|
-
menu = await page.find("ic-search-bar >>> ic-text-field ic-menu");
|
389
|
-
expect(await menu.isVisible()).toBeTruthy();
|
390
|
-
});
|
391
|
-
it("should emit icOptionSelect when a menu option has been selected", async () => {
|
392
|
-
const page = await newE2EPage();
|
393
|
-
await page.setContent(`
|
394
|
-
<ic-search-bar search label="Test Label"></ic-search-bar>
|
395
|
-
`);
|
396
|
-
const icOptionSelect = await page.spyOnEvent("icOptionSelect");
|
397
|
-
const searchBar = await page.find("ic-search-bar");
|
398
|
-
searchBar.setProperty("options", options);
|
399
|
-
await page.waitForChanges();
|
400
|
-
await focusAndTypeIntoInput("fo", page);
|
401
|
-
await page.waitForChanges();
|
402
|
-
await searchBar.press("ArrowDown");
|
403
|
-
await page.waitForChanges();
|
404
|
-
const menu = await page.find("ic-search-bar >>> ic-text-field ic-menu");
|
405
|
-
await menu.press("Enter");
|
406
|
-
expect(icOptionSelect).toHaveReceivedEventDetail({
|
407
|
-
value: "foo",
|
408
|
-
});
|
409
|
-
});
|
410
|
-
it("should emit icMenuChange when opening/closing menu", async () => {
|
411
|
-
const page = await newE2EPage();
|
412
|
-
await page.setContent(`
|
413
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
414
|
-
`);
|
415
|
-
const icMenuChange = await page.spyOnEvent("icMenuChange");
|
416
|
-
const searchBar = await page.find("ic-search-bar");
|
417
|
-
searchBar.setProperty("options", options);
|
418
|
-
await page.waitForChanges();
|
419
|
-
await focusAndTypeIntoInput("ba", page);
|
420
|
-
await page.waitForChanges();
|
421
|
-
expect(icMenuChange).toHaveReceivedEventDetail({
|
422
|
-
open: true,
|
423
|
-
});
|
424
|
-
await page.keyboard.press("Enter");
|
425
|
-
await page.waitForChanges();
|
426
|
-
expect(icMenuChange).toHaveReceivedEventDetail({
|
427
|
-
open: false,
|
428
|
-
});
|
429
|
-
});
|
430
|
-
it("should prepopulate textfield with value in search mode", async () => {
|
431
|
-
const page = await newE2EPage();
|
432
|
-
await page.setContent(`
|
433
|
-
<ic-search-bar label="Test Label" value="test value"></ic-search-bar>
|
434
|
-
`);
|
435
|
-
const input = await page.find("ic-search-bar >>> ic-text-field >>> #ic-search-bar-input-0");
|
436
|
-
expect(await input.getProperty("value")).toBe("test value");
|
437
|
-
});
|
438
|
-
it("should filter options", async () => {
|
439
|
-
const page = await newE2EPage();
|
440
|
-
await page.setContent(`
|
441
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
442
|
-
`);
|
443
|
-
const searchBar = await page.find("ic-search-bar");
|
444
|
-
searchBar.setProperty("options", options);
|
445
|
-
await page.waitForChanges();
|
446
|
-
let menu = await page.find("ic-search-bar >>> ic-text-field ic-menu");
|
447
|
-
expect(menu).toBeNull();
|
448
|
-
await focusAndTypeIntoInput("ba", page);
|
449
|
-
await page.waitForChanges();
|
450
|
-
menu = await page.find("ic-search-bar >>> ic-text-field ic-menu");
|
451
|
-
await page.waitForChanges();
|
452
|
-
let menuItems = menu.findAll("li");
|
453
|
-
expect((await menuItems).length).toBe(2);
|
454
|
-
await page.keyboard.press("r");
|
455
|
-
await page.waitForChanges();
|
456
|
-
menuItems = menu.findAll("li");
|
457
|
-
expect((await menuItems).length).toBe(1);
|
458
|
-
});
|
459
|
-
it("should prevent form submit event when clear is invoked using Enter", async () => {
|
460
|
-
const page = await newE2EPage();
|
461
|
-
await page.setContent(`
|
462
|
-
<form>
|
463
|
-
<ic-search-bar label="Test Label" name="search01"></ic-search-bar>
|
464
|
-
</form>
|
465
|
-
<p id="text">idle</p>
|
466
|
-
<script>
|
467
|
-
document.querySelector('form').addEventListener('submit', () => {
|
468
|
-
document.getElementById('text').innerText = 'submitted';
|
469
|
-
})
|
470
|
-
</script>
|
471
|
-
`);
|
472
|
-
const icClear = await page.spyOnEvent("icClear");
|
473
|
-
const p = await page.find("#text");
|
474
|
-
await focusAndTypeIntoInput("foo", page);
|
475
|
-
await page.waitForChanges();
|
476
|
-
await page.keyboard.press("Tab");
|
477
|
-
await page.keyboard.press("Enter");
|
478
|
-
expect(icClear).toHaveReceivedEvent();
|
479
|
-
expect(p.innerText).toBe("idle");
|
480
|
-
});
|
481
|
-
it("should clear the value when clear is invoked using Space - should not add a whitespace", async () => {
|
482
|
-
const page = await newE2EPage();
|
483
|
-
await page.setContent(`<ic-search-bar label="Test Label"></ic-search-bar>`);
|
484
|
-
const icClear = await page.spyOnEvent("icClear");
|
485
|
-
const searchBar = await page.find("ic-search-bar");
|
486
|
-
await focusAndTypeIntoInput("foo", page);
|
487
|
-
await page.waitForChanges();
|
488
|
-
await page.keyboard.press("Tab");
|
489
|
-
await page.keyboard.press("Space");
|
490
|
-
await page.waitForChanges();
|
491
|
-
expect(icClear).toHaveReceivedEvent();
|
492
|
-
expect(searchBar.getAttribute("value")).toBe("");
|
493
|
-
expect(searchBar.getAttribute("value").length).toBe(0);
|
494
|
-
});
|
495
|
-
it("should emit icSubmitSearch when search button pressed with Space", async () => {
|
496
|
-
const page = await newE2EPage();
|
497
|
-
await page.setContent(`<ic-search-bar label="Test Label"></ic-search-bar>`);
|
498
|
-
const icSubmitSearch = await page.spyOnEvent("icSubmitSearch");
|
499
|
-
await focusAndTypeIntoInput("foo", page);
|
500
|
-
await page.waitForChanges();
|
501
|
-
await page.keyboard.press("Tab");
|
502
|
-
await page.keyboard.press("Tab");
|
503
|
-
await page.keyboard.press("Space");
|
504
|
-
await page.waitForChanges();
|
505
|
-
expect(icSubmitSearch).toHaveReceivedEventDetail({
|
506
|
-
value: "foo",
|
507
|
-
});
|
508
|
-
});
|
509
|
-
it("should update value and move focus back to input when focus previously on ic-menu", async () => {
|
510
|
-
const page = await newE2EPage();
|
511
|
-
await page.setContent(`
|
512
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
513
|
-
`);
|
514
|
-
const searchBar = await page.find("ic-search-bar");
|
515
|
-
searchBar.setProperty("options", options);
|
516
|
-
await page.waitForChanges();
|
517
|
-
await focusAndTypeIntoInput("ba", page);
|
518
|
-
await page.waitForChanges();
|
519
|
-
await page.keyboard.press("ArrowDown");
|
520
|
-
await page.waitForChanges();
|
521
|
-
const focusedElement = await page.evaluate(() => {
|
522
|
-
const el = document.querySelector("ic-search-bar").shadowRoot;
|
523
|
-
return el.activeElement.id;
|
524
|
-
});
|
525
|
-
expect(focusedElement).toBe("ic-search-bar-input-0-menu-qux");
|
526
|
-
await page.keyboard.press("r");
|
527
|
-
const inputEl = await page.evaluate(() => {
|
528
|
-
const el = document
|
529
|
-
.querySelector("ic-search-bar")
|
530
|
-
.shadowRoot.querySelector("ic-text-field");
|
531
|
-
return {
|
532
|
-
focusedEl: el.shadowRoot.activeElement.id,
|
533
|
-
inputValue: el.value,
|
534
|
-
};
|
535
|
-
});
|
536
|
-
expect(inputEl.focusedEl).toBe("ic-search-bar-input-0");
|
537
|
-
expect(inputEl.inputValue).toBe("bar");
|
538
|
-
});
|
539
|
-
it("should render suggestions after number of characters in value set to 3", async () => {
|
540
|
-
const page = await newE2EPage();
|
541
|
-
await page.setContent(`
|
542
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
543
|
-
`);
|
544
|
-
const searchBar = await page.find("ic-search-bar");
|
545
|
-
searchBar.setProperty("options", options);
|
546
|
-
searchBar.setProperty("charactersUntilSuggestion", 3);
|
547
|
-
await page.waitForChanges();
|
548
|
-
await focusAndTypeIntoInput("ba", page);
|
549
|
-
await page.waitForChanges();
|
550
|
-
let menu = await page.find("ic-search-bar >>> ic-text-field ic-menu");
|
551
|
-
expect(menu).toBeNull();
|
552
|
-
await page.waitForChanges();
|
553
|
-
await focusAndTypeIntoInput("r", page);
|
554
|
-
await page.waitForChanges();
|
555
|
-
menu = await page.find("ic-search-bar >>> ic-text-field ic-menu");
|
556
|
-
expect(await menu.isVisible()).toBeTruthy();
|
557
|
-
});
|
558
|
-
it("should render no results available if no matches", async () => {
|
559
|
-
const page = await newE2EPage();
|
560
|
-
await page.setContent(`
|
561
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
562
|
-
`);
|
563
|
-
const searchBar = await page.find("ic-search-bar");
|
564
|
-
searchBar.setProperty("options", options);
|
565
|
-
await page.waitForChanges();
|
566
|
-
await focusAndTypeIntoInput("zzz", page);
|
567
|
-
await page.waitForChanges();
|
568
|
-
const noOptionsLabel = await page.evaluate(() => {
|
569
|
-
const menuEl = document
|
570
|
-
.querySelector("ic-search-bar")
|
571
|
-
.shadowRoot.querySelector("ic-menu");
|
572
|
-
const noOptionsItem = menuEl.querySelectorAll("li")[0];
|
573
|
-
return noOptionsItem.innerText;
|
574
|
-
});
|
575
|
-
expect(noOptionsLabel).toBe("No results found");
|
576
|
-
});
|
577
|
-
it("should render 0 results if no matches (updated no options text)", async () => {
|
578
|
-
const NO_OPTIONS = "0 results";
|
579
|
-
const page = await newE2EPage();
|
580
|
-
await page.setContent(`
|
581
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
582
|
-
`);
|
583
|
-
const searchBar = await page.find("ic-search-bar");
|
584
|
-
searchBar.setProperty("options", options);
|
585
|
-
searchBar.setProperty("emptyOptionListText", NO_OPTIONS);
|
586
|
-
await page.waitForChanges();
|
587
|
-
await focusAndTypeIntoInput("zzz", page);
|
588
|
-
await page.waitForChanges();
|
589
|
-
const noOptionsLabel = await page.evaluate(() => {
|
590
|
-
const menuEl = document
|
591
|
-
.querySelector("ic-search-bar")
|
592
|
-
.shadowRoot.querySelector("ic-menu");
|
593
|
-
const noOptionsItem = menuEl.querySelectorAll("li")[0];
|
594
|
-
return noOptionsItem.innerText;
|
595
|
-
});
|
596
|
-
expect(noOptionsLabel).toBe(NO_OPTIONS);
|
597
|
-
});
|
598
|
-
it("should disable search button on 0 results", async () => {
|
599
|
-
const page = await newE2EPage();
|
600
|
-
await page.setContent(`
|
601
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
602
|
-
`);
|
603
|
-
const searchBar = await page.find("ic-search-bar");
|
604
|
-
searchBar.setProperty("options", options);
|
605
|
-
await page.waitForChanges();
|
606
|
-
await focusAndTypeIntoInput("zzz", page);
|
607
|
-
await page.waitForChanges();
|
608
|
-
const searchSubmitBtn = await page.find("ic-search-bar >>> ic-text-field ic-button.search-submit-button");
|
609
|
-
expect(await searchSubmitBtn.getProperty("disabled")).toBeTruthy();
|
610
|
-
});
|
611
|
-
it("should focus on first option when ic-menu rendered and Enter should select option", async () => {
|
612
|
-
const page = await newE2EPage();
|
613
|
-
await page.setContent(`
|
614
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
615
|
-
`);
|
616
|
-
const searchBar = await page.find("ic-search-bar");
|
617
|
-
searchBar.setProperty("options", options);
|
618
|
-
await page.waitForChanges();
|
619
|
-
await focusAndTypeIntoInput("ba", page);
|
620
|
-
await page.waitForChanges();
|
621
|
-
const FirstOptionClassIsFocusedOption = await page.evaluate(() => {
|
622
|
-
const menuEl = document
|
623
|
-
.querySelector("ic-search-bar")
|
624
|
-
.shadowRoot.querySelector("ic-menu");
|
625
|
-
const firstMenuItem = menuEl.querySelectorAll("li")[0];
|
626
|
-
return firstMenuItem.classList.contains("focused-option");
|
627
|
-
});
|
628
|
-
expect(FirstOptionClassIsFocusedOption).toBeTruthy();
|
629
|
-
await page.keyboard.press("Enter");
|
630
|
-
await page.waitForChanges();
|
631
|
-
const input = await page.find("ic-search-bar >>> ic-text-field >>> #ic-search-bar-input-0");
|
632
|
-
expect(await input.getProperty("value")).toBe("bar");
|
633
|
-
});
|
634
|
-
it("should be able to select second menu item after selecting an initial menu item", async () => {
|
635
|
-
const page = await newE2EPage();
|
636
|
-
await page.setContent(`<ic-search-bar label="Test Label"></ic-search-bar>`);
|
637
|
-
const searchBar = await page.find("ic-search-bar");
|
638
|
-
searchBar.setProperty("options", options);
|
639
|
-
await page.waitForChanges();
|
640
|
-
await focusAndTypeIntoInput("ba", page);
|
641
|
-
await page.waitForChanges();
|
642
|
-
let menu = await page.find("ic-search-bar >>> ic-text-field ic-menu");
|
643
|
-
let firstOption = (await menu.findAll("li"))[0];
|
644
|
-
expect(firstOption).toHaveClass("focused-option");
|
645
|
-
await searchBar.press("Enter");
|
646
|
-
await page.waitForChanges();
|
647
|
-
const value = await searchBar.getProperty("value");
|
648
|
-
await page.waitForChanges();
|
649
|
-
expect(value).toBe("bar");
|
650
|
-
await page.keyboard.press("Backspace");
|
651
|
-
await page.waitForChanges();
|
652
|
-
await searchBar.press("ArrowDown");
|
653
|
-
await page.waitForChanges();
|
654
|
-
menu = await page.find("ic-search-bar >>> ic-text-field ic-menu");
|
655
|
-
firstOption = (await menu.findAll("li"))[0];
|
656
|
-
const lastOption = (await menu.findAll("li"))[1];
|
657
|
-
expect(firstOption).not.toHaveClass("focused-option");
|
658
|
-
expect(lastOption).toHaveClass("focused-option");
|
659
|
-
await searchBar.press("Enter");
|
660
|
-
await page.waitForChanges();
|
661
|
-
expect(await searchBar.getProperty("value")).toBe("qux");
|
662
|
-
});
|
663
|
-
it("should tab through search bar from input > clear > submit > ic-menu (when options are available) > back to search bar", async () => {
|
664
|
-
const page = await newE2EPage();
|
665
|
-
await page.setContent(`<ic-search-bar label="Test Label"></ic-search-bar>`);
|
666
|
-
const searchBar = await page.find("ic-search-bar");
|
667
|
-
searchBar.setProperty("options", options);
|
668
|
-
await page.waitForChanges();
|
669
|
-
await focusAndTypeIntoInput("ba", page);
|
670
|
-
await page.waitForChanges();
|
671
|
-
let focusedElement = await page.evaluate(() => {
|
672
|
-
const el = document
|
673
|
-
.querySelector("ic-search-bar")
|
674
|
-
.shadowRoot.querySelector("ic-text-field");
|
675
|
-
return el.shadowRoot.activeElement.id;
|
676
|
-
});
|
677
|
-
expect(focusedElement).toBe("ic-search-bar-input-0");
|
678
|
-
await page.waitForChanges();
|
679
|
-
await page.keyboard.press("Tab");
|
680
|
-
await page.waitForChanges();
|
681
|
-
focusedElement = await page.evaluate(() => {
|
682
|
-
const el = document.querySelector("ic-search-bar");
|
683
|
-
return el.shadowRoot.activeElement.id;
|
684
|
-
});
|
685
|
-
expect(focusedElement).toBe("clear-button");
|
686
|
-
await page.keyboard.press("Tab");
|
687
|
-
await page.waitForChanges();
|
688
|
-
focusedElement = await page.evaluate(() => {
|
689
|
-
const el = document.querySelector("ic-search-bar");
|
690
|
-
return el.shadowRoot.activeElement.id;
|
691
|
-
});
|
692
|
-
expect(focusedElement).toBe("search-submit-button");
|
693
|
-
await page.keyboard.press("Tab");
|
694
|
-
await page.waitForChanges();
|
695
|
-
focusedElement = await page.evaluate(() => {
|
696
|
-
const el = document.querySelector("ic-search-bar").shadowRoot;
|
697
|
-
return el.activeElement.id;
|
698
|
-
});
|
699
|
-
expect(focusedElement).toBe("ic-search-bar-input-0-menu-bar");
|
700
|
-
await page.waitForChanges();
|
701
|
-
await page.keyboard.down("Shift");
|
702
|
-
await page.keyboard.press("Tab");
|
703
|
-
await page.keyboard.press("Tab");
|
704
|
-
await page.keyboard.press("Tab");
|
705
|
-
await page.waitForChanges();
|
706
|
-
focusedElement = await page.evaluate(() => {
|
707
|
-
const el = document
|
708
|
-
.querySelector("ic-search-bar")
|
709
|
-
.shadowRoot.querySelector("ic-text-field");
|
710
|
-
return el.shadowRoot.activeElement.id;
|
711
|
-
});
|
712
|
-
expect(focusedElement).toBe("ic-search-bar-input-0");
|
713
|
-
});
|
714
|
-
it("should render menu when shift is pressed while focus on input", async () => {
|
715
|
-
const page = await newE2EPage();
|
716
|
-
await page.setContent(`<ic-search-bar label="Test Label"></ic-search-bar>`);
|
717
|
-
const searchBar = await page.find("ic-search-bar");
|
718
|
-
searchBar.setProperty("options", options);
|
719
|
-
await page.waitForChanges();
|
720
|
-
await focusAndTypeIntoInput("ba", page);
|
721
|
-
await page.waitForChanges();
|
722
|
-
await page.keyboard.press("Shift");
|
723
|
-
const menu = await page.find("ic-search-bar >>> ic-menu");
|
724
|
-
expect(await menu.isVisible()).toBeTruthy();
|
725
|
-
});
|
726
|
-
it("should display tooltip on search buttons when enabled", async () => {
|
727
|
-
const page = await newE2EPage();
|
728
|
-
await page.setContent(`<ic-search-bar label="Test Label"></ic-search-bar>`);
|
729
|
-
await page.keyboard.press("Tab");
|
730
|
-
await page.keyboard.press("Tab");
|
731
|
-
await page.waitForChanges();
|
732
|
-
let submitSearchTooltipDisplay = await page.evaluate(() => {
|
733
|
-
const tooltip = document
|
734
|
-
.querySelector("ic-search-bar")
|
735
|
-
.shadowRoot.querySelector("#search-submit-button")
|
736
|
-
.shadowRoot.querySelector("ic-tooltip")
|
737
|
-
.shadowRoot.querySelector(".ic-tooltip-container");
|
738
|
-
return window.getComputedStyle(tooltip).display;
|
739
|
-
});
|
740
|
-
expect(submitSearchTooltipDisplay).toBe("none");
|
741
|
-
await focusAndTypeIntoInput("ba", page);
|
742
|
-
await page.waitForChanges();
|
743
|
-
await page.keyboard.press("Tab");
|
744
|
-
await page.waitForTimeout(300);
|
745
|
-
const clearTooltipDisplay = await page.evaluate(() => {
|
746
|
-
const tooltip = document
|
747
|
-
.querySelector("ic-search-bar")
|
748
|
-
.shadowRoot.querySelector("#clear-button")
|
749
|
-
.shadowRoot.querySelector("ic-tooltip")
|
750
|
-
.shadowRoot.querySelector(".ic-tooltip-container");
|
751
|
-
return window.getComputedStyle(tooltip).display;
|
752
|
-
});
|
753
|
-
expect(clearTooltipDisplay).toBe("block");
|
754
|
-
await page.keyboard.press("Tab");
|
755
|
-
await page.waitForTimeout(300);
|
756
|
-
submitSearchTooltipDisplay = await page.evaluate(() => {
|
757
|
-
const tooltip = document
|
758
|
-
.querySelector("ic-search-bar")
|
759
|
-
.shadowRoot.querySelector("#search-submit-button")
|
760
|
-
.shadowRoot.querySelector("ic-tooltip")
|
761
|
-
.shadowRoot.querySelector(".ic-tooltip-container");
|
762
|
-
return window.getComputedStyle(tooltip).display;
|
763
|
-
});
|
764
|
-
expect(submitSearchTooltipDisplay).toBe("block");
|
765
|
-
});
|
766
|
-
it("should highlight first option again after no results found", async () => {
|
767
|
-
const page = await newE2EPage();
|
768
|
-
await page.setContent(`
|
769
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
770
|
-
`);
|
771
|
-
const searchBar = await page.find("ic-search-bar");
|
772
|
-
searchBar.setProperty("options", options);
|
773
|
-
await page.waitForChanges();
|
774
|
-
await focusAndTypeIntoInput("barr", page);
|
775
|
-
await page.waitForChanges();
|
776
|
-
const noOptionsLabel = await page.evaluate(() => {
|
777
|
-
const menuEl = document
|
778
|
-
.querySelector("ic-search-bar")
|
779
|
-
.shadowRoot.querySelector("ic-menu");
|
780
|
-
const noOptionsItem = menuEl.querySelectorAll("li")[0];
|
781
|
-
return noOptionsItem.innerText;
|
782
|
-
});
|
783
|
-
expect(noOptionsLabel).toBe("No results found");
|
784
|
-
await page.waitForChanges();
|
785
|
-
await page.keyboard.press("Backspace");
|
786
|
-
await page.waitForTimeout(500);
|
787
|
-
const firstOptionFocused = await page.evaluate(() => {
|
788
|
-
const menuEl = document
|
789
|
-
.querySelector("ic-search-bar")
|
790
|
-
.shadowRoot.querySelector("ic-menu");
|
791
|
-
const firstOptionItem = menuEl.querySelectorAll("li")[0];
|
792
|
-
return firstOptionItem.classList.contains("focused-option");
|
793
|
-
});
|
794
|
-
expect(firstOptionFocused).toBeTruthy();
|
795
|
-
});
|
796
|
-
it("should focus onto button from search bar", async () => {
|
797
|
-
const page = await newE2EPage();
|
798
|
-
await page.setContent(`
|
799
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
800
|
-
<ic-button id="button">Foo</ic-button>
|
801
|
-
`);
|
802
|
-
const searchBar = await page.find("ic-search-bar");
|
803
|
-
searchBar.setProperty("options", options);
|
804
|
-
await page.waitForChanges();
|
805
|
-
await focusAndTypeIntoInput("ba", page);
|
806
|
-
await page.waitForChanges();
|
807
|
-
await page.keyboard.press("ArrowDown");
|
808
|
-
await page.waitForChanges();
|
809
|
-
let focusedElement = await page.evaluate(() => {
|
810
|
-
const el = document.querySelector("ic-search-bar").shadowRoot;
|
811
|
-
return el.activeElement.id;
|
812
|
-
});
|
813
|
-
expect(focusedElement).toBe("ic-search-bar-input-0-menu-qux");
|
814
|
-
await page.waitForChanges();
|
815
|
-
await page.keyboard.press("Tab");
|
816
|
-
await page.waitForChanges();
|
817
|
-
focusedElement = await page.evaluate(() => {
|
818
|
-
return document.activeElement.id;
|
819
|
-
});
|
820
|
-
expect(focusedElement).toBe("button");
|
821
|
-
});
|
822
|
-
it("should emit icChange on delay", async () => {
|
823
|
-
const page = await newE2EPage();
|
824
|
-
await page.setContent(`<ic-search-bar label="Test Label" debounce="500"></ic-search-bar>`);
|
825
|
-
await page.waitForChanges();
|
826
|
-
const icChange = await page.spyOnEvent("icChange");
|
827
|
-
await focusAndTypeIntoInput("foo", page);
|
828
|
-
await page.waitForTimeout(600);
|
829
|
-
expect(icChange).toHaveReceivedEventDetail({
|
830
|
-
value: "foo",
|
831
|
-
});
|
832
|
-
await focusAndTypeIntoInput("bar", page);
|
833
|
-
await page.waitForChanges();
|
834
|
-
await page.waitForTimeout(100);
|
835
|
-
expect(icChange).toHaveReceivedEventDetail({
|
836
|
-
value: "foo",
|
837
|
-
});
|
838
|
-
await page.waitForTimeout(500);
|
839
|
-
expect(icChange).toHaveReceivedEventDetail({
|
840
|
-
value: "foobar",
|
841
|
-
});
|
842
|
-
});
|
843
|
-
it("should highlight the menu option items in the correct order with arrowDown", async () => {
|
844
|
-
const page = await newE2EPage();
|
845
|
-
await page.setContent(`
|
846
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
847
|
-
`);
|
848
|
-
const searchBar = await page.find("ic-search-bar");
|
849
|
-
searchBar.setProperty("options", longOptions);
|
850
|
-
await page.waitForChanges();
|
851
|
-
await focusAndTypeIntoInput("it", page);
|
852
|
-
await page.waitForChanges();
|
853
|
-
const menu = await page.find("ic-search-bar >>> ic-text-field ic-menu");
|
854
|
-
// First option has focused-option
|
855
|
-
let option = (await menu.findAll("li"))[0];
|
856
|
-
expect(option).toHaveClass("focused-option");
|
857
|
-
// Other options should not
|
858
|
-
for (let i = 1; i < longOptions.length; i++) {
|
859
|
-
option = (await menu.findAll("li"))[i];
|
860
|
-
expect(option).not.toHaveClass("focused-option");
|
861
|
-
}
|
862
|
-
// Highlight the next option
|
863
|
-
await page.keyboard.press("ArrowDown");
|
864
|
-
await page.waitForChanges();
|
865
|
-
option = (await menu.findAll("li"))[1];
|
866
|
-
expect(option).toHaveClass("focused-option");
|
867
|
-
for (let i = 2; i < longOptions.length; i++) {
|
868
|
-
option = (await menu.findAll("li"))[i];
|
869
|
-
expect(option).not.toHaveClass("focused-option");
|
870
|
-
}
|
871
|
-
await page.keyboard.press("ArrowDown");
|
872
|
-
await page.waitForChanges();
|
873
|
-
option = (await menu.findAll("li"))[2];
|
874
|
-
expect(option).toHaveClass("focused-option");
|
875
|
-
for (let i = 3; i < longOptions.length; i++) {
|
876
|
-
option = (await menu.findAll("li"))[i];
|
877
|
-
expect(option).not.toHaveClass("focused-option");
|
878
|
-
}
|
879
|
-
});
|
880
|
-
it("should highlight the menu option items in the correct order with arrowUp", async () => {
|
881
|
-
const page = await newE2EPage();
|
882
|
-
await page.setContent(`
|
883
|
-
<ic-search-bar label="Test Label"></ic-search-bar>
|
884
|
-
`);
|
885
|
-
const searchBar = await page.find("ic-search-bar");
|
886
|
-
searchBar.setProperty("options", longOptions);
|
887
|
-
await page.waitForChanges();
|
888
|
-
await focusAndTypeIntoInput("it", page);
|
889
|
-
await page.waitForChanges();
|
890
|
-
const menu = await page.find("ic-search-bar >>> ic-text-field ic-menu");
|
891
|
-
// First option has focused-option class
|
892
|
-
let option = (await menu.findAll("li"))[0];
|
893
|
-
expect(option).toHaveClass("focused-option");
|
894
|
-
// Other options should not have focused-option class
|
895
|
-
for (let i = 1; i < longOptions.length; i++) {
|
896
|
-
option = (await menu.findAll("li"))[i];
|
897
|
-
expect(option).not.toHaveClass("focused-option");
|
898
|
-
}
|
899
|
-
// Highlight the last option
|
900
|
-
await page.keyboard.press("ArrowUp");
|
901
|
-
await page.waitForChanges();
|
902
|
-
option = (await menu.findAll("li"))[longOptions.length - 1];
|
903
|
-
expect(option).toHaveClass("focused-option");
|
904
|
-
for (let i = longOptions.length - 2; i >= 0; i--) {
|
905
|
-
option = (await menu.findAll("li"))[i];
|
906
|
-
expect(option).not.toHaveClass("focused-option");
|
907
|
-
}
|
908
|
-
await page.keyboard.press("ArrowUp");
|
909
|
-
await page.waitForChanges();
|
910
|
-
option = (await menu.findAll("li"))[longOptions.length - 2];
|
911
|
-
expect(option).toHaveClass("focused-option");
|
912
|
-
for (let i = longOptions.length - 3; i >= 0; i--) {
|
913
|
-
option = (await menu.findAll("li"))[i];
|
914
|
-
expect(option).not.toHaveClass("focused-option");
|
915
|
-
}
|
916
|
-
});
|
917
|
-
it("should reverse tab to submit button", async () => {
|
918
|
-
const page = await newE2EPage();
|
919
|
-
await page.setContent(`<ic-search-bar label="Test Label"></ic-search-bar>`);
|
920
|
-
const searchBar = await page.find("ic-search-bar");
|
921
|
-
searchBar.setProperty("options", options);
|
922
|
-
await page.waitForChanges();
|
923
|
-
await focusAndTypeIntoInput("foo", page);
|
924
|
-
await page.waitForChanges();
|
925
|
-
await page.keyboard.down("ArrowDown");
|
926
|
-
await page.waitForChanges();
|
927
|
-
await page.keyboard.down("Shift");
|
928
|
-
await page.keyboard.press("Tab");
|
929
|
-
await page.waitForChanges();
|
930
|
-
const activeElId = await page.$eval("ic-search-bar", (el) => {
|
931
|
-
return el.shadowRoot.activeElement.id;
|
932
|
-
});
|
933
|
-
expect(activeElId).toBe("search-submit-button");
|
934
|
-
});
|
935
|
-
it("should not filter options when disable-filter is set to true", async () => {
|
936
|
-
const page = await newE2EPage();
|
937
|
-
await page.setContent(`<ic-search-bar label="Test Label" disable-filter="true"></ic-search-bar>`);
|
938
|
-
const searchBar = await page.find("ic-search-bar");
|
939
|
-
searchBar.setProperty("options", options);
|
940
|
-
await page.waitForChanges();
|
941
|
-
await focusAndTypeIntoInput("foo", page);
|
942
|
-
await page.waitForChanges();
|
943
|
-
const menuOptions = await page.findAll("ic-search-bar >>> ic-text-field ic-menu li");
|
944
|
-
expect(menuOptions).toHaveLength(options.length);
|
945
|
-
});
|
946
|
-
it("should select the highlighted option when submit search is clicked", async () => {
|
947
|
-
const page = await newE2EPage();
|
948
|
-
await page.setContent(`<ic-search-bar label="Test Label"></ic-search-bar>`);
|
949
|
-
const searchBar = await page.find("ic-search-bar");
|
950
|
-
const searchSubmitButton = await page.find("ic-search-bar >>> ic-text-field ic-button.search-submit-button");
|
951
|
-
searchBar.setProperty("options", options);
|
952
|
-
await page.waitForChanges();
|
953
|
-
// Select first filtered option
|
954
|
-
await focusAndTypeIntoInput("ba", page);
|
955
|
-
await page.waitForChanges();
|
956
|
-
let menuOption = (await page.findAll("ic-search-bar >>> ic-text-field ic-menu li"))[0];
|
957
|
-
expect(menuOption).toHaveClass("focused-option");
|
958
|
-
expect(menuOption).toEqualText("bar");
|
959
|
-
await searchSubmitButton.click();
|
960
|
-
await page.waitForChanges();
|
961
|
-
expect(await searchBar.getProperty("value")).toBe("bar");
|
962
|
-
// Select second filtered option
|
963
|
-
const clearButton = await page.find("ic-search-bar >>> ic-text-field ic-button.clear-button");
|
964
|
-
await clearButton.click();
|
965
|
-
await page.waitForChanges();
|
966
|
-
await focusAndTypeIntoInput("ba", page);
|
967
|
-
await page.waitForChanges();
|
968
|
-
await page.keyboard.press("ArrowUp");
|
969
|
-
await page.waitForChanges();
|
970
|
-
menuOption = (await page.findAll("ic-search-bar >>> ic-text-field ic-menu li"))[1];
|
971
|
-
expect(menuOption).toHaveClass("focused-option");
|
972
|
-
expect(menuOption).toEqualText("baz");
|
973
|
-
await searchSubmitButton.click();
|
974
|
-
await page.waitForChanges();
|
975
|
-
expect(await searchBar.getProperty("value")).toBe("qux");
|
976
|
-
});
|
977
|
-
it("should display the loading option in the menu when loading then cancel loading when options provided", async () => {
|
978
|
-
const page = await newE2EPage();
|
979
|
-
await page.setContent(`<ic-search-bar label="Test Label" loading-label="load" disable-filter="true"></ic-search-bar>`);
|
980
|
-
const searchBar = await page.find("ic-search-bar");
|
981
|
-
searchBar.setProperty("options", options);
|
982
|
-
await page.waitForChanges();
|
983
|
-
await focusAndTypeIntoInput("ba", page);
|
984
|
-
searchBar.setProperty("loading", true);
|
985
|
-
await page.waitForChanges();
|
986
|
-
let menuOptions = await page.findAll("ic-search-bar >>> ic-text-field ic-menu li");
|
987
|
-
expect(menuOptions).toHaveLength(1);
|
988
|
-
expect(menuOptions[0]).toHaveClass("loading-option");
|
989
|
-
expect(menuOptions[0]).toEqualText("load");
|
990
|
-
searchBar.setProperty("options", options);
|
991
|
-
await page.waitForChanges();
|
992
|
-
menuOptions = await page.findAll("ic-search-bar >>> ic-text-field ic-menu li");
|
993
|
-
expect(menuOptions).toHaveLength(3);
|
994
|
-
expect(menuOptions[0]).not.toHaveClass("loading-option");
|
995
|
-
expect(searchBar.getProperty("loading")).toBeFalsy;
|
996
|
-
});
|
997
|
-
it("should display the timeout state in the menu when timed out and should not update the options", async () => {
|
998
|
-
const page = await newE2EPage();
|
999
|
-
await page.setContent(`<ic-search-bar label="Test Label" loading-error-label="error message" timeout="1000" disable-filter="true"></ic-search-bar>`);
|
1000
|
-
const searchBar = await page.find("ic-search-bar");
|
1001
|
-
searchBar.setProperty("options", options);
|
1002
|
-
await page.waitForChanges();
|
1003
|
-
await focusAndTypeIntoInput("ba", page);
|
1004
|
-
searchBar.setProperty("loading", true);
|
1005
|
-
await page.waitForChanges();
|
1006
|
-
await page.waitForTimeout(1000);
|
1007
|
-
const menuOptions = await page.findAll("ic-search-bar >>> ic-text-field ic-menu li");
|
1008
|
-
expect(menuOptions).toHaveLength(1);
|
1009
|
-
expect(menuOptions[0]).toHaveClass("timeout");
|
1010
|
-
expect(await menuOptions[0].find("ic-typography")).toEqualText("error message");
|
1011
|
-
expect(await menuOptions[0].find("#retry-button")).not.toBeNull;
|
1012
|
-
const searchSubmitButton = await page.find("ic-search-bar >>> ic-text-field ic-button.search-submit-button");
|
1013
|
-
expect(await searchSubmitButton.getProperty("disabled")).toBeTruthy;
|
1014
|
-
searchBar.setProperty("options", options);
|
1015
|
-
await page.waitForChanges();
|
1016
|
-
expect(menuOptions).toHaveLength(1);
|
1017
|
-
expect(menuOptions[0]).toHaveClass("timeout");
|
1018
|
-
});
|
1019
|
-
it("should be able to focus retry button using tab and should keep loading state when menu closed", async () => {
|
1020
|
-
const page = await newE2EPage();
|
1021
|
-
await page.setContent(`<ic-search-bar label="Test Label" timeout="1000" disable-filter="true"></ic-search-bar>`);
|
1022
|
-
const searchBar = await page.find("ic-search-bar");
|
1023
|
-
searchBar.setProperty("options", options);
|
1024
|
-
await page.waitForChanges();
|
1025
|
-
await focusAndTypeIntoInput("ba", page);
|
1026
|
-
searchBar.setProperty("loading", true);
|
1027
|
-
await page.waitForChanges();
|
1028
|
-
await page.waitForTimeout(1000);
|
1029
|
-
await page.keyboard.press("Tab");
|
1030
|
-
await page.keyboard.press("Tab");
|
1031
|
-
await page.waitForChanges();
|
1032
|
-
const activeElId = await page.$eval("ic-search-bar", (el) => el.shadowRoot.activeElement.id);
|
1033
|
-
expect(activeElId).toBe("retry-button");
|
1034
|
-
await page.keyboard.press("Tab");
|
1035
|
-
await page.waitForChanges();
|
1036
|
-
let menu = await page.find("ic-search-bar >>> ic-text-field ic-menu");
|
1037
|
-
expect(menu).toBeNull;
|
1038
|
-
await page.keyboard.down("Shift");
|
1039
|
-
await page.keyboard.press("Tab");
|
1040
|
-
await page.waitForChanges();
|
1041
|
-
menu = await page.find("ic-search-bar >>> ic-text-field ic-menu");
|
1042
|
-
expect(await menu.isVisible()).toBeTruthy;
|
1043
|
-
expect(await menu.findAll("li")).toHaveLength(1);
|
1044
|
-
});
|
1045
|
-
it("should trigger a retry when the retry button is pressed using space and enter", async () => {
|
1046
|
-
const page = await newE2EPage();
|
1047
|
-
await page.setContent(`<ic-search-bar label="Test Label" timeout="1000" disable-filter="true"></ic-search-bar>`);
|
1048
|
-
const searchBar = await page.find("ic-search-bar");
|
1049
|
-
searchBar.setProperty("options", options);
|
1050
|
-
await page.waitForChanges();
|
1051
|
-
await focusAndTypeIntoInput("ba", page);
|
1052
|
-
searchBar.setProperty("loading", true);
|
1053
|
-
await page.waitForChanges();
|
1054
|
-
await page.waitForTimeout(1000);
|
1055
|
-
await page.keyboard.press("Tab");
|
1056
|
-
await page.keyboard.press("Tab");
|
1057
|
-
await page.waitForChanges();
|
1058
|
-
const retryButton = await page.find("ic-search-bar >>> ic-text-field ic-menu #retry-button");
|
1059
|
-
await retryButton.press("Enter");
|
1060
|
-
await page.waitForChanges();
|
1061
|
-
let menuOptions = await page.findAll("ic-search-bar >>> ic-text-field ic-menu li");
|
1062
|
-
expect(menuOptions[0]).toEqualText("Loading...");
|
1063
|
-
await page.waitForTimeout(1000);
|
1064
|
-
await page.keyboard.press("Tab");
|
1065
|
-
await page.keyboard.press("Tab");
|
1066
|
-
await page.waitForChanges();
|
1067
|
-
await retryButton.press(" ");
|
1068
|
-
await page.waitForChanges();
|
1069
|
-
menuOptions = await page.findAll("ic-search-bar >>> ic-text-field ic-menu li");
|
1070
|
-
expect(menuOptions[0]).toEqualText("Loading...");
|
1071
|
-
});
|
1072
|
-
it("should cancel loading when clear button is pressed", async () => {
|
1073
|
-
const page = await newE2EPage();
|
1074
|
-
await page.setContent(`<ic-search-bar label="Test Label" timeout="1000"></ic-search-bar>`);
|
1075
|
-
const searchBar = await page.find("ic-search-bar");
|
1076
|
-
searchBar.setProperty("options", options);
|
1077
|
-
await page.waitForChanges();
|
1078
|
-
await focusAndTypeIntoInput("ba", page);
|
1079
|
-
searchBar.setProperty("loading", true);
|
1080
|
-
await page.waitForChanges();
|
1081
|
-
await page.waitForTimeout(1000);
|
1082
|
-
const clearButton = await page.find("ic-search-bar >>> ic-text-field .clear-button");
|
1083
|
-
await clearButton.click();
|
1084
|
-
await page.waitForChanges();
|
1085
|
-
await focusAndTypeIntoInput("ba", page);
|
1086
|
-
searchBar.setProperty("loading", true);
|
1087
|
-
await page.waitForChanges();
|
1088
|
-
await page.waitForTimeout(750);
|
1089
|
-
let menuOption = await page.find("ic-search-bar >>> ic-text-field ic-menu li");
|
1090
|
-
expect(menuOption).toEqualText("Loading...");
|
1091
|
-
await clearButton.click();
|
1092
|
-
await page.waitForChanges();
|
1093
|
-
//Check that the timeout was cancelled
|
1094
|
-
await page.waitForTimeout(1000);
|
1095
|
-
await searchBar.click();
|
1096
|
-
await page.waitForChanges();
|
1097
|
-
expect(await page.find("ic-search-bar >>> ic-text-field ic-menu")).toBeNull;
|
1098
|
-
await focusAndTypeIntoInput("ba", page);
|
1099
|
-
searchBar.setProperty("loading", true);
|
1100
|
-
await page.waitForChanges();
|
1101
|
-
await page.waitForTimeout(750);
|
1102
|
-
menuOption = await page.find("ic-search-bar >>> ic-text-field ic-menu li");
|
1103
|
-
expect(menuOption).toEqualText("Loading...");
|
1104
|
-
});
|
1105
|
-
});
|
1106
|
-
//# sourceMappingURL=ic-search-bar.e2e.js.map
|