File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,24 @@ describe('input: rendering', () => {
4444 const bottomContent = page . body . querySelector ( 'ion-input .input-bottom' ) ;
4545 expect ( bottomContent ) . toBe ( null ) ;
4646 } ) ;
47+
48+ it ( 'should inherit watched attributes' , async ( ) => {
49+ const page = await newSpecPage ( {
50+ components : [ Input ] ,
51+ html : '<ion-input label="Input" dir="ltr"></ion-input>' ,
52+ } ) ;
53+
54+ const inputEl = page . body . querySelector ( 'ion-input' ) ! ;
55+ const nativeEl = inputEl . querySelector ( 'input' ) ! ;
56+
57+ expect ( nativeEl . getAttribute ( 'dir' ) ) . toBe ( 'ltr' ) ;
58+
59+ inputEl . setAttribute ( 'dir' , 'rtl' ) ;
60+
61+ await page . waitForChanges ( ) ;
62+
63+ expect ( nativeEl . getAttribute ( 'dir' ) ) . toBe ( 'rtl' ) ;
64+ } ) ;
4765} ) ;
4866
4967/**
Original file line number Diff line number Diff line change @@ -14,6 +14,24 @@ it('should inherit attributes', async () => {
1414 expect ( nativeEl . getAttribute ( 'data-form-type' ) ) . toBe ( 'password' ) ;
1515} ) ;
1616
17+ it ( 'should inherit watched attributes' , async ( ) => {
18+ const page = await newSpecPage ( {
19+ components : [ Textarea ] ,
20+ html : '<ion-textarea dir="ltr"></ion-textarea>' ,
21+ } ) ;
22+
23+ const textareaEl = page . body . querySelector ( 'ion-input' ) ! ;
24+ const nativeEl = textareaEl . querySelector ( 'textarea' ) ! ;
25+
26+ expect ( nativeEl . getAttribute ( 'dir' ) ) . toBe ( 'ltr' ) ;
27+
28+ textareaEl . setAttribute ( 'dir' , 'rtl' ) ;
29+
30+ await page . waitForChanges ( ) ;
31+
32+ expect ( nativeEl . getAttribute ( 'dir' ) ) . toBe ( 'rtl' ) ;
33+ } ) ;
34+
1735/**
1836 * Textarea uses emulated slots, so the internal
1937 * behavior will not exactly match IonSelect's slots.
You can’t perform that action at this time.
0 commit comments