Skip to content

Commit

Permalink
fix: Fix mute dialog + test in test-middlewares
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinDepuydt committed Jan 24, 2018
1 parent d0b7834 commit d1d88d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/test-middlewares/src/dialogs/mute-dialog.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const { TextDialog } = require('botfuel-dialog');

class Mute extends TextDialog {
dialogWillComplete(userId) {
this.brain.userSet(userId, '_isMuted', true);
dialogWillComplete(userMessage) {
this.brain.userSet(userMessage.user, '_isMuted', true);
}
}

Expand Down
2 changes: 2 additions & 0 deletions packages/test-middlewares/tests/mute.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ describe('Mute', function () {
new BotTextMessage('Muted!'),
new UserTextMessage('What\'s up'),
].map(msg => msg.toJson(userId)));
const isMuted = await bot.brain.userGet(userId, '_isMuted');
expect(isMuted).to.be(true);
});
});

0 comments on commit d1d88d9

Please sign in to comment.