File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,6 @@ export const initializeComponent = async (
9898 * ```html
9999 * <script type="module">
100100 * import { MyComponent } from 'my-stencil-component-library';
101- * console.log(1, MyComponent, customElements);
102101 * customElements.define('my-other-component', MyComponent);
103102 * </script>
104103 * ```
Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ declare global {
1212const testRequiresManualSetup =
1313 window . __wdioSpec__ . includes ( 'custom-elements-output-tag-class-different' ) ||
1414 window . __wdioSpec__ . includes ( 'custom-elements-delegates-focus' ) ||
15- window . __wdioSpec__ . includes ( 'custom-elements-output' ) ;
15+ window . __wdioSpec__ . includes ( 'custom-elements-output' ) ||
16+ window . __wdioSpec__ . endsWith ( 'custom-tag-name.test.tsx' ) ;
1617
1718/**
1819 * setup all components defined in tests except for those where we want ot manually setup
Original file line number Diff line number Diff line change 1+ import { h } from '@stencil/core' ;
2+ import { render } from '@wdio/browser-runner/stencil' ;
3+
4+ import { WatchNativeAttributes } from '../test-components/watch-native-attributes.js' ;
5+
6+ describe ( 'watch native attributes' , ( ) => {
7+ beforeEach ( ( ) => {
8+ customElements . define ( 'some-custom-element' , WatchNativeAttributes ) ;
9+ render ( {
10+ template : ( ) => < some-custom-element aria-label = "myStartingLabel" > </ some-custom-element > ,
11+ } ) ;
12+ } ) ;
13+
14+ it ( 'triggers the callback for the watched attribute' , async ( ) => {
15+ const $cmp = $ ( 'some-custom-element' ) ;
16+ await $cmp . waitForExist ( ) ;
17+
18+ await expect ( $cmp ) . toHaveText ( 'Label: myStartingLabel\nCallback triggered: false' ) ;
19+
20+ const cmp = document . querySelector ( 'some-custom-element' ) ;
21+ cmp . setAttribute ( 'aria-label' , 'myNewLabel' ) ;
22+
23+ await expect ( $cmp ) . toHaveText ( 'Label: myNewLabel\nCallback triggered: true' ) ;
24+ } ) ;
25+ } ) ;
You can’t perform that action at this time.
0 commit comments