npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@judo/test-ids

v0.1.1

Published

Test ID generation utilities for JUDO UI Runtime

Readme

@judo/test-ids

Test ID generation utilities for E2E testing support in JUDO UI Runtime

Purpose

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.

Architecture Layer

Layer 2 (Cross-cutting) — used by components, app-shell, and test suites for consistent test IDs.

Dependencies

  • @judo/model-api — model type definitions (peer)

File Structure

src/
├── index.ts            # Barrel re-exports
├── utils.ts            # Low-level string helpers
├── element.ts          # Generic visual-element IDs (buttons, inputs, links)
├── table.ts            # Table / row / cell / column / filter IDs
├── navigation.ts       # Nav items, breadcrumbs, user menu, actor selector
├── dialog.ts           # Dialog container & parts IDs
├── options.ts          # Autocomplete / select / chip IDs
├── tabs.ts             # Tab controller / tab / tab-panel IDs
└── *.test.ts           # Tests for each module

Exports Summary

String Helpers (3 functions)

| Function | Description | | ---------------------- | --------------------------------------------------------------------------------------------------- | | slugify(text) | Converts text to lowercase kebab-case, replacing special chars/spaces/underscores with hyphens. | | sanitizeId(value) | Strips everything except [a-zA-Z0-9_-], replacing removed chars with a single -. | | joinTestId(...parts) | Filters out null/undefined/empty parts and joins with ::. Core building-block for all generators. |

Element IDs (5 functions + 1 interface)

| Export | Kind | Description | | ------------------------------------ | --------- | ----------------------------------------------------------------------------------------------------------------------- | | TestIdElement | interface | Minimal shape for test-ID generation: { "xmi:id"?, sourceId?, name? }. | | getElementTestId(element, prefix?) | function | General-purpose ID: prefers sourceId, falls back to xmi:id, then name, then "unknown". | | getButtonTestId(button) | function | ID for a button; extracts action type from actionDefinition. Pattern: button::{id}[::{actionType}]. Takes Button. | | getButtonGroupTestId(group) | function | ID for a button group. Pattern: button-group::{id}. Takes ButtonGroup. | | getInputTestId(element) | function | Shorthand delegating to getElementTestId. Pattern: input::{id}. | | getLinkTestId(element) | function | Shorthand delegating to getElementTestId. Pattern: link::{id}. |

Table IDs (11 functions + 1 interface)

| Export | Description | | --------------------------------------------------- | ------------------------------------------------------------------- | | TransferData | interface: { __identifier?, __signedIdentifier?, [key]: unknown } | | getTableTestId(table) | Table container: table::{id} | | getRowTestId(tableId, transfer) | Row: table::{tableId}::row::{identifier} | | getCellTestId(tableId, transfer, columnName) | Cell: {rowId}::cell::{columnName} | | getRowActionTestId(tableId, transfer, actionName) | Row action: {rowId}::action::{actionName} | | getColumnHeaderTestId(tableId, columnName) | Column header: table::{tableId}::header::{columnName} | | getFilterTestId(tableId, filterName) | Filter input: table::{tableId}::filter::{filterName} | | getTableToolbarTestId(tableId) | Toolbar: table::{tableId}::toolbar | | getTablePaginationTestId(tableId) | Pagination: table::{tableId}::pagination | | getTableGridTestId(tableId) | Grid area: table::{tableId}::grid | | getTableFiltersTestId(tableId) | Filters container: table::{tableId}::filters | | getTableContainerTestId(tableId) | Outer container: table::{tableId}::container |

Navigation IDs (8 functions)

| Function | Description | | --------------------------------------- | ----------------------------------------------------------------- | | getNavItemTestId(item, parentPath?) | Nav item with optional parent path for nested trees. | | getNavItemIconTestId(navItemTestId) | Appends ::icon to a nav item test ID string. | | getNavItemLabelTestId(navItemTestId) | Appends ::label to a nav item test ID string. | | getNavItemExpandTestId(navItemTestId) | Appends ::expand to a nav item test ID string. | | getNavItemPath(navItemTestId) | Strips the nav::item:: prefix, returning just the path portion. | | getBreadcrumbTestId(index) | Breadcrumb by index: breadcrumb::{index}. | | getUserMenuTestId(action) | User menu action: user-menu::{action}. | | getActorSelectorTestId(actorName) | Actor selector option: actor-selector::option::{actorName}. |

Dialog IDs (8 functions)

| Function | Description | | ------------------------------------------- | -------------------------------------------------- | | getDialogTestId(dialogId) | Dialog container: dialog::{id} | | getDialogElementTestId(dialogId, element) | Element inside dialog: dialog::{id}::{elementId} | | getDialogTitleTestId(dialogId) | Dialog title: dialog::{id}::title | | getDialogContentTestId(dialogId) | Dialog content: dialog::{id}::content | | getDialogActionsTestId(dialogId) | Dialog actions bar: dialog::{id}::actions | | getDialogCloseTestId(dialogId) | Close button: dialog::{id}::close | | getDialogConfirmTestId(dialogId) | Confirm button: dialog::{id}::confirm | | getDialogCancelTestId(dialogId) | Cancel button: dialog::{id}::cancel |

Tab IDs (4 functions)

| Function | Description | | ------------------------------------------------ | ----------------------------------------------- | | getTabControllerTestId(controller) | Tab controller container: tabs::{id} | | getTabTestId(tabControllerId, tab, index) | Individual tab: tabs::{controllerId}::{tabId} | | getTabPanelTestId(tabControllerId, tab, index) | Tab panel: appends ::panel to tab test ID. | | getTabListTestId(tabControllerId) | Tab list: tabs::{controllerId}::list |

Autocomplete / Select / Chip IDs (7 functions)

| Function | Description | | ----------------------------------------- | ------------------------------------------------------- | | getOptionTestId(inputId, option, index) | Dropdown option: {inputId}::option::{identifier} | | getAutocompleteInputTestId(inputId) | Autocomplete text input: {inputId}::autocomplete | | getAutocompleteDropdownTestId(inputId) | Autocomplete dropdown: {inputId}::dropdown | | getSelectTriggerTestId(inputId) | Select trigger button: {inputId}::trigger | | getSelectMenuTestId(inputId) | Select menu: {inputId}::menu | | getChipTestId(inputId, option, index) | Multi-select chip: {inputId}::chip::{identifier} | | getChipDeleteTestId(chipTestId) | Chip delete button: appends ::delete to chip test ID. |

Key Patterns

  • :: separator convention: Every test ID uses joinTestId() which joins non-empty parts with ::
  • sourceIdxmi:idname"unknown" fallback chain: Consistent across element-based generators
  • Compositional nesting: Higher-level IDs (e.g., cell) build on top of lower-level IDs (e.g., row)
  • String-append shorthand: Sub-part generators append ::suffix directly via template literals
  • No runtime dependencies: Pure functions; zero React, zero state, zero side effects