|
| 1 | +/* global describe, it, before, after */ |
| 2 | + |
| 3 | +import mocha from 'mocha'; |
| 4 | +import should from 'should/as-function'; |
| 5 | +import helpers from './helpers'; |
| 6 | +import { doesMatch, doesMatchTopic } from '../src/bot/getReply/helpers'; |
| 7 | + |
| 8 | + |
| 9 | +// Testing topics that include and mixin other topics. |
| 10 | +describe('SuperScript TopicsConversation', () => { |
| 11 | + before(helpers.before('topicconversation')); |
| 12 | + |
| 13 | + describe('TopicConversationPets', () => { |
| 14 | + it('Conversation begin', (done) => { |
| 15 | + helpers.getBot().reply('tc_user', 'i love pets', (err, reply) => { |
| 16 | + should('Me too, what is your favorite?').eql(reply.string); |
| 17 | + done(); |
| 18 | + }); |
| 19 | + }); |
| 20 | + |
| 21 | + it('Inside the pets topic', (done) => { |
| 22 | + helpers.getBot().reply('tc_user', 'mine is cat', (err, reply) => { |
| 23 | + should(reply.string).eql('I love it too, what is your favorite ?'); |
| 24 | + done(); |
| 25 | + }); |
| 26 | + }); |
| 27 | + |
| 28 | + it('Should remain in the pets topic', (done) => { |
| 29 | + helpers.getBot().reply('tc_user', 'whatever', (err, reply) => { |
| 30 | + should(reply.string).eql('Cats are fun'); |
| 31 | + done(); |
| 32 | + }); |
| 33 | + }); |
| 34 | + |
| 35 | + }); |
| 36 | + |
| 37 | + describe('TopicConversationAnimals', () => { |
| 38 | + it('Conversation begin', (done) => { |
| 39 | + helpers.getBot().reply('tc_user', 'i love animals', (err, reply) => { |
| 40 | + should('I don\'t like pets, what is your favorite?').eql(reply.string); |
| 41 | + done(); |
| 42 | + }); |
| 43 | + }); |
| 44 | + |
| 45 | + it('Inside the pets topic', (done) => { |
| 46 | + helpers.getBot().reply('tc_user', 'mine is cat', (err, reply) => { |
| 47 | + should(reply.string).eql('Cats are scary, what is your favorite?'); |
| 48 | + done(); |
| 49 | + }); |
| 50 | + }); |
| 51 | + |
| 52 | + it('Should remain in the pets topic', (done) => { |
| 53 | + helpers.getBot().reply('tc_user', 'whatever', (err, reply) => { |
| 54 | + should(reply.string).eql('Cats are scary'); |
| 55 | + done(); |
| 56 | + }); |
| 57 | + }); |
| 58 | + |
| 59 | + }); |
| 60 | + |
| 61 | + after(helpers.after); |
| 62 | +}); |
0 commit comments