@@ -121,34 +121,21 @@ describe('Bot Events', function () {
121
121
this . bot . sendExactToDiscord . should . not . have . been . called ;
122
122
} ) ;
123
123
124
- it ( 'should send name change event to discord (untracked user) ' , function ( ) {
124
+ it ( 'should send name change event to discord' , function ( ) {
125
125
const channel1 = '#channel1' ;
126
126
const channel2 = '#channel2' ;
127
- const oldnick = 'user1' ;
128
- const newnick = 'user2' ;
129
- const bot = createBot ( { ...config , ircStatusNotices : true } ) ;
130
- bot . connect ( ) ;
131
- const formattedText = `*${ oldnick } * is now known as ${ newnick } ` ;
132
- bot . ircClient . emit ( 'nick' , oldnick , newnick , [ channel1 , channel2 ] ) ;
133
- bot . sendExactToDiscord . should . have . been . calledTwice ;
134
- bot . sendExactToDiscord . getCall ( 0 ) . args . should . deep . equal ( [ channel1 , formattedText ] ) ;
135
- bot . sendExactToDiscord . getCall ( 1 ) . args . should . deep . equal ( [ channel2 , formattedText ] ) ;
136
- } ) ;
137
-
138
- it ( 'should send name change event to discord (tracked user)' , function ( ) {
139
- const channel = '#channel' ;
140
- const oldnick = 'user1' ;
141
- const newnick = 'user2' ;
127
+ const oldNick = 'user1' ;
128
+ const newNick = 'user2' ;
142
129
const bot = createBot ( { ...config , ircStatusNotices : true } ) ;
143
130
bot . connect ( ) ;
144
- bot . ircClient . emit ( 'names' , channel , { [ bot . nickname ] : '' , [ oldnick ] : '' } ) ;
145
- const channelNicksPre = new Set ( [ bot . nickname , oldnick ] ) ;
146
- bot . channelUsers . should . deep . equal ( { '#channel ' : channelNicksPre } ) ;
147
- const formattedText = `*${ oldnick } * is now known as ${ newnick } ` ;
148
- const channelNicksAfter = new Set ( [ bot . nickname , newnick ] ) ;
149
- bot . ircClient . emit ( 'nick' , oldnick , newnick , [ channel ] ) ;
150
- bot . sendExactToDiscord . should . have . been . calledWithExactly ( channel , formattedText ) ;
151
- bot . channelUsers . should . deep . equal ( { '#channel ' : channelNicksAfter } ) ;
131
+ bot . ircClient . emit ( 'names' , '#channel1' , { [ bot . nickname ] : '' , [ oldNick ] : '' } ) ;
132
+ const channelNicksPre = new Set ( [ bot . nickname , oldNick ] ) ;
133
+ bot . channelUsers . should . deep . equal ( { '#channel1 ' : channelNicksPre } ) ;
134
+ const formattedText = `*${ oldNick } * is now known as ${ newNick } ` ;
135
+ const channelNicksAfter = new Set ( [ bot . nickname , newNick ] ) ;
136
+ bot . ircClient . emit ( 'nick' , oldNick , newNick , [ channel1 , channel2 ] ) ;
137
+ bot . sendExactToDiscord . should . have . been . calledWithExactly ( channel1 , formattedText ) ;
138
+ bot . channelUsers . should . deep . equal ( { '#channel1 ' : channelNicksAfter } ) ;
152
139
} ) ;
153
140
154
141
it ( 'should send actions to discord' , function ( ) {
0 commit comments