@judo/test-ids 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,277 @@
1
+ Eclipse Public License - v 2.0
2
+
3
+ THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
4
+ PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION
5
+ OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
6
+
7
+ 1. DEFINITIONS
8
+
9
+ "Contribution" means:
10
+
11
+ a) in the case of the initial Contributor, the initial content
12
+ Distributed under this Agreement, and
13
+
14
+ b) in the case of each subsequent Contributor:
15
+ i) changes to the Program, and
16
+ ii) additions to the Program;
17
+ where such changes and/or additions to the Program originate from
18
+ and are Distributed by that particular Contributor. A Contribution
19
+ "originates" from a Contributor if it was added to the Program by
20
+ such Contributor itself or anyone acting on such Contributor's behalf.
21
+ Contributions do not include changes or additions to the Program that
22
+ are not Modified Works.
23
+
24
+ "Contributor" means any person or entity that Distributes the Program.
25
+
26
+ "Licensed Patents" mean patent claims licensable by a Contributor which
27
+ are necessarily infringed by the use or sale of its Contribution alone
28
+ or when combined with the Program.
29
+
30
+ "Program" means the Contributions Distributed in accordance with this
31
+ Agreement.
32
+
33
+ "Recipient" means anyone who receives the Program under this Agreement
34
+ or any Secondary License (as applicable), including Contributors.
35
+
36
+ "Derivative Works" shall mean any work, whether in Source Code or other
37
+ form, that is based on (or derived from) the Program and for which the
38
+ editorial revisions, annotations, elaborations, or other modifications
39
+ represent, as a whole, an original work of authorship.
40
+
41
+ "Modified Works" shall mean any work in Source Code or other form that
42
+ results from an addition to, deletion from, or modification of the
43
+ contents of the Program, including, for purposes of clarity any new file
44
+ in Source Code form that contains any contents of the Program. Modified
45
+ Works shall not include works that contain only declarations,
46
+ interfaces, types, classes, structures, or files of the Program solely
47
+ in each case in order to link to, bind by name, or subclass the Program
48
+ or Modified Works thereof.
49
+
50
+ "Distribute" means the acts of a) distributing or b) making available
51
+ in any manner that enables the transfer of a copy.
52
+
53
+ "Source Code" means the form of a Program preferred for making
54
+ modifications, including but not limited to software source code,
55
+ documentation source, and configuration files.
56
+
57
+ "Secondary License" means either the GNU General Public License,
58
+ Version 2.0, or any later versions of that license, including any
59
+ exceptions or additional permissions as identified by the initial
60
+ Contributor.
61
+
62
+ 2. GRANT OF RIGHTS
63
+
64
+ a) Subject to the terms of this Agreement, each Contributor hereby
65
+ grants Recipient a non-exclusive, worldwide, royalty-free copyright
66
+ license to reproduce, prepare Derivative Works of, publicly display,
67
+ publicly perform, Distribute and sublicense the Contribution of such
68
+ Contributor, if any, and such Derivative Works.
69
+
70
+ b) Subject to the terms of this Agreement, each Contributor hereby
71
+ grants Recipient a non-exclusive, worldwide, royalty-free patent
72
+ license under Licensed Patents to make, use, sell, offer to sell,
73
+ import and otherwise transfer the Contribution of such Contributor,
74
+ if any, in Source Code or other form. This patent license shall
75
+ apply to the combination of the Contribution and the Program if, at
76
+ the time the Contribution is added by the Contributor, such addition
77
+ of the Contribution causes such combination to be covered by the
78
+ Licensed Patents. The patent license shall not apply to any other
79
+ combinations which include the Contribution. No hardware per se is
80
+ licensed hereunder.
81
+
82
+ c) Recipient understands that although each Contributor grants the
83
+ licenses to its Contributions set forth herein, no assurances are
84
+ provided by any Contributor that the Program does not infringe the
85
+ patent or other intellectual property rights of any other entity.
86
+ Each Contributor disclaims any liability to Recipient for claims
87
+ brought by any other entity based on infringement of intellectual
88
+ property rights or otherwise. As a condition to exercising the
89
+ rights and licenses granted hereunder, each Recipient hereby
90
+ assumes sole responsibility to secure any other intellectual
91
+ property rights needed, if any. For example, if a third party
92
+ patent license is required to allow Recipient to Distribute the
93
+ Program, it is Recipient's responsibility to acquire that license
94
+ before distributing the Program.
95
+
96
+ d) Each Contributor represents that to its knowledge it has
97
+ sufficient copyright rights in its Contribution, if any, to grant
98
+ the copyright license set forth in this Agreement.
99
+
100
+ e) Notwithstanding the terms of any Secondary License, no
101
+ Contributor makes additional grants to any Recipient (other than
102
+ those set forth in this Agreement) as a result of such Recipient's
103
+ receipt of the Program under the terms of a Secondary License
104
+ (if permitted under the terms of Section 3).
105
+
106
+ 3. REQUIREMENTS
107
+
108
+ 3.1 If a Contributor Distributes the Program in any form, then:
109
+
110
+ a) the Program must also be made available as Source Code, in
111
+ accordance with section 3.2, and the Contributor must accompany
112
+ the Program with a statement that the Source Code for the Program
113
+ is available under this Agreement, and informs Recipients how to
114
+ obtain it in a reasonable manner on or through a medium customarily
115
+ used for software exchange; and
116
+
117
+ b) the Contributor may Distribute the Program under a license
118
+ different than this Agreement, provided that such license:
119
+ i) effectively disclaims on behalf of all other Contributors all
120
+ warranties and conditions, express and implied, including
121
+ warranties or conditions of title and non-infringement, and
122
+ implied warranties or conditions of merchantability and fitness
123
+ for a particular purpose;
124
+
125
+ ii) effectively excludes on behalf of all other Contributors all
126
+ liability for damages, including direct, indirect, special,
127
+ incidental and consequential damages, such as lost profits;
128
+
129
+ iii) does not attempt to limit or alter the recipients' rights
130
+ in the Source Code under section 3.2; and
131
+
132
+ iv) requires any subsequent distribution of the Program by any
133
+ party to be under a license that satisfies the requirements
134
+ of this section 3.
135
+
136
+ 3.2 When the Program is Distributed as Source Code:
137
+
138
+ a) it must be made available under this Agreement, or if the
139
+ Program (i) is combined with other material in a separate file or
140
+ files made available under a Secondary License, and (ii) the initial
141
+ Contributor attached to the Source Code the notice described in
142
+ Exhibit A of this Agreement, then the Program may be made available
143
+ under the terms of such Secondary Licenses, and
144
+
145
+ b) a copy of this Agreement must be included with each copy of
146
+ the Program.
147
+
148
+ 3.3 Contributors may not remove or alter any copyright, patent,
149
+ trademark, attribution notices, disclaimers of warranty, or limitations
150
+ of liability ("notices") contained within the Program from any copy of
151
+ the Program which they Distribute, provided that Contributors may add
152
+ their own appropriate notices.
153
+
154
+ 4. COMMERCIAL DISTRIBUTION
155
+
156
+ Commercial distributors of software may accept certain responsibilities
157
+ with respect to end users, business partners and the like. While this
158
+ license is intended to facilitate the commercial use of the Program,
159
+ the Contributor who includes the Program in a commercial product
160
+ offering should do so in a manner which does not create potential
161
+ liability for other Contributors. Therefore, if a Contributor includes
162
+ the Program in a commercial product offering, such Contributor
163
+ ("Commercial Contributor") hereby agrees to defend and indemnify every
164
+ other Contributor ("Indemnified Contributor") against any losses,
165
+ damages and costs (collectively "Losses") arising from claims, lawsuits
166
+ and other legal actions brought by a third party against the Indemnified
167
+ Contributor to the extent caused by the acts or omissions of such
168
+ Commercial Contributor in connection with its distribution of the Program
169
+ in a commercial product offering. The obligations in this section do not
170
+ apply to any claims or Losses relating to any actual or alleged
171
+ intellectual property infringement. In order to qualify, an Indemnified
172
+ Contributor must: a) promptly notify the Commercial Contributor in
173
+ writing of such claim, and b) allow the Commercial Contributor to control,
174
+ and cooperate with the Commercial Contributor in, the defense and any
175
+ related settlement negotiations. The Indemnified Contributor may
176
+ participate in any such claim at its own expense.
177
+
178
+ For example, a Contributor might include the Program in a commercial
179
+ product offering, Product X. That Contributor is then a Commercial
180
+ Contributor. If that Commercial Contributor then makes performance
181
+ claims, or offers warranties related to Product X, those performance
182
+ claims and warranties are such Commercial Contributor's responsibility
183
+ alone. Under this section, the Commercial Contributor would have to
184
+ defend claims against the other Contributors related to those performance
185
+ claims and warranties, and if a court requires any other Contributor to
186
+ pay any damages as a result, the Commercial Contributor must pay
187
+ those damages.
188
+
189
+ 5. NO WARRANTY
190
+
191
+ EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
192
+ PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS"
193
+ BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
194
+ IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF
195
+ TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
196
+ PURPOSE. Each Recipient is solely responsible for determining the
197
+ appropriateness of using and distributing the Program and assumes all
198
+ risks associated with its exercise of rights under this Agreement,
199
+ including but not limited to the risks and costs of program errors,
200
+ compliance with applicable laws, damage to or loss of data, programs
201
+ or equipment, and unavailability or interruption of operations.
202
+
203
+ 6. DISCLAIMER OF LIABILITY
204
+
205
+ EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
206
+ PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS
207
+ SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
208
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
209
+ PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
210
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
211
+ ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
212
+ EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
213
+ POSSIBILITY OF SUCH DAMAGES.
214
+
215
+ 7. GENERAL
216
+
217
+ If any provision of this Agreement is invalid or unenforceable under
218
+ applicable law, it shall not affect the validity or enforceability of
219
+ the remainder of the terms of this Agreement, and without further
220
+ action by the parties hereto, such provision shall be reformed to the
221
+ minimum extent necessary to make such provision valid and enforceable.
222
+
223
+ If Recipient institutes patent litigation against any entity
224
+ (including a cross-claim or counterclaim in a lawsuit) alleging that the
225
+ Program itself (excluding combinations of the Program with other software
226
+ or hardware) infringes such Recipient's patent(s), then such Recipient's
227
+ rights granted under Section 2(b) shall terminate as of the date such
228
+ litigation is filed.
229
+
230
+ All Recipient's rights under this Agreement shall terminate if it
231
+ fails to comply with any of the material terms or conditions of this
232
+ Agreement and does not cure such failure in a reasonable period of
233
+ time after becoming aware of such noncompliance. If all Recipient's
234
+ rights under this Agreement terminate, Recipient agrees to cease use
235
+ and distribution of the Program as soon as reasonably practicable.
236
+ However, Recipient's obligations under this Agreement and any licenses
237
+ granted by Recipient relating to the Program shall continue and survive.
238
+
239
+ Everyone is permitted to copy and distribute copies of this Agreement,
240
+ but in order to avoid inconsistency the Agreement is copyrighted and
241
+ may only be modified in the following manner. The Agreement Steward
242
+ reserves the right to publish new versions (including revisions) of
243
+ this Agreement from time to time. No one other than the Agreement
244
+ Steward has the right to modify this Agreement. The Eclipse Foundation
245
+ is the initial Agreement Steward. The Eclipse Foundation may assign the
246
+ responsibility to serve as the Agreement Steward to a suitable separate
247
+ entity. Each new version of the Agreement will be given a distinguishing
248
+ version number. The Program (including Contributions) may always be
249
+ Distributed subject to the version of the Agreement under which it was
250
+ received. In addition, after a new version of the Agreement is published,
251
+ Contributor may elect to Distribute the Program (including its
252
+ Contributions) under the new version.
253
+
254
+ Except as expressly stated in Sections 2(a) and 2(b) above, Recipient
255
+ receives no rights or licenses to the intellectual property of any
256
+ Contributor under this Agreement, whether expressly, by implication,
257
+ estoppel or otherwise. All rights in the Program not expressly granted
258
+ under this Agreement are reserved. Nothing in this Agreement is intended
259
+ to be enforceable by any entity that is not a Contributor or Recipient.
260
+ No third-party beneficiary rights are created under this Agreement.
261
+
262
+ Exhibit A - Form of Secondary Licenses Notice
263
+
264
+ "This Source Code may also be made available under the following
265
+ Secondary Licenses when the conditions for such availability set forth
266
+ in the Eclipse Public License, v. 2.0 are satisfied: {name license(s),
267
+ version(s), and exceptions or additional permissions here}."
268
+
269
+ Simply including a copy of this Agreement, including this Exhibit A
270
+ is not sufficient to license the Source Code under Secondary Licenses.
271
+
272
+ If it is not possible or desirable to put the notice in a particular
273
+ file, then You may include the notice in a location (such as a LICENSE
274
+ file in a relevant directory) where a recipient would be likely to
275
+ look for such a notice.
276
+
277
+ You may add additional accurate notices of copyright ownership.
package/README.md ADDED
@@ -0,0 +1,123 @@
1
+ # @judo/test-ids
2
+
3
+ > Test ID generation utilities for E2E testing support in JUDO UI Runtime
4
+
5
+ ## Purpose
6
+
7
+ Produces deterministic, structured `data-testid` strings for all visual element categories using a `{context}::{element-type}::{sourceId}` convention with `::` as the separator. This is a **pure, framework-agnostic** utility package — no React, no state, no side effects.
8
+
9
+ ## Architecture Layer
10
+
11
+ **Layer 2 (Cross-cutting)** — used by components, app-shell, and test suites for consistent test IDs.
12
+
13
+ ## Dependencies
14
+
15
+ - `@judo/model-api` — model type definitions (peer)
16
+
17
+ ## File Structure
18
+
19
+ ```
20
+ src/
21
+ ├── index.ts # Barrel re-exports
22
+ ├── utils.ts # Low-level string helpers
23
+ ├── element.ts # Generic visual-element IDs (buttons, inputs, links)
24
+ ├── table.ts # Table / row / cell / column / filter IDs
25
+ ├── navigation.ts # Nav items, breadcrumbs, user menu, actor selector
26
+ ├── dialog.ts # Dialog container & parts IDs
27
+ ├── options.ts # Autocomplete / select / chip IDs
28
+ ├── tabs.ts # Tab controller / tab / tab-panel IDs
29
+ └── *.test.ts # Tests for each module
30
+ ```
31
+
32
+ ## Exports Summary
33
+
34
+ ### String Helpers (3 functions)
35
+
36
+ | Function | Description |
37
+ | ---------------------- | --------------------------------------------------------------------------------------------------- |
38
+ | `slugify(text)` | Converts text to lowercase kebab-case, replacing special chars/spaces/underscores with hyphens. |
39
+ | `sanitizeId(value)` | Strips everything except `[a-zA-Z0-9_-]`, replacing removed chars with a single `-`. |
40
+ | `joinTestId(...parts)` | Filters out null/undefined/empty parts and joins with `::`. Core building-block for all generators. |
41
+
42
+ ### Element IDs (5 functions + 1 interface)
43
+
44
+ | Export | Kind | Description |
45
+ | ------------------------------------ | --------- | ----------------------------------------------------------------------------------------------------------------------- |
46
+ | `TestIdElement` | interface | Minimal shape for test-ID generation: `{ "xmi:id"?, sourceId?, name? }`. |
47
+ | `getElementTestId(element, prefix?)` | function | General-purpose ID: prefers `sourceId`, falls back to `xmi:id`, then `name`, then `"unknown"`. |
48
+ | `getButtonTestId(button)` | function | ID for a button; extracts action type from `actionDefinition`. Pattern: `button::{id}[::{actionType}]`. Takes `Button`. |
49
+ | `getButtonGroupTestId(group)` | function | ID for a button group. Pattern: `button-group::{id}`. Takes `ButtonGroup`. |
50
+ | `getInputTestId(element)` | function | Shorthand delegating to `getElementTestId`. Pattern: `input::{id}`. |
51
+ | `getLinkTestId(element)` | function | Shorthand delegating to `getElementTestId`. Pattern: `link::{id}`. |
52
+
53
+ ### Table IDs (11 functions + 1 interface)
54
+
55
+ | Export | Description |
56
+ | --------------------------------------------------- | ------------------------------------------------------------------- |
57
+ | `TransferData` | interface: `{ __identifier?, __signedIdentifier?, [key]: unknown }` |
58
+ | `getTableTestId(table)` | Table container: `table::{id}` |
59
+ | `getRowTestId(tableId, transfer)` | Row: `table::{tableId}::row::{identifier}` |
60
+ | `getCellTestId(tableId, transfer, columnName)` | Cell: `{rowId}::cell::{columnName}` |
61
+ | `getRowActionTestId(tableId, transfer, actionName)` | Row action: `{rowId}::action::{actionName}` |
62
+ | `getColumnHeaderTestId(tableId, columnName)` | Column header: `table::{tableId}::header::{columnName}` |
63
+ | `getFilterTestId(tableId, filterName)` | Filter input: `table::{tableId}::filter::{filterName}` |
64
+ | `getTableToolbarTestId(tableId)` | Toolbar: `table::{tableId}::toolbar` |
65
+ | `getTablePaginationTestId(tableId)` | Pagination: `table::{tableId}::pagination` |
66
+ | `getTableGridTestId(tableId)` | Grid area: `table::{tableId}::grid` |
67
+ | `getTableFiltersTestId(tableId)` | Filters container: `table::{tableId}::filters` |
68
+ | `getTableContainerTestId(tableId)` | Outer container: `table::{tableId}::container` |
69
+
70
+ ### Navigation IDs (8 functions)
71
+
72
+ | Function | Description |
73
+ | --------------------------------------- | ----------------------------------------------------------------- |
74
+ | `getNavItemTestId(item, parentPath?)` | Nav item with optional parent path for nested trees. |
75
+ | `getNavItemIconTestId(navItemTestId)` | Appends `::icon` to a nav item test ID string. |
76
+ | `getNavItemLabelTestId(navItemTestId)` | Appends `::label` to a nav item test ID string. |
77
+ | `getNavItemExpandTestId(navItemTestId)` | Appends `::expand` to a nav item test ID string. |
78
+ | `getNavItemPath(navItemTestId)` | Strips the `nav::item::` prefix, returning just the path portion. |
79
+ | `getBreadcrumbTestId(index)` | Breadcrumb by index: `breadcrumb::{index}`. |
80
+ | `getUserMenuTestId(action)` | User menu action: `user-menu::{action}`. |
81
+ | `getActorSelectorTestId(actorName)` | Actor selector option: `actor-selector::option::{actorName}`. |
82
+
83
+ ### Dialog IDs (8 functions)
84
+
85
+ | Function | Description |
86
+ | ------------------------------------------- | -------------------------------------------------- |
87
+ | `getDialogTestId(dialogId)` | Dialog container: `dialog::{id}` |
88
+ | `getDialogElementTestId(dialogId, element)` | Element inside dialog: `dialog::{id}::{elementId}` |
89
+ | `getDialogTitleTestId(dialogId)` | Dialog title: `dialog::{id}::title` |
90
+ | `getDialogContentTestId(dialogId)` | Dialog content: `dialog::{id}::content` |
91
+ | `getDialogActionsTestId(dialogId)` | Dialog actions bar: `dialog::{id}::actions` |
92
+ | `getDialogCloseTestId(dialogId)` | Close button: `dialog::{id}::close` |
93
+ | `getDialogConfirmTestId(dialogId)` | Confirm button: `dialog::{id}::confirm` |
94
+ | `getDialogCancelTestId(dialogId)` | Cancel button: `dialog::{id}::cancel` |
95
+
96
+ ### Tab IDs (4 functions)
97
+
98
+ | Function | Description |
99
+ | ------------------------------------------------ | ----------------------------------------------- |
100
+ | `getTabControllerTestId(controller)` | Tab controller container: `tabs::{id}` |
101
+ | `getTabTestId(tabControllerId, tab, index)` | Individual tab: `tabs::{controllerId}::{tabId}` |
102
+ | `getTabPanelTestId(tabControllerId, tab, index)` | Tab panel: appends `::panel` to tab test ID. |
103
+ | `getTabListTestId(tabControllerId)` | Tab list: `tabs::{controllerId}::list` |
104
+
105
+ ### Autocomplete / Select / Chip IDs (7 functions)
106
+
107
+ | Function | Description |
108
+ | ----------------------------------------- | ------------------------------------------------------- |
109
+ | `getOptionTestId(inputId, option, index)` | Dropdown option: `{inputId}::option::{identifier}` |
110
+ | `getAutocompleteInputTestId(inputId)` | Autocomplete text input: `{inputId}::autocomplete` |
111
+ | `getAutocompleteDropdownTestId(inputId)` | Autocomplete dropdown: `{inputId}::dropdown` |
112
+ | `getSelectTriggerTestId(inputId)` | Select trigger button: `{inputId}::trigger` |
113
+ | `getSelectMenuTestId(inputId)` | Select menu: `{inputId}::menu` |
114
+ | `getChipTestId(inputId, option, index)` | Multi-select chip: `{inputId}::chip::{identifier}` |
115
+ | `getChipDeleteTestId(chipTestId)` | Chip delete button: appends `::delete` to chip test ID. |
116
+
117
+ ## Key Patterns
118
+
119
+ - **`::` separator convention**: Every test ID uses `joinTestId()` which joins non-empty parts with `::`
120
+ - **`sourceId` → `xmi:id` → `name` → `"unknown"` fallback chain**: Consistent across element-based generators
121
+ - **Compositional nesting**: Higher-level IDs (e.g., cell) build on top of lower-level IDs (e.g., row)
122
+ - **String-append shorthand**: Sub-part generators append `::suffix` directly via template literals
123
+ - **No runtime dependencies**: Pure functions; zero React, zero state, zero side effects
@@ -0,0 +1,59 @@
1
+ import { TestIdElement } from './element';
2
+ /**
3
+ * Get test ID for a dialog container.
4
+ *
5
+ * @param dialogId - Dialog identifier
6
+ * @returns Test ID string
7
+ */
8
+ export declare function getDialogTestId(dialogId: string): string;
9
+ /**
10
+ * Get test ID for an element within a dialog.
11
+ *
12
+ * @param dialogId - Dialog identifier
13
+ * @param element - Visual element within dialog
14
+ * @returns Test ID string
15
+ */
16
+ export declare function getDialogElementTestId(dialogId: string, element: TestIdElement): string;
17
+ /**
18
+ * Get test ID for dialog title.
19
+ *
20
+ * @param dialogId - Dialog identifier
21
+ * @returns Test ID string
22
+ */
23
+ export declare function getDialogTitleTestId(dialogId: string): string;
24
+ /**
25
+ * Get test ID for dialog content.
26
+ *
27
+ * @param dialogId - Dialog identifier
28
+ * @returns Test ID string
29
+ */
30
+ export declare function getDialogContentTestId(dialogId: string): string;
31
+ /**
32
+ * Get test ID for dialog actions container.
33
+ *
34
+ * @param dialogId - Dialog identifier
35
+ * @returns Test ID string
36
+ */
37
+ export declare function getDialogActionsTestId(dialogId: string): string;
38
+ /**
39
+ * Get test ID for dialog close button.
40
+ *
41
+ * @param dialogId - Dialog identifier
42
+ * @returns Test ID string
43
+ */
44
+ export declare function getDialogCloseTestId(dialogId: string): string;
45
+ /**
46
+ * Get test ID for dialog confirm button.
47
+ *
48
+ * @param dialogId - Dialog identifier
49
+ * @returns Test ID string
50
+ */
51
+ export declare function getDialogConfirmTestId(dialogId: string): string;
52
+ /**
53
+ * Get test ID for dialog cancel button.
54
+ *
55
+ * @param dialogId - Dialog identifier
56
+ * @returns Test ID string
57
+ */
58
+ export declare function getDialogCancelTestId(dialogId: string): string;
59
+ //# sourceMappingURL=dialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../src/dialog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG/C;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,MAAM,CAGvF;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE9D"}
@@ -0,0 +1,48 @@
1
+ import { Button, ButtonGroup } from '@judo/model-api';
2
+ /**
3
+ * Interface for elements with minimal required properties for test ID generation.
4
+ */
5
+ export interface TestIdElement {
6
+ "xmi:id"?: string;
7
+ sourceId?: string;
8
+ name?: string;
9
+ }
10
+ /**
11
+ * Get test ID for a model-driven visual element.
12
+ * Prefers sourceId, falls back to xmi:id.
13
+ *
14
+ * @param element - Visual element from model
15
+ * @param prefix - Optional prefix (e.g., 'input', 'button')
16
+ * @returns Test ID string
17
+ */
18
+ export declare function getElementTestId(element: TestIdElement, prefix?: string): string;
19
+ /**
20
+ * Get test ID for a button element.
21
+ * Includes action type if available.
22
+ *
23
+ * @param button - Button element
24
+ * @returns Test ID string
25
+ */
26
+ export declare function getButtonTestId(button: Button): string;
27
+ /**
28
+ * Get test ID for a button group.
29
+ *
30
+ * @param group - Button group element
31
+ * @returns Test ID string
32
+ */
33
+ export declare function getButtonGroupTestId(group: ButtonGroup): string;
34
+ /**
35
+ * Get test ID for an input element.
36
+ *
37
+ * @param element - Input element
38
+ * @returns Test ID string
39
+ */
40
+ export declare function getInputTestId(element: TestIdElement): string;
41
+ /**
42
+ * Get test ID for a link element.
43
+ *
44
+ * @param element - Link element
45
+ * @returns Test ID string
46
+ */
47
+ export declare function getLinkTestId(element: TestIdElement): string;
48
+ //# sourceMappingURL=element.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../src/element.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG3D;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAGhF;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAOtD;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAG/D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAE7D;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAE5D"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @judo/test-ids
3
+ *
4
+ * Test ID generation utilities for E2E testing support.
5
+ */
6
+ export { slugify, sanitizeId, joinTestId } from './utils';
7
+ export { getElementTestId, getButtonTestId, getButtonGroupTestId, getInputTestId, getLinkTestId, type TestIdElement, } from './element';
8
+ export { getTableTestId, getRowTestId, getCellTestId, getRowActionTestId, getColumnHeaderTestId, getFilterTestId, getTableToolbarTestId, getTablePaginationTestId, getTableGridTestId, getTableFiltersTestId, getTableContainerTestId, type TransferData, } from './table';
9
+ export { getNavItemTestId, getNavItemIconTestId, getNavItemLabelTestId, getNavItemExpandTestId, getNavItemPath, getBreadcrumbTestId, getUserMenuTestId, getActorSelectorTestId, } from './navigation';
10
+ export { getDialogTestId, getDialogElementTestId, getDialogTitleTestId, getDialogContentTestId, getDialogActionsTestId, getDialogCloseTestId, getDialogConfirmTestId, getDialogCancelTestId, } from './dialog';
11
+ export { getTabControllerTestId, getTabTestId, getTabPanelTestId, getTabListTestId } from './tabs';
12
+ export { getOptionTestId, getAutocompleteInputTestId, getAutocompleteDropdownTestId, getSelectTriggerTestId, getSelectMenuTestId, getChipTestId, getChipDeleteTestId, } from './options';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG1D,OAAO,EACN,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,aAAa,EACb,KAAK,aAAa,GAClB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACN,cAAc,EACd,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,wBAAwB,EACxB,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,EACvB,KAAK,YAAY,GACjB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACN,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,GACtB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACN,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,GACrB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,sBAAsB,EAAE,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAGnG,OAAO,EACN,eAAe,EACf,0BAA0B,EAC1B,6BAA6B,EAC7B,sBAAsB,EACtB,mBAAmB,EACnB,aAAa,EACb,mBAAmB,GACnB,MAAM,WAAW,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,142 @@
1
+ function slugify(_) {
2
+ return _.toLowerCase().trim().replace(/[^\w\s-]/g, "-").replace(/[\s_]+/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "");
3
+ }
4
+ function sanitizeId(_) {
5
+ return _.replace(/[^a-zA-Z0-9_-]/g, "-").replace(/-+/g, "-");
6
+ }
7
+ function joinTestId(..._) {
8
+ return _.filter((_) => _ != null && _ !== "").join("::");
9
+ }
10
+ function getElementTestId(_, H) {
11
+ let W = _.sourceId || _["xmi:id"] || _.name || "unknown";
12
+ return H ? joinTestId(H, W) : W;
13
+ }
14
+ function getButtonTestId(_) {
15
+ let H = _.sourceId || _["xmi:id"], W = _.actionDefinition?.["@type"]?.replace("ui:", "").replace("ActionDefinition", "").toLowerCase();
16
+ return joinTestId("button", H, W);
17
+ }
18
+ function getButtonGroupTestId(_) {
19
+ return joinTestId("button-group", _.sourceId || _["xmi:id"]);
20
+ }
21
+ function getInputTestId(_) {
22
+ return getElementTestId(_, "input");
23
+ }
24
+ function getLinkTestId(_) {
25
+ return getElementTestId(_, "link");
26
+ }
27
+ function getTableTestId(_) {
28
+ return joinTestId("table", _.sourceId || _["xmi:id"] || "unknown");
29
+ }
30
+ function getRowTestId(_, H) {
31
+ return joinTestId("table", _, "row", H.__identifier || H.__signedIdentifier || "unknown");
32
+ }
33
+ function getCellTestId(_, H, W) {
34
+ return joinTestId(getRowTestId(_, H), "cell", W);
35
+ }
36
+ function getRowActionTestId(_, H, W) {
37
+ return joinTestId(getRowTestId(_, H), "action", W);
38
+ }
39
+ function getColumnHeaderTestId(_, H) {
40
+ return joinTestId("table", _, "header", H);
41
+ }
42
+ function getFilterTestId(_, H) {
43
+ return joinTestId("table", _, "filter", H);
44
+ }
45
+ function getTableToolbarTestId(_) {
46
+ return joinTestId("table", _, "toolbar");
47
+ }
48
+ function getTablePaginationTestId(_) {
49
+ return joinTestId("table", _, "pagination");
50
+ }
51
+ function getTableGridTestId(_) {
52
+ return joinTestId("table", _, "grid");
53
+ }
54
+ function getTableFiltersTestId(_) {
55
+ return joinTestId("table", _, "filters");
56
+ }
57
+ function getTableContainerTestId(_) {
58
+ return joinTestId("table", _, "container");
59
+ }
60
+ function getNavItemTestId(H, W) {
61
+ let G = H.sourceId || H["xmi:id"] || slugify(H.name);
62
+ return joinTestId("nav", "item", W ? `${W}::${G}` : G);
63
+ }
64
+ function getNavItemIconTestId(_) {
65
+ return `${_}::icon`;
66
+ }
67
+ function getNavItemLabelTestId(_) {
68
+ return `${_}::label`;
69
+ }
70
+ function getNavItemExpandTestId(_) {
71
+ return `${_}::expand`;
72
+ }
73
+ function getNavItemPath(_) {
74
+ return _.replace("nav::item::", "");
75
+ }
76
+ function getBreadcrumbTestId(_) {
77
+ return joinTestId("breadcrumb", String(_));
78
+ }
79
+ function getUserMenuTestId(_) {
80
+ return joinTestId("user-menu", _);
81
+ }
82
+ function getActorSelectorTestId(_) {
83
+ return joinTestId("actor-selector", "option", _);
84
+ }
85
+ function getDialogTestId(_) {
86
+ return joinTestId("dialog", _);
87
+ }
88
+ function getDialogElementTestId(_, H) {
89
+ return joinTestId("dialog", _, H.sourceId || H["xmi:id"] || H.name || "unknown");
90
+ }
91
+ function getDialogTitleTestId(_) {
92
+ return joinTestId("dialog", _, "title");
93
+ }
94
+ function getDialogContentTestId(_) {
95
+ return joinTestId("dialog", _, "content");
96
+ }
97
+ function getDialogActionsTestId(_) {
98
+ return joinTestId("dialog", _, "actions");
99
+ }
100
+ function getDialogCloseTestId(_) {
101
+ return joinTestId("dialog", _, "close");
102
+ }
103
+ function getDialogConfirmTestId(_) {
104
+ return joinTestId("dialog", _, "confirm");
105
+ }
106
+ function getDialogCancelTestId(_) {
107
+ return joinTestId("dialog", _, "cancel");
108
+ }
109
+ function getTabControllerTestId(_) {
110
+ return joinTestId("tabs", _.sourceId || _["xmi:id"] || "unknown");
111
+ }
112
+ function getTabTestId(_, H, W) {
113
+ return joinTestId("tabs", _, H.sourceId || H["xmi:id"] || `tab-${W}`);
114
+ }
115
+ function getTabPanelTestId(_, H, U) {
116
+ return `${getTabTestId(_, H, U)}::panel`;
117
+ }
118
+ function getTabListTestId(_) {
119
+ return joinTestId("tabs", _, "list");
120
+ }
121
+ function getOptionTestId(_, H, W) {
122
+ return joinTestId(_, "option", H.__identifier || H.__signedIdentifier || `idx-${W}`);
123
+ }
124
+ function getAutocompleteInputTestId(_) {
125
+ return joinTestId(_, "autocomplete");
126
+ }
127
+ function getAutocompleteDropdownTestId(_) {
128
+ return joinTestId(_, "dropdown");
129
+ }
130
+ function getSelectTriggerTestId(_) {
131
+ return joinTestId(_, "trigger");
132
+ }
133
+ function getSelectMenuTestId(_) {
134
+ return joinTestId(_, "menu");
135
+ }
136
+ function getChipTestId(_, H, W) {
137
+ return joinTestId(_, "chip", H.__identifier || H.__signedIdentifier || `idx-${W}`);
138
+ }
139
+ function getChipDeleteTestId(_) {
140
+ return `${_}::delete`;
141
+ }
142
+ export { getActorSelectorTestId, getAutocompleteDropdownTestId, getAutocompleteInputTestId, getBreadcrumbTestId, getButtonGroupTestId, getButtonTestId, getCellTestId, getChipDeleteTestId, getChipTestId, getColumnHeaderTestId, getDialogActionsTestId, getDialogCancelTestId, getDialogCloseTestId, getDialogConfirmTestId, getDialogContentTestId, getDialogElementTestId, getDialogTestId, getDialogTitleTestId, getElementTestId, getFilterTestId, getInputTestId, getLinkTestId, getNavItemExpandTestId, getNavItemIconTestId, getNavItemLabelTestId, getNavItemPath, getNavItemTestId, getOptionTestId, getRowActionTestId, getRowTestId, getSelectMenuTestId, getSelectTriggerTestId, getTabControllerTestId, getTabListTestId, getTabPanelTestId, getTabTestId, getTableContainerTestId, getTableFiltersTestId, getTableGridTestId, getTablePaginationTestId, getTableTestId, getTableToolbarTestId, getUserMenuTestId, joinTestId, sanitizeId, slugify };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/utils.ts","../src/element.ts","../src/table.ts","../src/navigation.ts","../src/dialog.ts","../src/tabs.ts","../src/options.ts"],"sourcesContent":["/**\n * Convert a string to a URL-friendly slug.\n * Handles special characters and converts to lowercase kebab-case.\n *\n * @param text - Text to slugify\n * @returns Slugified string\n */\nexport function slugify(text: string): string {\n\treturn (\n\t\ttext\n\t\t\t.toLowerCase()\n\t\t\t.trim()\n\t\t\t// Replace special characters with hyphens\n\t\t\t.replace(/[^\\w\\s-]/g, \"-\")\n\t\t\t// Replace spaces and underscores with hyphens\n\t\t\t.replace(/[\\s_]+/g, \"-\")\n\t\t\t// Remove consecutive hyphens\n\t\t\t.replace(/-+/g, \"-\")\n\t\t\t// Remove leading/trailing hyphens\n\t\t\t.replace(/^-+|-+$/g, \"\")\n\t);\n}\n\n/**\n * Sanitize an ID for use in test selectors.\n * Preserves underscores and alphanumeric characters.\n *\n * @param id - ID to sanitize\n * @returns Sanitized ID\n */\nexport function sanitizeId(id: string): string {\n\t// Keep alphanumeric, underscores, and hyphens\n\treturn id.replace(/[^a-zA-Z0-9_-]/g, \"-\").replace(/-+/g, \"-\");\n}\n\n/**\n * Join test ID parts with the :: separator.\n *\n * @param parts - Parts to join\n * @returns Joined test ID\n */\nexport function joinTestId(...parts: (string | undefined | null)[]): string {\n\treturn parts.filter((p): p is string => p != null && p !== \"\").join(\"::\");\n}\n","import type { Button, ButtonGroup } from \"@judo/model-api\";\nimport { joinTestId } from \"./utils\";\n\n/**\n * Interface for elements with minimal required properties for test ID generation.\n */\nexport interface TestIdElement {\n\t\"xmi:id\"?: string;\n\tsourceId?: string;\n\tname?: string;\n}\n\n/**\n * Get test ID for a model-driven visual element.\n * Prefers sourceId, falls back to xmi:id.\n *\n * @param element - Visual element from model\n * @param prefix - Optional prefix (e.g., 'input', 'button')\n * @returns Test ID string\n */\nexport function getElementTestId(element: TestIdElement, prefix?: string): string {\n\tconst id = element.sourceId || element[\"xmi:id\"] || element.name || \"unknown\";\n\treturn prefix ? joinTestId(prefix, id) : id;\n}\n\n/**\n * Get test ID for a button element.\n * Includes action type if available.\n *\n * @param button - Button element\n * @returns Test ID string\n */\nexport function getButtonTestId(button: Button): string {\n\tconst id = button.sourceId || button[\"xmi:id\"];\n\t// Extract action type from actionDefinition if present\n\tconst actionDef = button.actionDefinition as { \"@type\"?: string } | undefined;\n\tconst actionType = actionDef?.[\"@type\"]?.replace(\"ui:\", \"\").replace(\"ActionDefinition\", \"\").toLowerCase();\n\n\treturn joinTestId(\"button\", id, actionType);\n}\n\n/**\n * Get test ID for a button group.\n *\n * @param group - Button group element\n * @returns Test ID string\n */\nexport function getButtonGroupTestId(group: ButtonGroup): string {\n\tconst id = group.sourceId || group[\"xmi:id\"];\n\treturn joinTestId(\"button-group\", id);\n}\n\n/**\n * Get test ID for an input element.\n *\n * @param element - Input element\n * @returns Test ID string\n */\nexport function getInputTestId(element: TestIdElement): string {\n\treturn getElementTestId(element, \"input\");\n}\n\n/**\n * Get test ID for a link element.\n *\n * @param element - Link element\n * @returns Test ID string\n */\nexport function getLinkTestId(element: TestIdElement): string {\n\treturn getElementTestId(element, \"link\");\n}\n","import type { TestIdElement } from \"./element\";\nimport { joinTestId } from \"./utils\";\n\n/**\n * Transfer data interface for row identification.\n */\nexport interface TransferData {\n\t__identifier?: string;\n\t__signedIdentifier?: string;\n\t[key: string]: unknown;\n}\n\n/**\n * Get test ID for a table container.\n *\n * @param table - Table element\n * @returns Test ID string\n */\nexport function getTableTestId(table: TestIdElement): string {\n\tconst id = table.sourceId || table[\"xmi:id\"] || \"unknown\";\n\treturn joinTestId(\"table\", id);\n}\n\n/**\n * Get test ID for a table row.\n * Uses transfer's __identifier or __signedIdentifier.\n *\n * @param tableId - Table identifier\n * @param transfer - Transfer data with identifier\n * @returns Test ID string\n */\nexport function getRowTestId(tableId: string, transfer: TransferData): string {\n\tconst transferId = transfer.__identifier || transfer.__signedIdentifier || \"unknown\";\n\treturn joinTestId(\"table\", tableId, \"row\", transferId);\n}\n\n/**\n * Get test ID for a table cell.\n *\n * @param tableId - Table identifier\n * @param transfer - Transfer data with identifier\n * @param columnName - Column name/field\n * @returns Test ID string\n */\nexport function getCellTestId(tableId: string, transfer: TransferData, columnName: string): string {\n\tconst rowId = getRowTestId(tableId, transfer);\n\treturn joinTestId(rowId, \"cell\", columnName);\n}\n\n/**\n * Get test ID for a row action button.\n *\n * @param tableId - Table identifier\n * @param transfer - Transfer data with identifier\n * @param actionName - Action name\n * @returns Test ID string\n */\nexport function getRowActionTestId(tableId: string, transfer: TransferData, actionName: string): string {\n\tconst rowId = getRowTestId(tableId, transfer);\n\treturn joinTestId(rowId, \"action\", actionName);\n}\n\n/**\n * Get test ID for a column header.\n *\n * @param tableId - Table identifier\n * @param columnName - Column name\n * @returns Test ID string\n */\nexport function getColumnHeaderTestId(tableId: string, columnName: string): string {\n\treturn joinTestId(\"table\", tableId, \"header\", columnName);\n}\n\n/**\n * Get test ID for a table filter.\n *\n * @param tableId - Table identifier\n * @param filterName - Filter name\n * @returns Test ID string\n */\nexport function getFilterTestId(tableId: string, filterName: string): string {\n\treturn joinTestId(\"table\", tableId, \"filter\", filterName);\n}\n\n/**\n * Get test ID for table toolbar.\n *\n * @param tableId - Table identifier\n * @returns Test ID string\n */\nexport function getTableToolbarTestId(tableId: string): string {\n\treturn joinTestId(\"table\", tableId, \"toolbar\");\n}\n\n/**\n * Get test ID for table pagination.\n *\n * @param tableId - Table identifier\n * @returns Test ID string\n */\nexport function getTablePaginationTestId(tableId: string): string {\n\treturn joinTestId(\"table\", tableId, \"pagination\");\n}\n\n/**\n * Get test ID for table grid.\n *\n * @param tableId - Table identifier\n * @returns Test ID string\n */\nexport function getTableGridTestId(tableId: string): string {\n\treturn joinTestId(\"table\", tableId, \"grid\");\n}\n\n/**\n * Get test ID for table filters container.\n *\n * @param tableId - Table identifier\n * @returns Test ID string\n */\nexport function getTableFiltersTestId(tableId: string): string {\n\treturn joinTestId(\"table\", tableId, \"filters\");\n}\n\n/**\n * Get test ID for table container.\n *\n * @param tableId - Table identifier\n * @returns Test ID string\n */\nexport function getTableContainerTestId(tableId: string): string {\n\treturn joinTestId(\"table\", tableId, \"container\");\n}\n","import { joinTestId, slugify } from \"./utils\";\n\n/**\n * Get test ID for a navigation item.\n * Includes full path for nested items.\n *\n * @param item - Navigation item\n * @param parentPath - Parent navigation path (without 'nav::item::' prefix)\n * @returns Test ID string\n */\nexport function getNavItemTestId(\n\titem: { sourceId?: string; \"xmi:id\"?: string; name: string },\n\tparentPath?: string\n): string {\n\tconst itemId = item.sourceId || item[\"xmi:id\"] || slugify(item.name);\n\tconst path = parentPath ? `${parentPath}::${itemId}` : itemId;\n\treturn joinTestId(\"nav\", \"item\", path);\n}\n\n/**\n * Get test ID for navigation item icon.\n *\n * @param navItemTestId - Full nav item test ID\n * @returns Test ID string\n */\nexport function getNavItemIconTestId(navItemTestId: string): string {\n\treturn `${navItemTestId}::icon`;\n}\n\n/**\n * Get test ID for navigation item label.\n *\n * @param navItemTestId - Full nav item test ID\n * @returns Test ID string\n */\nexport function getNavItemLabelTestId(navItemTestId: string): string {\n\treturn `${navItemTestId}::label`;\n}\n\n/**\n * Get test ID for navigation item expand button.\n *\n * @param navItemTestId - Full nav item test ID\n * @returns Test ID string\n */\nexport function getNavItemExpandTestId(navItemTestId: string): string {\n\treturn `${navItemTestId}::expand`;\n}\n\n/**\n * Extract the path portion from a nav item test ID.\n * Removes the 'nav::item::' prefix.\n *\n * @param navItemTestId - Full nav item test ID\n * @returns Path portion\n */\nexport function getNavItemPath(navItemTestId: string): string {\n\treturn navItemTestId.replace(\"nav::item::\", \"\");\n}\n\n/**\n * Get test ID for breadcrumb item.\n *\n * @param index - Breadcrumb index\n * @returns Test ID string\n */\nexport function getBreadcrumbTestId(index: number): string {\n\treturn joinTestId(\"breadcrumb\", String(index));\n}\n\n/**\n * Get test ID for user menu action.\n *\n * @param action - Action name (e.g., 'logout', 'profile')\n * @returns Test ID string\n */\nexport function getUserMenuTestId(action: string): string {\n\treturn joinTestId(\"user-menu\", action);\n}\n\n/**\n * Get test ID for actor selector option.\n *\n * @param actorName - Actor name\n * @returns Test ID string\n */\nexport function getActorSelectorTestId(actorName: string): string {\n\treturn joinTestId(\"actor-selector\", \"option\", actorName);\n}\n","import type { TestIdElement } from \"./element\";\nimport { joinTestId } from \"./utils\";\n\n/**\n * Get test ID for a dialog container.\n *\n * @param dialogId - Dialog identifier\n * @returns Test ID string\n */\nexport function getDialogTestId(dialogId: string): string {\n\treturn joinTestId(\"dialog\", dialogId);\n}\n\n/**\n * Get test ID for an element within a dialog.\n *\n * @param dialogId - Dialog identifier\n * @param element - Visual element within dialog\n * @returns Test ID string\n */\nexport function getDialogElementTestId(dialogId: string, element: TestIdElement): string {\n\tconst elementId = element.sourceId || element[\"xmi:id\"] || element.name || \"unknown\";\n\treturn joinTestId(\"dialog\", dialogId, elementId);\n}\n\n/**\n * Get test ID for dialog title.\n *\n * @param dialogId - Dialog identifier\n * @returns Test ID string\n */\nexport function getDialogTitleTestId(dialogId: string): string {\n\treturn joinTestId(\"dialog\", dialogId, \"title\");\n}\n\n/**\n * Get test ID for dialog content.\n *\n * @param dialogId - Dialog identifier\n * @returns Test ID string\n */\nexport function getDialogContentTestId(dialogId: string): string {\n\treturn joinTestId(\"dialog\", dialogId, \"content\");\n}\n\n/**\n * Get test ID for dialog actions container.\n *\n * @param dialogId - Dialog identifier\n * @returns Test ID string\n */\nexport function getDialogActionsTestId(dialogId: string): string {\n\treturn joinTestId(\"dialog\", dialogId, \"actions\");\n}\n\n/**\n * Get test ID for dialog close button.\n *\n * @param dialogId - Dialog identifier\n * @returns Test ID string\n */\nexport function getDialogCloseTestId(dialogId: string): string {\n\treturn joinTestId(\"dialog\", dialogId, \"close\");\n}\n\n/**\n * Get test ID for dialog confirm button.\n *\n * @param dialogId - Dialog identifier\n * @returns Test ID string\n */\nexport function getDialogConfirmTestId(dialogId: string): string {\n\treturn joinTestId(\"dialog\", dialogId, \"confirm\");\n}\n\n/**\n * Get test ID for dialog cancel button.\n *\n * @param dialogId - Dialog identifier\n * @returns Test ID string\n */\nexport function getDialogCancelTestId(dialogId: string): string {\n\treturn joinTestId(\"dialog\", dialogId, \"cancel\");\n}\n","import type { TestIdElement } from \"./element\";\nimport { joinTestId } from \"./utils\";\n\n/**\n * Get test ID for a tab controller.\n *\n * @param controller - Tab controller element\n * @returns Test ID string\n */\nexport function getTabControllerTestId(controller: TestIdElement): string {\n\tconst id = controller.sourceId || controller[\"xmi:id\"] || \"unknown\";\n\treturn joinTestId(\"tabs\", id);\n}\n\n/**\n * Get test ID for a tab.\n *\n * @param tabControllerId - Tab controller identifier\n * @param tab - Tab element\n * @param index - Tab index (fallback if tab has no ID)\n * @returns Test ID string\n */\nexport function getTabTestId(tabControllerId: string, tab: TestIdElement, index: number): string {\n\tconst tabId = tab.sourceId || tab[\"xmi:id\"] || `tab-${index}`;\n\treturn joinTestId(\"tabs\", tabControllerId, tabId);\n}\n\n/**\n * Get test ID for a tab panel.\n *\n * @param tabControllerId - Tab controller identifier\n * @param tab - Tab element\n * @param index - Tab index (fallback if tab has no ID)\n * @returns Test ID string\n */\nexport function getTabPanelTestId(tabControllerId: string, tab: TestIdElement, index: number): string {\n\treturn `${getTabTestId(tabControllerId, tab, index)}::panel`;\n}\n\n/**\n * Get test ID for tab list container.\n *\n * @param tabControllerId - Tab controller identifier\n * @returns Test ID string\n */\nexport function getTabListTestId(tabControllerId: string): string {\n\treturn joinTestId(\"tabs\", tabControllerId, \"list\");\n}\n","import type { TransferData } from \"./table\";\nimport { joinTestId } from \"./utils\";\n\n/**\n * Get test ID for an autocomplete/select option.\n *\n * @param inputId - Input element identifier\n * @param option - Option transfer data\n * @param index - Option index (fallback)\n * @returns Test ID string\n */\nexport function getOptionTestId(inputId: string, option: TransferData, index: number): string {\n\tconst optionId = option.__identifier || option.__signedIdentifier || `idx-${index}`;\n\treturn joinTestId(inputId, \"option\", optionId);\n}\n\n/**\n * Get test ID for autocomplete input.\n *\n * @param inputId - Input element identifier\n * @returns Test ID string\n */\nexport function getAutocompleteInputTestId(inputId: string): string {\n\treturn joinTestId(inputId, \"autocomplete\");\n}\n\n/**\n * Get test ID for autocomplete dropdown.\n *\n * @param inputId - Input element identifier\n * @returns Test ID string\n */\nexport function getAutocompleteDropdownTestId(inputId: string): string {\n\treturn joinTestId(inputId, \"dropdown\");\n}\n\n/**\n * Get test ID for select trigger button.\n *\n * @param inputId - Input element identifier\n * @returns Test ID string\n */\nexport function getSelectTriggerTestId(inputId: string): string {\n\treturn joinTestId(inputId, \"trigger\");\n}\n\n/**\n * Get test ID for select menu.\n *\n * @param inputId - Input element identifier\n * @returns Test ID string\n */\nexport function getSelectMenuTestId(inputId: string): string {\n\treturn joinTestId(inputId, \"menu\");\n}\n\n/**\n * Get test ID for chip in multi-select.\n *\n * @param inputId - Input element identifier\n * @param option - Option transfer data\n * @param index - Chip index\n * @returns Test ID string\n */\nexport function getChipTestId(inputId: string, option: TransferData, index: number): string {\n\tconst optionId = option.__identifier || option.__signedIdentifier || `idx-${index}`;\n\treturn joinTestId(inputId, \"chip\", optionId);\n}\n\n/**\n * Get test ID for chip delete button.\n *\n * @param chipTestId - Full chip test ID\n * @returns Test ID string\n */\nexport function getChipDeleteTestId(chipTestId: string): string {\n\treturn `${chipTestId}::delete`;\n}\n"],"mappings":"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"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Get test ID for a navigation item.
3
+ * Includes full path for nested items.
4
+ *
5
+ * @param item - Navigation item
6
+ * @param parentPath - Parent navigation path (without 'nav::item::' prefix)
7
+ * @returns Test ID string
8
+ */
9
+ export declare function getNavItemTestId(item: {
10
+ sourceId?: string;
11
+ "xmi:id"?: string;
12
+ name: string;
13
+ }, parentPath?: string): string;
14
+ /**
15
+ * Get test ID for navigation item icon.
16
+ *
17
+ * @param navItemTestId - Full nav item test ID
18
+ * @returns Test ID string
19
+ */
20
+ export declare function getNavItemIconTestId(navItemTestId: string): string;
21
+ /**
22
+ * Get test ID for navigation item label.
23
+ *
24
+ * @param navItemTestId - Full nav item test ID
25
+ * @returns Test ID string
26
+ */
27
+ export declare function getNavItemLabelTestId(navItemTestId: string): string;
28
+ /**
29
+ * Get test ID for navigation item expand button.
30
+ *
31
+ * @param navItemTestId - Full nav item test ID
32
+ * @returns Test ID string
33
+ */
34
+ export declare function getNavItemExpandTestId(navItemTestId: string): string;
35
+ /**
36
+ * Extract the path portion from a nav item test ID.
37
+ * Removes the 'nav::item::' prefix.
38
+ *
39
+ * @param navItemTestId - Full nav item test ID
40
+ * @returns Path portion
41
+ */
42
+ export declare function getNavItemPath(navItemTestId: string): string;
43
+ /**
44
+ * Get test ID for breadcrumb item.
45
+ *
46
+ * @param index - Breadcrumb index
47
+ * @returns Test ID string
48
+ */
49
+ export declare function getBreadcrumbTestId(index: number): string;
50
+ /**
51
+ * Get test ID for user menu action.
52
+ *
53
+ * @param action - Action name (e.g., 'logout', 'profile')
54
+ * @returns Test ID string
55
+ */
56
+ export declare function getUserMenuTestId(action: string): string;
57
+ /**
58
+ * Get test ID for actor selector option.
59
+ *
60
+ * @param actorName - Actor name
61
+ * @returns Test ID string
62
+ */
63
+ export declare function getActorSelectorTestId(actorName: string): string;
64
+ //# sourceMappingURL=navigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../src/navigation.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC/B,IAAI,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAC5D,UAAU,CAAC,EAAE,MAAM,GACjB,MAAM,CAIR;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAElE;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEhE"}
@@ -0,0 +1,55 @@
1
+ import { TransferData } from './table';
2
+ /**
3
+ * Get test ID for an autocomplete/select option.
4
+ *
5
+ * @param inputId - Input element identifier
6
+ * @param option - Option transfer data
7
+ * @param index - Option index (fallback)
8
+ * @returns Test ID string
9
+ */
10
+ export declare function getOptionTestId(inputId: string, option: TransferData, index: number): string;
11
+ /**
12
+ * Get test ID for autocomplete input.
13
+ *
14
+ * @param inputId - Input element identifier
15
+ * @returns Test ID string
16
+ */
17
+ export declare function getAutocompleteInputTestId(inputId: string): string;
18
+ /**
19
+ * Get test ID for autocomplete dropdown.
20
+ *
21
+ * @param inputId - Input element identifier
22
+ * @returns Test ID string
23
+ */
24
+ export declare function getAutocompleteDropdownTestId(inputId: string): string;
25
+ /**
26
+ * Get test ID for select trigger button.
27
+ *
28
+ * @param inputId - Input element identifier
29
+ * @returns Test ID string
30
+ */
31
+ export declare function getSelectTriggerTestId(inputId: string): string;
32
+ /**
33
+ * Get test ID for select menu.
34
+ *
35
+ * @param inputId - Input element identifier
36
+ * @returns Test ID string
37
+ */
38
+ export declare function getSelectMenuTestId(inputId: string): string;
39
+ /**
40
+ * Get test ID for chip in multi-select.
41
+ *
42
+ * @param inputId - Input element identifier
43
+ * @param option - Option transfer data
44
+ * @param index - Chip index
45
+ * @returns Test ID string
46
+ */
47
+ export declare function getChipTestId(inputId: string, option: TransferData, index: number): string;
48
+ /**
49
+ * Get test ID for chip delete button.
50
+ *
51
+ * @param chipTestId - Full chip test ID
52
+ * @returns Test ID string
53
+ */
54
+ export declare function getChipDeleteTestId(chipTestId: string): string;
55
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG5C;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAG5F;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAElE;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAErE;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAG1F;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE9D"}
@@ -0,0 +1,95 @@
1
+ import { TestIdElement } from './element';
2
+ /**
3
+ * Transfer data interface for row identification.
4
+ */
5
+ export interface TransferData {
6
+ __identifier?: string;
7
+ __signedIdentifier?: string;
8
+ [key: string]: unknown;
9
+ }
10
+ /**
11
+ * Get test ID for a table container.
12
+ *
13
+ * @param table - Table element
14
+ * @returns Test ID string
15
+ */
16
+ export declare function getTableTestId(table: TestIdElement): string;
17
+ /**
18
+ * Get test ID for a table row.
19
+ * Uses transfer's __identifier or __signedIdentifier.
20
+ *
21
+ * @param tableId - Table identifier
22
+ * @param transfer - Transfer data with identifier
23
+ * @returns Test ID string
24
+ */
25
+ export declare function getRowTestId(tableId: string, transfer: TransferData): string;
26
+ /**
27
+ * Get test ID for a table cell.
28
+ *
29
+ * @param tableId - Table identifier
30
+ * @param transfer - Transfer data with identifier
31
+ * @param columnName - Column name/field
32
+ * @returns Test ID string
33
+ */
34
+ export declare function getCellTestId(tableId: string, transfer: TransferData, columnName: string): string;
35
+ /**
36
+ * Get test ID for a row action button.
37
+ *
38
+ * @param tableId - Table identifier
39
+ * @param transfer - Transfer data with identifier
40
+ * @param actionName - Action name
41
+ * @returns Test ID string
42
+ */
43
+ export declare function getRowActionTestId(tableId: string, transfer: TransferData, actionName: string): string;
44
+ /**
45
+ * Get test ID for a column header.
46
+ *
47
+ * @param tableId - Table identifier
48
+ * @param columnName - Column name
49
+ * @returns Test ID string
50
+ */
51
+ export declare function getColumnHeaderTestId(tableId: string, columnName: string): string;
52
+ /**
53
+ * Get test ID for a table filter.
54
+ *
55
+ * @param tableId - Table identifier
56
+ * @param filterName - Filter name
57
+ * @returns Test ID string
58
+ */
59
+ export declare function getFilterTestId(tableId: string, filterName: string): string;
60
+ /**
61
+ * Get test ID for table toolbar.
62
+ *
63
+ * @param tableId - Table identifier
64
+ * @returns Test ID string
65
+ */
66
+ export declare function getTableToolbarTestId(tableId: string): string;
67
+ /**
68
+ * Get test ID for table pagination.
69
+ *
70
+ * @param tableId - Table identifier
71
+ * @returns Test ID string
72
+ */
73
+ export declare function getTablePaginationTestId(tableId: string): string;
74
+ /**
75
+ * Get test ID for table grid.
76
+ *
77
+ * @param tableId - Table identifier
78
+ * @returns Test ID string
79
+ */
80
+ export declare function getTableGridTestId(tableId: string): string;
81
+ /**
82
+ * Get test ID for table filters container.
83
+ *
84
+ * @param tableId - Table identifier
85
+ * @returns Test ID string
86
+ */
87
+ export declare function getTableFiltersTestId(tableId: string): string;
88
+ /**
89
+ * Get test ID for table container.
90
+ *
91
+ * @param tableId - Table identifier
92
+ * @returns Test ID string
93
+ */
94
+ export declare function getTableContainerTestId(tableId: string): string;
95
+ //# sourceMappingURL=table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../src/table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG/C;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAG3D;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,GAAG,MAAM,CAG5E;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAGjG;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAGtG;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAEjF;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAE3E;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE/D"}
package/dist/tabs.d.ts ADDED
@@ -0,0 +1,34 @@
1
+ import { TestIdElement } from './element';
2
+ /**
3
+ * Get test ID for a tab controller.
4
+ *
5
+ * @param controller - Tab controller element
6
+ * @returns Test ID string
7
+ */
8
+ export declare function getTabControllerTestId(controller: TestIdElement): string;
9
+ /**
10
+ * Get test ID for a tab.
11
+ *
12
+ * @param tabControllerId - Tab controller identifier
13
+ * @param tab - Tab element
14
+ * @param index - Tab index (fallback if tab has no ID)
15
+ * @returns Test ID string
16
+ */
17
+ export declare function getTabTestId(tabControllerId: string, tab: TestIdElement, index: number): string;
18
+ /**
19
+ * Get test ID for a tab panel.
20
+ *
21
+ * @param tabControllerId - Tab controller identifier
22
+ * @param tab - Tab element
23
+ * @param index - Tab index (fallback if tab has no ID)
24
+ * @returns Test ID string
25
+ */
26
+ export declare function getTabPanelTestId(tabControllerId: string, tab: TestIdElement, index: number): string;
27
+ /**
28
+ * Get test ID for tab list container.
29
+ *
30
+ * @param tabControllerId - Tab controller identifier
31
+ * @returns Test ID string
32
+ */
33
+ export declare function getTabListTestId(tabControllerId: string): string;
34
+ //# sourceMappingURL=tabs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../src/tabs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG/C;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,aAAa,GAAG,MAAM,CAGxE;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,eAAe,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAG/F;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,eAAe,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEpG;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAEhE"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Convert a string to a URL-friendly slug.
3
+ * Handles special characters and converts to lowercase kebab-case.
4
+ *
5
+ * @param text - Text to slugify
6
+ * @returns Slugified string
7
+ */
8
+ export declare function slugify(text: string): string;
9
+ /**
10
+ * Sanitize an ID for use in test selectors.
11
+ * Preserves underscores and alphanumeric characters.
12
+ *
13
+ * @param id - ID to sanitize
14
+ * @returns Sanitized ID
15
+ */
16
+ export declare function sanitizeId(id: string): string;
17
+ /**
18
+ * Join test ID parts with the :: separator.
19
+ *
20
+ * @param parts - Parts to join
21
+ * @returns Joined test ID
22
+ */
23
+ export declare function joinTestId(...parts: (string | undefined | null)[]): string;
24
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAc5C;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAG7C;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,EAAE,GAAG,MAAM,CAE1E"}
package/package.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@judo/test-ids",
3
+ "version": "0.1.0",
4
+ "description": "Test ID generation utilities for JUDO UI Runtime",
5
+ "license": "EPL-2.0",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/BlackBeltTechnology/judo-frontend-runtime.git",
9
+ "directory": "packages/test-ids"
10
+ },
11
+ "files": [
12
+ "dist",
13
+ "LICENSE",
14
+ "README.md"
15
+ ],
16
+ "type": "module",
17
+ "sideEffects": false,
18
+ "main": "./dist/index.js",
19
+ "types": "./dist/index.d.ts",
20
+ "exports": {
21
+ ".": {
22
+ "types": "./dist/index.d.ts",
23
+ "import": "./dist/index.js"
24
+ }
25
+ },
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "dependencies": {
30
+ "@judo/model-api": "0.1.0"
31
+ },
32
+ "devDependencies": {
33
+ "@types/node": "^25.2.3",
34
+ "typescript": "^5.9.3",
35
+ "vitest": "^4.0.18",
36
+ "@judo/model-api": "0.1.0"
37
+ },
38
+ "peerDependencies": {
39
+ "@judo/model-api": "0.1.0"
40
+ },
41
+ "scripts": {
42
+ "build": "vite build",
43
+ "clean": "rm -rf dist",
44
+ "type-check": "tsgo --noEmit",
45
+ "test": "vitest run",
46
+ "test:watch": "vitest"
47
+ }
48
+ }