@dynatrace/strato-components-testing 1.18.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/jest/index.js +102 -3
- package/esm/jest/index.js.map +2 -2
- package/esm/jest/mocks/create-mock-element.js +81 -0
- package/esm/jest/mocks/create-mock-element.js.map +7 -0
- package/esm/jest/mocks/create-range-mock.js +28 -0
- package/esm/jest/mocks/create-range-mock.js.map +7 -0
- package/esm/jest/mocks/crypto-mock.js +20 -0
- package/esm/jest/mocks/crypto-mock.js.map +7 -0
- package/esm/jest/mocks/dom-rect-mock.js.map +2 -2
- package/esm/jest/mocks/element-from-point-mock.js +12 -0
- package/esm/jest/mocks/element-from-point-mock.js.map +7 -0
- package/esm/jest/mocks/fetch-mock.js +20 -0
- package/esm/jest/mocks/fetch-mock.js.map +7 -0
- package/esm/jest/mocks/framer-motion-mock.js +59 -0
- package/esm/jest/mocks/framer-motion-mock.js.map +7 -0
- package/esm/jest/mocks/intersection-observer-mock.js +40 -0
- package/esm/jest/mocks/intersection-observer-mock.js.map +7 -0
- package/esm/jest/mocks/match-media-mock.js +27 -0
- package/esm/jest/mocks/match-media-mock.js.map +7 -0
- package/esm/jest/mocks/offset-height-mock.js +21 -0
- package/esm/jest/mocks/offset-height-mock.js.map +7 -0
- package/esm/jest/mocks/offset-width-mock.js +21 -0
- package/esm/jest/mocks/offset-width-mock.js.map +7 -0
- package/esm/jest/mocks/pointer-event-mock.js +24 -0
- package/esm/jest/mocks/pointer-event-mock.js.map +7 -0
- package/esm/jest/mocks/screen-size-mock.js +16 -0
- package/esm/jest/mocks/screen-size-mock.js.map +7 -0
- package/esm/jest/mocks/scroll-into-view-mock.js +16 -0
- package/esm/jest/mocks/scroll-into-view-mock.js.map +7 -0
- package/esm/jest/mocks/streamdown.mock.js +8 -0
- package/esm/jest/mocks/streamdown.mock.js.map +7 -0
- package/esm/jest/mocks/table-virtualization-mock.js +87 -0
- package/esm/jest/mocks/table-virtualization-mock.js.map +7 -0
- package/esm/jest/mocks/virtualization-mock.js +155 -0
- package/esm/jest/mocks/virtualization-mock.js.map +7 -0
- package/esm/jest/preset/jest-preset.js +2 -1
- package/esm/jest/preset/jest-preset.js.map +2 -2
- package/esm/jest/setup/index.js +51 -0
- package/esm/jest/setup/index.js.map +2 -2
- package/esm/jest/testing-helpers/filters/filter-field.js +424 -0
- package/esm/jest/testing-helpers/filters/filter-field.js.map +7 -0
- package/esm/jest/testing-helpers/forms/base-input.js +32 -0
- package/esm/jest/testing-helpers/forms/base-input.js.map +7 -0
- package/esm/jest/testing-helpers/forms/password-input.js +29 -0
- package/esm/jest/testing-helpers/forms/password-input.js.map +7 -0
- package/esm/jest/testing-helpers/forms/search-input.js +27 -0
- package/esm/jest/testing-helpers/forms/search-input.js.map +7 -0
- package/esm/jest/testing-helpers/forms/select.js +131 -0
- package/esm/jest/testing-helpers/forms/select.js.map +7 -0
- package/esm/jest/testing-helpers/forms/text-input.js +24 -0
- package/esm/jest/testing-helpers/forms/text-input.js.map +7 -0
- package/esm/jest/testing-helpers/tables/datatable.js +794 -0
- package/esm/jest/testing-helpers/tables/datatable.js.map +7 -0
- package/esm/jest/testing-helpers/utils/isFakeTimersEnabled.js +9 -0
- package/esm/jest/testing-helpers/utils/isFakeTimersEnabled.js.map +7 -0
- package/esm/jest/testing-helpers/utils/setup-user-event.js +15 -0
- package/esm/jest/testing-helpers/utils/setup-user-event.js.map +7 -0
- package/jest/index.d.ts +22 -1
- package/jest/index.js +54 -3
- package/jest/mocks/create-mock-element.d.ts +15 -0
- package/jest/mocks/create-mock-element.js +99 -0
- package/jest/mocks/create-range-mock.d.ts +11 -0
- package/jest/mocks/create-range-mock.js +46 -0
- package/jest/mocks/crypto-mock.d.ts +12 -0
- package/jest/mocks/crypto-mock.js +48 -0
- package/jest/mocks/dom-rect-mock.d.ts +1 -0
- package/jest/mocks/element-from-point-mock.d.ts +11 -0
- package/jest/{setup.js → mocks/element-from-point-mock.js} +10 -16
- package/jest/mocks/fetch-mock.d.ts +10 -0
- package/jest/mocks/fetch-mock.js +38 -0
- package/jest/mocks/framer-motion-mock.d.ts +18 -0
- package/jest/mocks/framer-motion-mock.js +75 -0
- package/jest/mocks/intersection-observer-mock.d.ts +11 -0
- package/jest/mocks/intersection-observer-mock.js +58 -0
- package/jest/mocks/match-media-mock.d.ts +11 -0
- package/jest/mocks/match-media-mock.js +45 -0
- package/jest/mocks/offset-height-mock.d.ts +10 -0
- package/jest/mocks/offset-height-mock.js +39 -0
- package/jest/mocks/offset-width-mock.d.ts +10 -0
- package/jest/mocks/offset-width-mock.js +39 -0
- package/jest/mocks/pointer-event-mock.d.ts +10 -0
- package/jest/mocks/pointer-event-mock.js +42 -0
- package/jest/mocks/screen-size-mock.d.ts +10 -0
- package/jest/mocks/screen-size-mock.js +34 -0
- package/jest/mocks/scroll-into-view-mock.d.ts +10 -0
- package/jest/mocks/scroll-into-view-mock.js +34 -0
- package/jest/mocks/streamdown.mock.d.ts +2 -0
- package/jest/mocks/streamdown.mock.js +26 -0
- package/jest/mocks/table-virtualization-mock.d.ts +15 -0
- package/jest/mocks/table-virtualization-mock.js +102 -0
- package/jest/mocks/virtualization-mock.d.ts +9 -0
- package/jest/mocks/virtualization-mock.js +170 -0
- package/jest/preset/jest-preset.d.ts +2 -3
- package/jest/preset/jest-preset.js +2 -1
- package/jest/setup/index.js +27 -0
- package/jest/testing-helpers/filters/filter-field.d.ts +109 -0
- package/jest/testing-helpers/filters/filter-field.js +436 -0
- package/jest/testing-helpers/forms/base-input.d.ts +17 -0
- package/jest/testing-helpers/forms/base-input.js +50 -0
- package/jest/testing-helpers/forms/password-input.d.ts +16 -0
- package/jest/testing-helpers/forms/password-input.js +47 -0
- package/jest/testing-helpers/forms/search-input.d.ts +20 -0
- package/jest/testing-helpers/forms/search-input.js +45 -0
- package/jest/testing-helpers/forms/select.d.ts +65 -0
- package/jest/testing-helpers/forms/select.js +159 -0
- package/jest/testing-helpers/forms/text-input.d.ts +19 -0
- package/jest/testing-helpers/forms/text-input.js +42 -0
- package/jest/testing-helpers/tables/datatable.d.ts +239 -0
- package/jest/testing-helpers/tables/datatable.js +812 -0
- package/jest/testing-helpers/utils/isFakeTimersEnabled.d.ts +5 -0
- package/jest/testing-helpers/utils/isFakeTimersEnabled.js +27 -0
- package/jest/testing-helpers/utils/setup-user-event.d.ts +6 -0
- package/jest/testing-helpers/utils/setup-user-event.js +43 -0
- package/package.json +11 -3
- package/esm/jest/setup.js +0 -24
- package/esm/jest/setup.js.map +0 -7
- package/jest/setup.d.ts +0 -14
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var virtualization_mock_exports = {};
|
|
19
|
+
__export(virtualization_mock_exports, {
|
|
20
|
+
clearVirtualizationMock: () => clearVirtualizationMock,
|
|
21
|
+
setupVirtualizationMock: () => setupVirtualizationMock
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(virtualization_mock_exports);
|
|
24
|
+
var import_bounding_client_rect_mock = require("./bounding-client-rect-mock.js");
|
|
25
|
+
var import_dom_rect_mock = require("./dom-rect-mock.js");
|
|
26
|
+
const pristineOffsetHeight = Object.getOwnPropertyDescriptor(
|
|
27
|
+
HTMLElement.prototype,
|
|
28
|
+
"offsetHeight"
|
|
29
|
+
);
|
|
30
|
+
const pristineOffsetWidth = Object.getOwnPropertyDescriptor(
|
|
31
|
+
HTMLElement.prototype,
|
|
32
|
+
"offsetWidth"
|
|
33
|
+
);
|
|
34
|
+
const mockSizes = [
|
|
35
|
+
// Select
|
|
36
|
+
{
|
|
37
|
+
className: "strato-select-option",
|
|
38
|
+
width: 0,
|
|
39
|
+
height: 24
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
className: "strato-select-menulist",
|
|
43
|
+
width: 0,
|
|
44
|
+
height: 9999
|
|
45
|
+
},
|
|
46
|
+
// DataTable
|
|
47
|
+
{
|
|
48
|
+
className: "strato-table-header-group",
|
|
49
|
+
width: 1e3,
|
|
50
|
+
height: 32
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
className: "strato-table-virtualization-container",
|
|
54
|
+
width: 1e3,
|
|
55
|
+
height: 9999
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
className: "strato-table-row",
|
|
59
|
+
width: 1e3,
|
|
60
|
+
height: 56
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
className: "strato-table-header-cell",
|
|
64
|
+
width: 100,
|
|
65
|
+
height: 32
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
className: "strato-table-cell",
|
|
69
|
+
width: 100,
|
|
70
|
+
height: 32
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
attribute: "data-row",
|
|
74
|
+
width: 100,
|
|
75
|
+
height: 32
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
className: "strato-table-settings-virtualization-container",
|
|
79
|
+
width: 1e3,
|
|
80
|
+
height: 999
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
className: "strato-table-settings-item",
|
|
84
|
+
width: 100,
|
|
85
|
+
height: 33
|
|
86
|
+
},
|
|
87
|
+
// Filterfield
|
|
88
|
+
{
|
|
89
|
+
className: "strato-filter-field-suggestions",
|
|
90
|
+
width: 1e3,
|
|
91
|
+
height: 9999
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
className: "strato-filter-field-suggestion",
|
|
95
|
+
width: 200,
|
|
96
|
+
height: 30
|
|
97
|
+
},
|
|
98
|
+
// Chart tooltips
|
|
99
|
+
{
|
|
100
|
+
className: "chart-legend-grid-content",
|
|
101
|
+
width: 0,
|
|
102
|
+
height: 20
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
testid: "chart-tooltip-item-container",
|
|
106
|
+
width: 0,
|
|
107
|
+
height: 999
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
testid: "chart-tooltip-item",
|
|
111
|
+
width: 0,
|
|
112
|
+
height: 16
|
|
113
|
+
}
|
|
114
|
+
];
|
|
115
|
+
function setupVirtualizationMock() {
|
|
116
|
+
(0, import_bounding_client_rect_mock.setupGetBoundingClientRectMock)(function() {
|
|
117
|
+
for (const entry of mockSizes) {
|
|
118
|
+
const hasClass = entry.className ? this.classList.contains(entry.className) : false;
|
|
119
|
+
const hasAttribute = entry.attribute ? this.hasAttribute(entry.attribute) : false;
|
|
120
|
+
const hasTestId = entry.testid ? this.dataset.testid === entry.testid : false;
|
|
121
|
+
if (hasClass || hasAttribute || hasTestId) {
|
|
122
|
+
return (0, import_dom_rect_mock.createDOMRect)(entry.width, entry.height);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return (0, import_dom_rect_mock.createDOMRect)(0, 0);
|
|
126
|
+
});
|
|
127
|
+
Object.defineProperty(HTMLElement.prototype, "offsetHeight", {
|
|
128
|
+
configurable: true,
|
|
129
|
+
get: function() {
|
|
130
|
+
for (const entry of mockSizes) {
|
|
131
|
+
const hasClass = entry.className ? this.classList.contains(entry.className) : false;
|
|
132
|
+
const hasAttribute = entry.attribute ? this.hasAttribute(entry.attribute) : false;
|
|
133
|
+
const hasTestId = entry.testid ? this.dataset.testid === entry.testid : false;
|
|
134
|
+
if (hasClass || hasAttribute || hasTestId) {
|
|
135
|
+
return entry.height;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return 0;
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
Object.defineProperty(HTMLElement.prototype, "offsetWidth", {
|
|
142
|
+
configurable: true,
|
|
143
|
+
get: function() {
|
|
144
|
+
for (const entry of mockSizes) {
|
|
145
|
+
const hasClass = entry.className ? this.classList.contains(entry.className) : false;
|
|
146
|
+
const hasAttribute = entry.attribute ? this.hasAttribute(entry.attribute) : false;
|
|
147
|
+
const hasTestId = entry.testid ? this.dataset.testid === entry.testid : false;
|
|
148
|
+
if (hasClass || hasAttribute || hasTestId) {
|
|
149
|
+
return entry.width;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return 0;
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
function clearVirtualizationMock() {
|
|
157
|
+
(0, import_bounding_client_rect_mock.clearGetBoundingClientRectMock)();
|
|
158
|
+
Object.defineProperty(
|
|
159
|
+
HTMLElement.prototype,
|
|
160
|
+
"offsetHeight",
|
|
161
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
162
|
+
pristineOffsetHeight
|
|
163
|
+
);
|
|
164
|
+
Object.defineProperty(
|
|
165
|
+
HTMLElement.prototype,
|
|
166
|
+
"offsetWidth",
|
|
167
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
168
|
+
pristineOffsetWidth
|
|
169
|
+
);
|
|
170
|
+
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @public
|
|
3
|
-
*/
|
|
1
|
+
/** @public */
|
|
4
2
|
export declare const stratoPreset: {
|
|
5
3
|
moduleNameMapper: {
|
|
6
4
|
'^d3-(.*)$': string;
|
|
7
5
|
'^@codemirror/legacy-modes/mode/(.*)$': string;
|
|
8
6
|
nanoid: string;
|
|
9
7
|
'\\.(css|less|scss|sass)$': string;
|
|
8
|
+
streamdown: string;
|
|
10
9
|
};
|
|
11
10
|
resolver: string;
|
|
12
11
|
};
|
|
@@ -25,7 +25,8 @@ const stratoPreset = {
|
|
|
25
25
|
"^d3-(.*)$": "<rootDir>/node_modules/d3-$1/dist/d3-$1",
|
|
26
26
|
"^@codemirror/legacy-modes/mode/(.*)$": "<rootDir>/node_modules/@codemirror/legacy-modes/mode/$1.cjs",
|
|
27
27
|
nanoid: "<rootDir>/node_modules/nanoid/index.cjs",
|
|
28
|
-
"\\.(css|less|scss|sass)$": "identity-obj-proxy"
|
|
28
|
+
"\\.(css|less|scss|sass)$": "identity-obj-proxy",
|
|
29
|
+
streamdown: "@dynatrace/strato-components-testing/jest/mocks/streamdown.mock.js"
|
|
29
30
|
},
|
|
30
31
|
resolver: "<rootDir>/node_modules/@dynatrace/strato-components-testing/jest/preset/resolver.js"
|
|
31
32
|
};
|
package/jest/setup/index.js
CHANGED
|
@@ -1,13 +1,40 @@
|
|
|
1
1
|
var import_canvas_mock = require("../mocks/canvas-mock.js");
|
|
2
|
+
var import_create_range_mock = require("../mocks/create-range-mock.js");
|
|
3
|
+
var import_crypto_mock = require("../mocks/crypto-mock.js");
|
|
2
4
|
var import_dom_rect_mock = require("../mocks/dom-rect-mock.js");
|
|
5
|
+
var import_intersection_observer_mock = require("../mocks/intersection-observer-mock.js");
|
|
6
|
+
var import_match_media_mock = require("../mocks/match-media-mock.js");
|
|
7
|
+
var import_offset_width_mock = require("../mocks/offset-width-mock.js");
|
|
8
|
+
var import_pointer_event_mock = require("../mocks/pointer-event-mock.js");
|
|
3
9
|
var import_resize_observer_mock = require("../mocks/resize-observer-mock.js");
|
|
10
|
+
var import_screen_size_mock = require("../mocks/screen-size-mock.js");
|
|
11
|
+
var import_scroll_into_view_mock = require("../mocks/scroll-into-view-mock.js");
|
|
12
|
+
var import_virtualization_mock = require("../mocks/virtualization-mock.js");
|
|
4
13
|
beforeAll(() => {
|
|
5
14
|
(0, import_resize_observer_mock.setupResizeObserverMock)();
|
|
15
|
+
(0, import_pointer_event_mock.setupPointerEventMock)();
|
|
16
|
+
(0, import_intersection_observer_mock.setupIntersectionObserverMock)();
|
|
17
|
+
(0, import_create_range_mock.setupCreateRangeMock)();
|
|
18
|
+
(0, import_match_media_mock.setupMatchMediaMock)();
|
|
6
19
|
(0, import_dom_rect_mock.setupDomRectMock)();
|
|
20
|
+
(0, import_screen_size_mock.setupScreenSizeMock)();
|
|
21
|
+
(0, import_offset_width_mock.setupOffsetWidthMock)(0);
|
|
7
22
|
(0, import_canvas_mock.setupCanvasMeasureTextMock)(-Infinity);
|
|
23
|
+
(0, import_scroll_into_view_mock.setupScrollIntoViewMock)();
|
|
24
|
+
(0, import_virtualization_mock.setupVirtualizationMock)();
|
|
25
|
+
(0, import_crypto_mock.setupCryptoMock)();
|
|
8
26
|
});
|
|
9
27
|
afterAll(() => {
|
|
10
28
|
(0, import_resize_observer_mock.clearResizeObserverMock)();
|
|
29
|
+
(0, import_pointer_event_mock.clearPointerEventMock)();
|
|
30
|
+
(0, import_intersection_observer_mock.clearIntersectionObserverMock)();
|
|
31
|
+
(0, import_create_range_mock.clearCreateRangeMock)();
|
|
32
|
+
(0, import_offset_width_mock.clearOffsetWidthMock)();
|
|
11
33
|
(0, import_canvas_mock.clearCanvasMeasureTextMock)();
|
|
34
|
+
(0, import_match_media_mock.clearMatchMediaMock)();
|
|
12
35
|
(0, import_dom_rect_mock.clearDomRectMock)();
|
|
36
|
+
(0, import_screen_size_mock.clearScreenSizeMock)();
|
|
37
|
+
(0, import_scroll_into_view_mock.clearScrollIntoViewMock)();
|
|
38
|
+
(0, import_virtualization_mock.clearVirtualizationMock)();
|
|
39
|
+
(0, import_crypto_mock.clearCryptoMock)();
|
|
13
40
|
});
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base class for pinned or recent filter field suggestion.
|
|
3
|
+
* @public */
|
|
4
|
+
export declare class FilterFieldPinnedAndRecentSuggestionBase {
|
|
5
|
+
protected readonly suggestionRoot: HTMLDivElement;
|
|
6
|
+
constructor(suggestionRoot: HTMLDivElement);
|
|
7
|
+
private get pinButtonElement();
|
|
8
|
+
/**
|
|
9
|
+
* Receives the value of the suggestion that would be applied.
|
|
10
|
+
*/
|
|
11
|
+
get value(): string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Returns if the current suggestion is currently pinned or not.
|
|
14
|
+
*/
|
|
15
|
+
get pinned(): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Applies the suggestion to the filter field.
|
|
18
|
+
*/
|
|
19
|
+
apply(): Promise<void>;
|
|
20
|
+
get pinEnabled(): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Allows the suggestion to be pinned if not pinned already.
|
|
23
|
+
*/
|
|
24
|
+
pin(): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Allows the suggestion to be unpinned if not unpinned already.
|
|
27
|
+
*/
|
|
28
|
+
unpin(): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Testing helper class for pinned suggestions in the filter field
|
|
32
|
+
* @public */
|
|
33
|
+
export declare class FilterFieldPinnedSuggestion extends FilterFieldPinnedAndRecentSuggestionBase {
|
|
34
|
+
/**
|
|
35
|
+
* Receives the value of the suggestion that would be applied.
|
|
36
|
+
*/
|
|
37
|
+
get value(): string | null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Testing helper class for recent suggestions in the filter field
|
|
41
|
+
* @public */
|
|
42
|
+
export declare class FilterFieldRecentSuggestion extends FilterFieldPinnedAndRecentSuggestionBase {
|
|
43
|
+
/**
|
|
44
|
+
* Receives the value of the suggestion that would be applied.
|
|
45
|
+
*/
|
|
46
|
+
get value(): string | null;
|
|
47
|
+
/**
|
|
48
|
+
* Receives time offset indicating when the filter statement has last been used.
|
|
49
|
+
*/
|
|
50
|
+
get lastUsed(): string | null;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Helper class for interacting with the filter field.
|
|
54
|
+
* @public
|
|
55
|
+
*/
|
|
56
|
+
export declare class FilterFieldHelper {
|
|
57
|
+
private dataTestId;
|
|
58
|
+
private get filterFieldWrapper();
|
|
59
|
+
private get editorView();
|
|
60
|
+
private get inputElement();
|
|
61
|
+
private get filterFieldElement();
|
|
62
|
+
private get placeholderElement();
|
|
63
|
+
private get suggestionsContainer();
|
|
64
|
+
constructor(dataTestId: string);
|
|
65
|
+
/** Returns the value of the native text input. */
|
|
66
|
+
get value(): string;
|
|
67
|
+
/** Returns the value of the filter field. */
|
|
68
|
+
get filterFieldValue(): string;
|
|
69
|
+
/**
|
|
70
|
+
* The placeholder text shown in the filter field.
|
|
71
|
+
* Undefined if the placeholder is currently not rendered.
|
|
72
|
+
*/
|
|
73
|
+
get placeholder(): string | undefined;
|
|
74
|
+
/** Focus the filter field if not already focused. */
|
|
75
|
+
focus(): Promise<void>;
|
|
76
|
+
/** Blur the filter field by tabbing out of it. */
|
|
77
|
+
blur(): Promise<void>;
|
|
78
|
+
/** Fill a provided value into the filter field. */
|
|
79
|
+
type(text: string, cursorIndex?: number): Promise<void>;
|
|
80
|
+
/** Clears the filter field value. */
|
|
81
|
+
clear(): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* Moves the cursor to the given index.
|
|
84
|
+
* -1 moves to the end of the input.
|
|
85
|
+
*/
|
|
86
|
+
moveCursorTo(index: number): Promise<void>;
|
|
87
|
+
/** Open the suggestions overlay with the keyboard shortcut. */
|
|
88
|
+
openSuggestions(): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Close the suggestions overlay using the `Escape` key.
|
|
91
|
+
* If the filter field is focused, the focus will stay in the filter field.
|
|
92
|
+
*/
|
|
93
|
+
closeSuggestions(): Promise<void>;
|
|
94
|
+
/** Apply the suggestion with the given text. */
|
|
95
|
+
applySuggestion(queryString: string): Promise<void>;
|
|
96
|
+
/** Get recent suggestions */
|
|
97
|
+
getRecentSuggestions(): Promise<FilterFieldRecentSuggestion[]>;
|
|
98
|
+
/** Get pinned suggestions */
|
|
99
|
+
getPinnedSuggestions(): Promise<FilterFieldPinnedSuggestion[]>;
|
|
100
|
+
/** Paste text at the current cursor position */
|
|
101
|
+
paste(text: string, cursorIndex?: number): Promise<void>;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Helper function that returns the filter field with its testing utilities.
|
|
105
|
+
* @public
|
|
106
|
+
*/
|
|
107
|
+
export declare function getFilterFieldHelper(
|
|
108
|
+
/** The accessible test id used to locate the filter field wrapper. */
|
|
109
|
+
dataTestId: string): FilterFieldHelper;
|