@stylable/dom-test-kit
Advanced tools
Comparing version 3.5.0 to 3.5.2
@@ -11,5 +11,5 @@ "use strict"; | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
} | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./stylable-dom-util"), exports); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@stylable/dom-test-kit", | ||
"version": "3.5.0", | ||
"version": "3.5.2", | ||
"description": "Stylable DOM testing utilities", | ||
@@ -15,4 +15,4 @@ "main": "./cjs/index.js", | ||
"dependencies": { | ||
"@stylable/core": "^3.5.0", | ||
"@stylable/runtime": "^3.5.0" | ||
"@stylable/core": "^3.5.2", | ||
"@stylable/runtime": "^3.5.2" | ||
}, | ||
@@ -19,0 +19,0 @@ "files": [ |
@@ -8,2 +8,3 @@ # @stylable/dom-test-kit | ||
## Example | ||
```css | ||
@@ -14,5 +15,6 @@ /* my-component.st.css */ | ||
.part { | ||
-st-states: loading; | ||
-st-states: loading; | ||
} | ||
``` | ||
```ts | ||
@@ -34,17 +36,23 @@ /* test.ts */ | ||
### `constructor(style: RuntimeStylesheet, root?: Element)` | ||
Initialize the `StylableDOMUtil` by providing a source stylesheet that would function as the base for all testing utilities. You may pass a DOM root element to serve as the default entry point for the `select` methods, | ||
### `select(selector?: string, element?: Element): Element | null` | ||
Select the first `element` in the DOM that matches the provided Stylable `selector`. | ||
### `selectAll(selector?: string, element?: Element): Element[] | null` | ||
Select all `elements` in the DOM that match the provided Stylable `selector`. | ||
### `scopeSelector(selector?: string): string` | ||
Transforms a Stylable `selector` to its target vanilla CSS. | ||
### `hasStyleState(element: Element, stateName: string, param: StateValue = true): boolean` | ||
Check whether the provided `element` has the corresponding state set. This method can also receive a third optional param to validate the state active value. | ||
### `getStyleState(element: Element, stateName: string): string | null` | ||
Get an `element` state value if exists, `null` if it does not. | ||
@@ -51,0 +59,0 @@ |
18171
60
Updated@stylable/core@^3.5.2
Updated@stylable/runtime@^3.5.2