@ebertjendustries/cstestwrapper 1.0.27 → 1.0.29
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.
- package/dist/index.d.mts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +23 -16
- package/dist/index.mjs +23 -16
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -4,7 +4,6 @@ import { MultiselectWrapper, SelectWrapper, InputWrapper, DatePickerWrapper, Tab
|
|
|
4
4
|
import { ElementWrapper, ComponentWrapper } from '@cloudscape-design/test-utils-core/dom';
|
|
5
5
|
import DropdownHostComponentWrapper from '@cloudscape-design/components/test-utils/dom/internal/dropdown-host';
|
|
6
6
|
import * as vitest from 'vitest';
|
|
7
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
7
|
import React from 'react';
|
|
9
8
|
|
|
10
9
|
/**
|
|
@@ -30,8 +29,10 @@ declare class AbstractSelectTesting<SelectWrapperType extends DropdownHostCompon
|
|
|
30
29
|
*/
|
|
31
30
|
expectEntries(entries: string[], selectedIndices: number[]): Promise<void>;
|
|
32
31
|
expectEnumEntries<E extends Object>(enumFactory: EnumFactory<E>, selectedEnums: E[], except?: E[]): Promise<void>;
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
selectOrDeselectByIndices(clickedIndices: number[]): Promise<void>;
|
|
33
|
+
selectOrDeselectEnum<E extends Object>(enumFactory: EnumFactory<E>, selectedEntry: E): Promise<void>;
|
|
34
|
+
multiselectEnums<E extends Object>(enumFactory: EnumFactory<E>, selectedEntries: E[]): Promise<void>;
|
|
35
|
+
multiselect(entries: string[]): Promise<void>;
|
|
35
36
|
openDropdown(): Promise<SelectWrapperType>;
|
|
36
37
|
closeDropdown(selectWrapper: DropdownHostComponentWrapper): Promise<void>;
|
|
37
38
|
awaitHasSelectedEntryCount(selectedEntryCount: number, totalEntryCount: number): Promise<void>;
|
|
@@ -551,6 +552,6 @@ declare class ViewTestWrapperProps<T> {
|
|
|
551
552
|
initialValue: T;
|
|
552
553
|
view: (value: T, onChange: PropertyChangeFunction) => React.ReactNode;
|
|
553
554
|
}
|
|
554
|
-
declare function ViewTestWrapper<T>(props: ViewTestWrapperProps<T>):
|
|
555
|
+
declare function ViewTestWrapper<T>(props: ViewTestWrapperProps<T>): React.JSX.Element;
|
|
555
556
|
|
|
556
557
|
export { AbstractComponentTesting, AbstractInputTesting, AbstractSelectTesting, AbstractViewTesting, AlertTesting, BoxTesting, ButtonDropdownTesting, ButtonTesting, CSVNoItemsViewTesting, CSVPriceInputViewTesting, CSVSearchFilterViewTesting, CSVTextPromptModalViewTesting, CardsTesting, CheckboxTesting, CollectionPreferencesSetting, CollectionPreferencesTesting, CopyToClipboardTesting, DatePickerTesting, FlashbarTesting, FormTesting, HeaderTesting, IconTesting, LinkTesting, MockBrowserAPIs, MockRestClient, ModalTesting, MultiselectTesting, NumberInputTesting, PaginationTesting, ProgressBarTesting, RatingTesting, SegmentedControlTesting, SelectTesting, StatusIndicatorTesting, StringInputTesting, TableTesting, TabsTesting, TestLocalisation, TestingFactory, TextContentTesting, TextFilterTesting, TextareaTesting, ToggleTesting, ViewTestWrapper, WizardTesting, setupRestClientMock };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { MultiselectWrapper, SelectWrapper, InputWrapper, DatePickerWrapper, Tab
|
|
|
4
4
|
import { ElementWrapper, ComponentWrapper } from '@cloudscape-design/test-utils-core/dom';
|
|
5
5
|
import DropdownHostComponentWrapper from '@cloudscape-design/components/test-utils/dom/internal/dropdown-host';
|
|
6
6
|
import * as vitest from 'vitest';
|
|
7
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
7
|
import React from 'react';
|
|
9
8
|
|
|
10
9
|
/**
|
|
@@ -30,8 +29,10 @@ declare class AbstractSelectTesting<SelectWrapperType extends DropdownHostCompon
|
|
|
30
29
|
*/
|
|
31
30
|
expectEntries(entries: string[], selectedIndices: number[]): Promise<void>;
|
|
32
31
|
expectEnumEntries<E extends Object>(enumFactory: EnumFactory<E>, selectedEnums: E[], except?: E[]): Promise<void>;
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
selectOrDeselectByIndices(clickedIndices: number[]): Promise<void>;
|
|
33
|
+
selectOrDeselectEnum<E extends Object>(enumFactory: EnumFactory<E>, selectedEntry: E): Promise<void>;
|
|
34
|
+
multiselectEnums<E extends Object>(enumFactory: EnumFactory<E>, selectedEntries: E[]): Promise<void>;
|
|
35
|
+
multiselect(entries: string[]): Promise<void>;
|
|
35
36
|
openDropdown(): Promise<SelectWrapperType>;
|
|
36
37
|
closeDropdown(selectWrapper: DropdownHostComponentWrapper): Promise<void>;
|
|
37
38
|
awaitHasSelectedEntryCount(selectedEntryCount: number, totalEntryCount: number): Promise<void>;
|
|
@@ -551,6 +552,6 @@ declare class ViewTestWrapperProps<T> {
|
|
|
551
552
|
initialValue: T;
|
|
552
553
|
view: (value: T, onChange: PropertyChangeFunction) => React.ReactNode;
|
|
553
554
|
}
|
|
554
|
-
declare function ViewTestWrapper<T>(props: ViewTestWrapperProps<T>):
|
|
555
|
+
declare function ViewTestWrapper<T>(props: ViewTestWrapperProps<T>): React.JSX.Element;
|
|
555
556
|
|
|
556
557
|
export { AbstractComponentTesting, AbstractInputTesting, AbstractSelectTesting, AbstractViewTesting, AlertTesting, BoxTesting, ButtonDropdownTesting, ButtonTesting, CSVNoItemsViewTesting, CSVPriceInputViewTesting, CSVSearchFilterViewTesting, CSVTextPromptModalViewTesting, CardsTesting, CheckboxTesting, CollectionPreferencesSetting, CollectionPreferencesTesting, CopyToClipboardTesting, DatePickerTesting, FlashbarTesting, FormTesting, HeaderTesting, IconTesting, LinkTesting, MockBrowserAPIs, MockRestClient, ModalTesting, MultiselectTesting, NumberInputTesting, PaginationTesting, ProgressBarTesting, RatingTesting, SegmentedControlTesting, SelectTesting, StatusIndicatorTesting, StringInputTesting, TableTesting, TabsTesting, TestLocalisation, TestingFactory, TextContentTesting, TextFilterTesting, TextareaTesting, ToggleTesting, ViewTestWrapper, WizardTesting, setupRestClientMock };
|
package/dist/index.js
CHANGED
|
@@ -288,7 +288,7 @@ var AbstractSelectTesting = class extends AbstractComponentTesting {
|
|
|
288
288
|
const selectedOptionsText = selectedOptions.map((selectedOption) => selectedOption.findLabel().getElement().textContent);
|
|
289
289
|
console.log(`CURRENTLY selected options = ${selectedOptionsText}, EXPECTED selected options = ${selectedEntries}`);
|
|
290
290
|
const indexDiff = selectedEntries.length === totalEntryCount ? 1 : 0;
|
|
291
|
-
(0, import_vitest3.expect)(selectedOptions, this.msgForExpect()).toHaveLength(selectedEntries.length + indexDiff);
|
|
291
|
+
(0, import_vitest3.expect)(selectedOptions, this.msgForExpect(void 0, "expectSelectedEntries - toHaveLength")).toHaveLength(selectedEntries.length + indexDiff);
|
|
292
292
|
const selectedEntriesSet = /* @__PURE__ */ new Set();
|
|
293
293
|
selectedEntries.forEach((entry) => selectedEntriesSet.add(entry));
|
|
294
294
|
for (let index = indexDiff; index < selectedOptionsText.length; index++) {
|
|
@@ -297,7 +297,7 @@ var AbstractSelectTesting = class extends AbstractComponentTesting {
|
|
|
297
297
|
if (!hasElement) {
|
|
298
298
|
console.log(`Expected element at index ${index} to be selected: ${selectedOption}.`);
|
|
299
299
|
}
|
|
300
|
-
(0, import_vitest3.expect)(hasElement, this.msgForExpect(index)).toBeTruthy();
|
|
300
|
+
(0, import_vitest3.expect)(hasElement, this.msgForExpect(index, "expectSelectedEntries - hasElement toBeTruthy")).toBeTruthy();
|
|
301
301
|
}
|
|
302
302
|
await this.closeDropdown(selectWrapper);
|
|
303
303
|
}
|
|
@@ -312,16 +312,16 @@ var AbstractSelectTesting = class extends AbstractComponentTesting {
|
|
|
312
312
|
*/
|
|
313
313
|
async expectEntries(entries, selectedIndices) {
|
|
314
314
|
selectedIndices = selectedIndices.sort((a, b) => a - b);
|
|
315
|
-
(0, import_vitest3.expect)(await this.awaitElement(), this.msgForExpect()).toBeInTheDocument();
|
|
315
|
+
(0, import_vitest3.expect)(await this.awaitElement(), this.msgForExpect(void 0, "expectEntries - toBeInTheDocument")).toBeInTheDocument();
|
|
316
316
|
const selectWrapper = await this.openDropdown();
|
|
317
317
|
const options = this.getDropdown(selectWrapper).findOptions();
|
|
318
|
-
(0, import_vitest3.expect)(options, this.msgForExpect()).toHaveLength(entries.length);
|
|
318
|
+
(0, import_vitest3.expect)(options, this.msgForExpect(void 0, "expectEntries - toHaveLength")).toHaveLength(entries.length);
|
|
319
319
|
const selectedOptions = this.getDropdown(selectWrapper).findSelectedOptions();
|
|
320
320
|
const indexDiff = entries.length === selectedIndices.length ? 1 : 0;
|
|
321
|
-
(0, import_vitest3.expect)(selectedOptions, this.msgForExpect()).toHaveLength(selectedIndices.length + indexDiff);
|
|
321
|
+
(0, import_vitest3.expect)(selectedOptions, this.msgForExpect(void 0, "expectEntries - selectedOptions toHaveLength")).toHaveLength(selectedIndices.length + indexDiff);
|
|
322
322
|
for (let index = indexDiff; index < selectedOptions.length; index++) {
|
|
323
323
|
const selectedOption = selectedOptions[index];
|
|
324
|
-
(0, import_vitest3.expect)(selectedOption.findLabel().getElement().textContent, this.msgForExpect(index)).toBe(entries[selectedIndices[index - indexDiff]]);
|
|
324
|
+
(0, import_vitest3.expect)(selectedOption.findLabel().getElement().textContent, this.msgForExpect(index, "expectEntries - to have label")).toBe(entries[selectedIndices[index - indexDiff]]);
|
|
325
325
|
}
|
|
326
326
|
await this.closeDropdown(selectWrapper);
|
|
327
327
|
}
|
|
@@ -334,8 +334,8 @@ var AbstractSelectTesting = class extends AbstractComponentTesting {
|
|
|
334
334
|
selectedOptionIndices
|
|
335
335
|
);
|
|
336
336
|
}
|
|
337
|
-
async
|
|
338
|
-
(0, import_vitest3.expect)(await this.awaitElement(), this.msgForExpect()).toBeInTheDocument();
|
|
337
|
+
async selectOrDeselectByIndices(clickedIndices) {
|
|
338
|
+
(0, import_vitest3.expect)(await this.awaitElement(), this.msgForExpect(void 0, "selectOrDeselect - toBeInTheDocument")).toBeInTheDocument();
|
|
339
339
|
const sortedIndices = clickedIndices.sort((a, b) => b - a);
|
|
340
340
|
const selectWrapper = await this.openDropdown();
|
|
341
341
|
for (let index = 0; index < sortedIndices.length; index++) {
|
|
@@ -344,8 +344,15 @@ var AbstractSelectTesting = class extends AbstractComponentTesting {
|
|
|
344
344
|
}
|
|
345
345
|
await this.closeDropdown(selectWrapper);
|
|
346
346
|
}
|
|
347
|
+
async selectOrDeselectEnum(enumFactory, selectedEntry) {
|
|
348
|
+
await this.selectOrDeselectByIndices([enumFactory.getEnumIndex(selectedEntry)]);
|
|
349
|
+
}
|
|
350
|
+
async multiselectEnums(enumFactory, selectedEntries) {
|
|
351
|
+
const localiser = this.view.getLocaliser();
|
|
352
|
+
await this.multiselect(selectedEntries.map((entry) => localiser.getEnumLabel(enumFactory, entry)));
|
|
353
|
+
}
|
|
347
354
|
// ATTENTION! Do NOT use with enum single select! It will lead to failing tests as it does not change selection.
|
|
348
|
-
async
|
|
355
|
+
async multiselect(entries) {
|
|
349
356
|
console.log("SELECTING options = " + entries);
|
|
350
357
|
const indicesToSelect = [];
|
|
351
358
|
const indicesToDeselect = [];
|
|
@@ -363,29 +370,29 @@ var AbstractSelectTesting = class extends AbstractComponentTesting {
|
|
|
363
370
|
indicesToDeselect.push(index);
|
|
364
371
|
}
|
|
365
372
|
}
|
|
366
|
-
await this.
|
|
367
|
-
await this.
|
|
373
|
+
await this.selectOrDeselectByIndices(indicesToSelect);
|
|
374
|
+
await this.selectOrDeselectByIndices(indicesToDeselect);
|
|
368
375
|
await this.closeDropdown(await this.openDropdown());
|
|
369
376
|
}
|
|
370
377
|
async openDropdown() {
|
|
371
378
|
const selectWrapper = this.getElementWrapper();
|
|
372
379
|
(0, import_react5.act)(() => selectWrapper.openDropdown());
|
|
373
|
-
await (0, import_react4.waitFor)(() => (0, import_vitest3.expect)(this.getDropdown(selectWrapper).findOptions().length, this.msgForExpect()).toBeGreaterThan(0));
|
|
380
|
+
await (0, import_react4.waitFor)(() => (0, import_vitest3.expect)(this.getDropdown(selectWrapper).findOptions().length, this.msgForExpect(void 0, "openDropdown - wait till options are present")).toBeGreaterThan(0));
|
|
374
381
|
return selectWrapper;
|
|
375
382
|
}
|
|
376
383
|
async closeDropdown(selectWrapper) {
|
|
377
384
|
(0, import_react5.act)(() => selectWrapper.closeDropdown(this.getOptions()));
|
|
378
385
|
if (!this.expandToViewport) {
|
|
379
|
-
await (0, import_react4.waitFor)(() => (0, import_vitest3.expect)(this.getDropdown(selectWrapper).findOptions().length, this.msgForExpect()).toBe(0));
|
|
386
|
+
await (0, import_react4.waitFor)(() => (0, import_vitest3.expect)(this.getDropdown(selectWrapper).findOptions().length, this.msgForExpect(void 0, "closeDropdown - wait till options are gone")).toBe(0));
|
|
380
387
|
}
|
|
381
388
|
}
|
|
382
389
|
async awaitHasSelectedEntryCount(selectedEntryCount, totalEntryCount) {
|
|
383
390
|
const selectWrapper = await this.openDropdown();
|
|
384
391
|
const options = this.getDropdown(selectWrapper).findSelectedOptions();
|
|
385
392
|
if (selectedEntryCount === totalEntryCount) {
|
|
386
|
-
(0, import_vitest3.expect)(options, this.msgForExpect()).toHaveLength(selectedEntryCount + 1);
|
|
393
|
+
(0, import_vitest3.expect)(options, this.msgForExpect(void 0, "awaitHasSelectedEntryCount - all selected")).toHaveLength(selectedEntryCount + 1);
|
|
387
394
|
} else {
|
|
388
|
-
(0, import_vitest3.expect)(options, this.msgForExpect()).toHaveLength(selectedEntryCount);
|
|
395
|
+
(0, import_vitest3.expect)(options, this.msgForExpect(void 0, "awaitHasSelectedEntryCount - specific items selected")).toHaveLength(selectedEntryCount);
|
|
389
396
|
}
|
|
390
397
|
await this.closeDropdown(selectWrapper);
|
|
391
398
|
}
|
|
@@ -1530,7 +1537,7 @@ var CSVPriceInputViewTesting = class extends AbstractViewTesting {
|
|
|
1530
1537
|
const priceX = price.priceInCents / 100;
|
|
1531
1538
|
this.csvPriceInputView.elements.amountInput.setStringValue(priceX.toString());
|
|
1532
1539
|
}
|
|
1533
|
-
await this.csvPriceInputView.elements.currencyInput.
|
|
1540
|
+
await this.csvPriceInputView.elements.currencyInput.selectOrDeselectByIndices([this.currencyFactory.getEnumIndex(price.currency)]);
|
|
1534
1541
|
}
|
|
1535
1542
|
async expectPrice(price) {
|
|
1536
1543
|
if (isNaN(price.priceInCents)) {
|
package/dist/index.mjs
CHANGED
|
@@ -207,7 +207,7 @@ var AbstractSelectTesting = class extends AbstractComponentTesting {
|
|
|
207
207
|
const selectedOptionsText = selectedOptions.map((selectedOption) => selectedOption.findLabel().getElement().textContent);
|
|
208
208
|
console.log(`CURRENTLY selected options = ${selectedOptionsText}, EXPECTED selected options = ${selectedEntries}`);
|
|
209
209
|
const indexDiff = selectedEntries.length === totalEntryCount ? 1 : 0;
|
|
210
|
-
expect3(selectedOptions, this.msgForExpect()).toHaveLength(selectedEntries.length + indexDiff);
|
|
210
|
+
expect3(selectedOptions, this.msgForExpect(void 0, "expectSelectedEntries - toHaveLength")).toHaveLength(selectedEntries.length + indexDiff);
|
|
211
211
|
const selectedEntriesSet = /* @__PURE__ */ new Set();
|
|
212
212
|
selectedEntries.forEach((entry) => selectedEntriesSet.add(entry));
|
|
213
213
|
for (let index = indexDiff; index < selectedOptionsText.length; index++) {
|
|
@@ -216,7 +216,7 @@ var AbstractSelectTesting = class extends AbstractComponentTesting {
|
|
|
216
216
|
if (!hasElement) {
|
|
217
217
|
console.log(`Expected element at index ${index} to be selected: ${selectedOption}.`);
|
|
218
218
|
}
|
|
219
|
-
expect3(hasElement, this.msgForExpect(index)).toBeTruthy();
|
|
219
|
+
expect3(hasElement, this.msgForExpect(index, "expectSelectedEntries - hasElement toBeTruthy")).toBeTruthy();
|
|
220
220
|
}
|
|
221
221
|
await this.closeDropdown(selectWrapper);
|
|
222
222
|
}
|
|
@@ -231,16 +231,16 @@ var AbstractSelectTesting = class extends AbstractComponentTesting {
|
|
|
231
231
|
*/
|
|
232
232
|
async expectEntries(entries, selectedIndices) {
|
|
233
233
|
selectedIndices = selectedIndices.sort((a, b) => a - b);
|
|
234
|
-
expect3(await this.awaitElement(), this.msgForExpect()).toBeInTheDocument();
|
|
234
|
+
expect3(await this.awaitElement(), this.msgForExpect(void 0, "expectEntries - toBeInTheDocument")).toBeInTheDocument();
|
|
235
235
|
const selectWrapper = await this.openDropdown();
|
|
236
236
|
const options = this.getDropdown(selectWrapper).findOptions();
|
|
237
|
-
expect3(options, this.msgForExpect()).toHaveLength(entries.length);
|
|
237
|
+
expect3(options, this.msgForExpect(void 0, "expectEntries - toHaveLength")).toHaveLength(entries.length);
|
|
238
238
|
const selectedOptions = this.getDropdown(selectWrapper).findSelectedOptions();
|
|
239
239
|
const indexDiff = entries.length === selectedIndices.length ? 1 : 0;
|
|
240
|
-
expect3(selectedOptions, this.msgForExpect()).toHaveLength(selectedIndices.length + indexDiff);
|
|
240
|
+
expect3(selectedOptions, this.msgForExpect(void 0, "expectEntries - selectedOptions toHaveLength")).toHaveLength(selectedIndices.length + indexDiff);
|
|
241
241
|
for (let index = indexDiff; index < selectedOptions.length; index++) {
|
|
242
242
|
const selectedOption = selectedOptions[index];
|
|
243
|
-
expect3(selectedOption.findLabel().getElement().textContent, this.msgForExpect(index)).toBe(entries[selectedIndices[index - indexDiff]]);
|
|
243
|
+
expect3(selectedOption.findLabel().getElement().textContent, this.msgForExpect(index, "expectEntries - to have label")).toBe(entries[selectedIndices[index - indexDiff]]);
|
|
244
244
|
}
|
|
245
245
|
await this.closeDropdown(selectWrapper);
|
|
246
246
|
}
|
|
@@ -253,8 +253,8 @@ var AbstractSelectTesting = class extends AbstractComponentTesting {
|
|
|
253
253
|
selectedOptionIndices
|
|
254
254
|
);
|
|
255
255
|
}
|
|
256
|
-
async
|
|
257
|
-
expect3(await this.awaitElement(), this.msgForExpect()).toBeInTheDocument();
|
|
256
|
+
async selectOrDeselectByIndices(clickedIndices) {
|
|
257
|
+
expect3(await this.awaitElement(), this.msgForExpect(void 0, "selectOrDeselect - toBeInTheDocument")).toBeInTheDocument();
|
|
258
258
|
const sortedIndices = clickedIndices.sort((a, b) => b - a);
|
|
259
259
|
const selectWrapper = await this.openDropdown();
|
|
260
260
|
for (let index = 0; index < sortedIndices.length; index++) {
|
|
@@ -263,8 +263,15 @@ var AbstractSelectTesting = class extends AbstractComponentTesting {
|
|
|
263
263
|
}
|
|
264
264
|
await this.closeDropdown(selectWrapper);
|
|
265
265
|
}
|
|
266
|
+
async selectOrDeselectEnum(enumFactory, selectedEntry) {
|
|
267
|
+
await this.selectOrDeselectByIndices([enumFactory.getEnumIndex(selectedEntry)]);
|
|
268
|
+
}
|
|
269
|
+
async multiselectEnums(enumFactory, selectedEntries) {
|
|
270
|
+
const localiser = this.view.getLocaliser();
|
|
271
|
+
await this.multiselect(selectedEntries.map((entry) => localiser.getEnumLabel(enumFactory, entry)));
|
|
272
|
+
}
|
|
266
273
|
// ATTENTION! Do NOT use with enum single select! It will lead to failing tests as it does not change selection.
|
|
267
|
-
async
|
|
274
|
+
async multiselect(entries) {
|
|
268
275
|
console.log("SELECTING options = " + entries);
|
|
269
276
|
const indicesToSelect = [];
|
|
270
277
|
const indicesToDeselect = [];
|
|
@@ -282,29 +289,29 @@ var AbstractSelectTesting = class extends AbstractComponentTesting {
|
|
|
282
289
|
indicesToDeselect.push(index);
|
|
283
290
|
}
|
|
284
291
|
}
|
|
285
|
-
await this.
|
|
286
|
-
await this.
|
|
292
|
+
await this.selectOrDeselectByIndices(indicesToSelect);
|
|
293
|
+
await this.selectOrDeselectByIndices(indicesToDeselect);
|
|
287
294
|
await this.closeDropdown(await this.openDropdown());
|
|
288
295
|
}
|
|
289
296
|
async openDropdown() {
|
|
290
297
|
const selectWrapper = this.getElementWrapper();
|
|
291
298
|
act2(() => selectWrapper.openDropdown());
|
|
292
|
-
await waitFor2(() => expect3(this.getDropdown(selectWrapper).findOptions().length, this.msgForExpect()).toBeGreaterThan(0));
|
|
299
|
+
await waitFor2(() => expect3(this.getDropdown(selectWrapper).findOptions().length, this.msgForExpect(void 0, "openDropdown - wait till options are present")).toBeGreaterThan(0));
|
|
293
300
|
return selectWrapper;
|
|
294
301
|
}
|
|
295
302
|
async closeDropdown(selectWrapper) {
|
|
296
303
|
act2(() => selectWrapper.closeDropdown(this.getOptions()));
|
|
297
304
|
if (!this.expandToViewport) {
|
|
298
|
-
await waitFor2(() => expect3(this.getDropdown(selectWrapper).findOptions().length, this.msgForExpect()).toBe(0));
|
|
305
|
+
await waitFor2(() => expect3(this.getDropdown(selectWrapper).findOptions().length, this.msgForExpect(void 0, "closeDropdown - wait till options are gone")).toBe(0));
|
|
299
306
|
}
|
|
300
307
|
}
|
|
301
308
|
async awaitHasSelectedEntryCount(selectedEntryCount, totalEntryCount) {
|
|
302
309
|
const selectWrapper = await this.openDropdown();
|
|
303
310
|
const options = this.getDropdown(selectWrapper).findSelectedOptions();
|
|
304
311
|
if (selectedEntryCount === totalEntryCount) {
|
|
305
|
-
expect3(options, this.msgForExpect()).toHaveLength(selectedEntryCount + 1);
|
|
312
|
+
expect3(options, this.msgForExpect(void 0, "awaitHasSelectedEntryCount - all selected")).toHaveLength(selectedEntryCount + 1);
|
|
306
313
|
} else {
|
|
307
|
-
expect3(options, this.msgForExpect()).toHaveLength(selectedEntryCount);
|
|
314
|
+
expect3(options, this.msgForExpect(void 0, "awaitHasSelectedEntryCount - specific items selected")).toHaveLength(selectedEntryCount);
|
|
308
315
|
}
|
|
309
316
|
await this.closeDropdown(selectWrapper);
|
|
310
317
|
}
|
|
@@ -1449,7 +1456,7 @@ var CSVPriceInputViewTesting = class extends AbstractViewTesting {
|
|
|
1449
1456
|
const priceX = price.priceInCents / 100;
|
|
1450
1457
|
this.csvPriceInputView.elements.amountInput.setStringValue(priceX.toString());
|
|
1451
1458
|
}
|
|
1452
|
-
await this.csvPriceInputView.elements.currencyInput.
|
|
1459
|
+
await this.csvPriceInputView.elements.currencyInput.selectOrDeselectByIndices([this.currencyFactory.getEnumIndex(price.currency)]);
|
|
1453
1460
|
}
|
|
1454
1461
|
async expectPrice(price) {
|
|
1455
1462
|
if (isNaN(price.priceInCents)) {
|