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({
98
98
target . classList . add ( add ) ;
99
99
}
100
100
101
- $ ( target ) . trigger ( "pat-update" , { pattern : "switch" } ) ;
101
+ $ ( target ) . trigger ( "pat-update" , {
102
+ pattern : "switch" ,
103
+ action : "attribute-changed" ,
104
+ dom : target ,
105
+ } ) ;
102
106
}
103
107
} ,
104
108
} ) ;
Original file line number Diff line number Diff line change @@ -116,14 +116,15 @@ describe("pat-switch", function () {
116
116
117
117
it ( "Send pat-update event" , function ( ) {
118
118
document . body . innerHTML = "<div></div>" ;
119
+ const target = document . querySelector ( "body div" ) ;
119
120
const instance = new pattern ( document . createElement ( "div" ) ) ;
120
121
const spy_trigger = jest . spyOn ( $ . fn , "trigger" ) ;
121
122
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 ) ;
125
124
expect ( spy_trigger ) . toHaveBeenCalledWith ( "pat-update" , {
126
125
pattern : "switch" ,
126
+ action : "attribute-changed" ,
127
+ dom : target ,
127
128
} ) ;
128
129
} ) ;
129
130
} ) ;
You can’t perform that action at this time.
0 commit comments