@@ -122,6 +122,38 @@ describe('ButtonFormControlMixin core usage', () => {
122122expect ( button . _internals . ariaExpanded ) . toBe ( 'true' ) ;
123123} ) ;
124124
125+ it ( 'should expose native invoker property and attribute pairings' , async ( ) => {
126+ const button = await createButton ( usage ) ;
127+ const commandTarget = getElement < HTMLElement > ( fixture , '#target' ) ;
128+ const interestTarget = document . createElement ( 'div' ) ;
129+ interestTarget . id = 'interest-target' ;
130+ const popoverTarget = document . createElement ( 'div' ) ;
131+ popoverTarget . id = 'popover-target' ;
132+ popoverTarget . popover = 'auto' ;
133+ fixture . append ( interestTarget , popoverTarget ) ;
134+
135+ button . setAttribute ( 'interestfor' , interestTarget . id ) ;
136+ button . setAttribute ( 'popovertarget' , popoverTarget . id ) ;
137+ button . setAttribute ( 'popovertargetaction' , 'show' ) ;
138+ await elementIsStable ( button ) ;
139+
140+ expect ( button . commandForElement ) . toBe ( commandTarget ) ;
141+ expect ( button . interestForElement ) . toBe ( interestTarget ) ;
142+ expect ( button . popoverTargetElement ) . toBe ( popoverTarget ) ;
143+ expect ( button . popoverTargetAction ) . toBe ( 'show' ) ;
144+
145+ button . commandForElement = commandTarget ;
146+ button . interestForElement = interestTarget ;
147+ button . popoverTargetElement = popoverTarget ;
148+ button . popoverTargetAction = 'hide' ;
149+ await elementIsStable ( button ) ;
150+
151+ expect ( button . getAttribute ( 'commandfor' ) ) . toBe ( '' ) ;
152+ expect ( button . getAttribute ( 'interestfor' ) ) . toBe ( '' ) ;
153+ expect ( button . getAttribute ( 'popovertarget' ) ) . toBe ( '' ) ;
154+ expect ( button . getAttribute ( 'popovertargetaction' ) ) . toBe ( 'hide' ) ;
155+ } ) ;
156+
125157it ( 'should dispatch commands and suppress interaction while unavailable' , async ( ) => {
126158const button = await createButton ( usage ) ;
127159const target = getElement < HTMLElement > ( fixture , '#target' ) ;
0 commit comments