File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ if (importWebhooksBtn && importWebhooksInput) {
134134showAddWebhookBtn . addEventListener ( 'click' , ( ) => {
135135 form . classList . remove ( 'hidden' ) ;
136136 showAddWebhookBtn . classList . add ( 'hidden' ) ;
137+ cancelEditBtn . classList . remove ( 'hidden' ) ;
137138 labelInput . focus ( ) ;
138139} ) ;
139140
Original file line number Diff line number Diff line change @@ -226,4 +226,13 @@ describe('options page', () => {
226226 expect ( document . getElementById ( 'add-new-webhook-btn' ) . classList . contains ( 'hidden' ) ) . toBe ( true ) ;
227227 expect ( document . getElementById ( 'add-webhook-form' ) . classList . contains ( 'hidden' ) ) . toBe ( false ) ;
228228 } ) ;
229+
230+ test ( 'add new webhook shows cancel button' , async ( ) => {
231+ const addBtn = document . getElementById ( 'add-new-webhook-btn' ) ;
232+ addBtn . click ( ) ;
233+
234+ expect ( document . getElementById ( 'cancel-edit-btn' ) . classList . contains ( 'hidden' ) ) . toBe ( false ) ;
235+ expect ( document . getElementById ( 'add-webhook-form' ) . classList . contains ( 'hidden' ) ) . toBe ( false ) ;
236+ expect ( document . getElementById ( 'add-new-webhook-btn' ) . classList . contains ( 'hidden' ) ) . toBe ( true ) ;
237+ } ) ;
229238} ) ;
You can’t perform that action at this time.
0 commit comments