File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,11 @@ export default Base.extend({
9898 target . classList . add ( add ) ;
9999 }
100100
101- $ ( target ) . trigger ( "pat-update" , { pattern : "switch" } ) ;
101+ $ ( target ) . trigger ( "pat-update" , {
102+ pattern : "switch" ,
103+ action : "attribute-changed" ,
104+ dom : target ,
105+ } ) ;
102106 }
103107 } ,
104108} ) ;
Original file line number Diff line number Diff line change @@ -116,14 +116,15 @@ describe("pat-switch", function () {
116116
117117 it ( "Send pat-update event" , function ( ) {
118118 document . body . innerHTML = "<div></div>" ;
119+ const target = document . querySelector ( "body div" ) ;
119120 const instance = new pattern ( document . createElement ( "div" ) ) ;
120121 const spy_trigger = jest . spyOn ( $ . fn , "trigger" ) ;
121122 instance . _update ( "body div" , null , "icon-alert" ) ;
122- expect (
123- document . querySelector ( "body div" ) . classList . contains ( "icon-alert" )
124- ) . toBe ( true ) ;
123+ expect ( target . classList . contains ( "icon-alert" ) ) . toBe ( true ) ;
125124 expect ( spy_trigger ) . toHaveBeenCalledWith ( "pat-update" , {
126125 pattern : "switch" ,
126+ action : "attribute-changed" ,
127+ dom : target ,
127128 } ) ;
128129 } ) ;
129130 } ) ;
You can’t perform that action at this time.
0 commit comments