@elastic/eui-test-helpers 1.1.0-snapshot.1783939453438
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/LICENSE.txt +6 -0
- package/README.md +56 -0
- package/lib/cjs/components/combo_box/selectors.d.ts +72 -0
- package/lib/cjs/components/combo_box/selectors.js +86 -0
- package/lib/cjs/index.d.ts +2 -0
- package/lib/cjs/index.js +19 -0
- package/lib/cjs/playwright/base_object.d.ts +31 -0
- package/lib/cjs/playwright/base_object.js +50 -0
- package/lib/cjs/playwright/components/combo_box/object.d.ts +88 -0
- package/lib/cjs/playwright/components/combo_box/object.js +220 -0
- package/lib/cjs/selectors.d.ts +1 -0
- package/lib/cjs/selectors.js +12 -0
- package/lib/cjs/storybook.d.ts +7 -0
- package/lib/cjs/storybook.js +22 -0
- package/lib/esm/components/combo_box/selectors.d.ts +72 -0
- package/lib/esm/components/combo_box/selectors.js +80 -0
- package/lib/esm/components/combo_box/selectors.js.map +1 -0
- package/lib/esm/index.d.ts +2 -0
- package/lib/esm/index.js +10 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/playwright/base_object.d.ts +31 -0
- package/lib/esm/playwright/base_object.js +30 -0
- package/lib/esm/playwright/base_object.js.map +1 -0
- package/lib/esm/playwright/components/combo_box/object.d.ts +88 -0
- package/lib/esm/playwright/components/combo_box/object.js +210 -0
- package/lib/esm/playwright/components/combo_box/object.js.map +1 -0
- package/lib/esm/selectors.d.ts +1 -0
- package/lib/esm/selectors.js +9 -0
- package/lib/esm/selectors.js.map +1 -0
- package/lib/esm/storybook.d.ts +7 -0
- package/lib/esm/storybook.js +15 -0
- package/lib/esm/storybook.js.map +1 -0
- package/licenses/ELASTIC-LICENSE-2.0.md +93 -0
- package/licenses/SSPL-LICENSE.md +557 -0
- package/package.json +62 -0
- package/src/components/combo_box/README.md +29 -0
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elastic/eui-test-helpers",
|
|
3
|
+
"version": "1.1.0-snapshot.1783939453438",
|
|
4
|
+
"description": "A library of EUI test helpers for RTL, Cypress and Scout",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/elastic/eui.git",
|
|
9
|
+
"directory": "packages/test-helpers"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/elastic/eui/blob/main/packages/test-helpers",
|
|
12
|
+
"main": "lib/cjs/index.js",
|
|
13
|
+
"module": "lib/esm/index.js",
|
|
14
|
+
"types": "lib/cjs/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./lib/cjs/index.d.ts",
|
|
18
|
+
"import": "./lib/esm/index.js",
|
|
19
|
+
"require": "./lib/cjs/index.js",
|
|
20
|
+
"default": "./lib/cjs/index.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"lint": "tsc --noEmit",
|
|
25
|
+
"test": "yarn lint && yarn test-e2e",
|
|
26
|
+
"test-e2e": "playwright test",
|
|
27
|
+
"show-report": "playwright show-report",
|
|
28
|
+
"build": "yarn build:clean && yarn build:compile && yarn build:compile:esm && yarn build:types",
|
|
29
|
+
"build:clean": "rimraf lib/",
|
|
30
|
+
"build:compile": "NODE_ENV=production babel src --out-dir=lib/cjs --extensions .ts --ignore \"**/*.spec.ts\"",
|
|
31
|
+
"build:compile:esm": "tsc --project ./tsconfig.esm.json",
|
|
32
|
+
"build:types": "NODE_ENV=production tsc --project tsconfig.types.json"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"@playwright/test": "^1.50.0"
|
|
36
|
+
},
|
|
37
|
+
"peerDependenciesMeta": {
|
|
38
|
+
"@playwright/test": {
|
|
39
|
+
"optional": true
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@babel/cli": "^7.26.4",
|
|
44
|
+
"@babel/core": "^7.26.9",
|
|
45
|
+
"@babel/preset-env": "^7.26.9",
|
|
46
|
+
"@babel/preset-typescript": "^7.26.0",
|
|
47
|
+
"@playwright/test": "1.59.1",
|
|
48
|
+
"http-server": "^14.1.1",
|
|
49
|
+
"rimraf": "^6.0.1",
|
|
50
|
+
"typescript": "^5.7.3"
|
|
51
|
+
},
|
|
52
|
+
"files": [
|
|
53
|
+
"lib",
|
|
54
|
+
"!**/*.tsbuildinfo",
|
|
55
|
+
"!**/*.spec.js",
|
|
56
|
+
"!**/*.spec.d.ts",
|
|
57
|
+
"!**/*.spec.js.map",
|
|
58
|
+
"README.md",
|
|
59
|
+
"licenses"
|
|
60
|
+
],
|
|
61
|
+
"stableVersion": "1.1.0"
|
|
62
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# EuiComboBoxObject
|
|
2
|
+
|
|
3
|
+
Playwright Component Object for [EuiComboBox](https://eui.elastic.co/docs/components/forms/selection/combo-box/).
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { EuiComboBoxObject } from '@elastic/eui-test-helpers';
|
|
9
|
+
|
|
10
|
+
const comboBox = new EuiComboBoxObject(page, 'myComboBox');
|
|
11
|
+
await comboBox.setSelectedOptions(['Option A', 'Option B']);
|
|
12
|
+
expect(await comboBox.getSelectedOptions()).toEqual(['Option A', 'Option B']);
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Set `data-test-subj` on the outer `<EuiComboBox>` wrapper (`.euiComboBox`), not on the inner `comboBoxInput`.
|
|
16
|
+
|
|
17
|
+
## API
|
|
18
|
+
|
|
19
|
+
EuiComboBox has two selection modes that affect how the methods behave:
|
|
20
|
+
|
|
21
|
+
- **Pill mode** — `singleSelection={false}` (default) or `singleSelection={true}`: selected options render as pill elements.
|
|
22
|
+
- **Plain-text mode** — `singleSelection={{ asPlainText: true }}`: the selected option's label appears directly in the search input.
|
|
23
|
+
|
|
24
|
+
| Method | Description |
|
|
25
|
+
|---|---|
|
|
26
|
+
| `getSelectedOptions()` | Returns selected options as `string[]` of labels. |
|
|
27
|
+
| `setSelectedOptions(labels)` | Accepts an array of label strings. Replaces any existing selection. No-op if already matching. |
|
|
28
|
+
| `clear()` | Clears all selected options. No-op if nothing is selected. |
|
|
29
|
+
|