Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Deprecated old tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ouadie-lahdioui committed Dec 20, 2018
1 parent 6e7d053 commit b8c2d06
Show file tree
Hide file tree
Showing 20 changed files with 139 additions and 59 deletions.
1 change: 0 additions & 1 deletion test/Botkit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ describe('Botkit', () => {
expect(botkit.consolebot).toBe('console');
expect(botkit.anywhere).toBe('anywhere');
expect(botkit.googlehangoutsbot).toBe('googlehangoutsbot');

});

});
47 changes: 0 additions & 47 deletions test/Events.test.js

This file was deleted.

3 changes: 0 additions & 3 deletions test/facebook/Attachement_upload_api.test.js

This file was deleted.

9 changes: 9 additions & 0 deletions test/facebook/Attachment_upload_api.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const {facebookbot} = require('../../lib/Botkit');

describe('Attachment_upload_api', () => {

test('Should not fail', () => {
expect(1).toBeTruthy();
});

});
6 changes: 6 additions & 0 deletions test/facebook/Bot.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
const Facebookbot = require('../../lib/Facebook');

describe('FacebookBot', () => {

test('adds 1 + 2 to equal 3', () => {
expect(1 + 2).toBe(3);
});

});
8 changes: 7 additions & 1 deletion test/facebook/Broadcast_api.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
describe('Facebook insights API', () => {
const {facebookbot} = require('../../lib/Botkit');

describe('Broadcast_api', () => {

test('Should not fail', () => {
expect(1).toBeTruthy();
});

});
8 changes: 7 additions & 1 deletion test/facebook/Handover_profile_api.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
describe('Facebook insights API', () => {
const Facebookbot = require('../../lib/Facebook');

describe('Handover_profile_api', () => {

test('Should not fail', () => {
expect(1).toBeTruthy();
});

});
8 changes: 7 additions & 1 deletion test/facebook/Insights_api.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
describe('Facebook insights API', () => {
const {facebookbot} = require('../../lib/Botkit');

describe('Insights_api', () => {

test('Should not fail', () => {
expect(1).toBeTruthy();
});

});
8 changes: 7 additions & 1 deletion test/facebook/Messenger_profile_api.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
describe('Facebook insights API', () => {
const {facebookbot} = require('../../lib/Botkit');

describe('Messenger_profile_api', () => {

test('Should not fail', () => {
expect(1).toBeTruthy();
});

});
8 changes: 7 additions & 1 deletion test/facebook/Nlp_api.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
describe('Facebook insights API', () => {
const {facebookbot} = require('../../lib/Botkit');

describe('Nlp_api', () => {

test('Should not fail', () => {
expect(1).toBeTruthy();
});

});
8 changes: 7 additions & 1 deletion test/facebook/Personas_profile_api.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
describe('Facebook insights API', () => {
const {facebookbot} = require('../../lib/Botkit');

describe('Personas_profile_api', () => {

test('Should not fail', () => {
expect(1).toBeTruthy();
});

});
8 changes: 7 additions & 1 deletion test/facebook/Tags_api.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
describe('Facebook insights API', () => {
const {facebookbot} = require('../../lib/Botkit');

describe('Tags_api', () => {

test('Should not fail', () => {
expect(1).toBeTruthy();
});

});
8 changes: 7 additions & 1 deletion test/facebook/User_profile_api.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
describe('Facebook insights API', () => {
const {facebookbot} = require('../../lib/Botkit');

describe('User_profile_api', () => {

test('Should not fail', () => {
expect(1).toBeTruthy();
});

});
68 changes: 68 additions & 0 deletions test/legacy/CoreBot.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
'use strict';

let botkit = require('../lib/CoreBot');

jest.mock('../lib/CoreBot', () => 'corebot');
jest.mock('../lib/SlackBot', () => 'slackbot');
jest.mock('../lib/Facebook', () => 'facebook');
jest.mock('../lib/TwilioIPMBot', () => 'twilioipm');
jest.mock('../lib/TwilioSMSBot', () => 'twiliosms');
jest.mock('../lib/BotFramework', () => 'botframework');
jest.mock('../lib/WebexBot', () => 'webex');
jest.mock('../lib/ConsoleBot', () => 'console');
jest.mock('../lib/Web', () => 'anywhere');
jest.mock('../lib/Teams', () => 'teams');
jest.mock('../lib/GoogleHangoutsBot', () => 'googlehangoutsbot');

describe('CoreBot', () => {

test('events passed into .on should trim whitespace', () => {

const controller = botkit.core({});
controller.on('hello, test,toot ', function () {
});

expect(controller.events.hello).toBeDefined();
expect(controller.events.test).toBeDefined();
expect(controller.events.toot).toBeDefined();

});


test('events to accumulate appropriately', () => {

const controller = botkit.core({});
controller.on('hello, test,toot ', function () {
});
controller.on('hello ', function () {
});
controller.on('test ', function () {
});

expect(controller.events.hello.length).toBe(2);
expect(controller.events.test.length).toBe(2);
expect(controller.events.toot.length).toBe(1);

});


test('all handlers bound to an event fire', (done) => {

const controller = botkit.core({});
controller.on('hello', function (data) {
expect(data).toEqual({foo: 'var'});
});

controller.on('hello', function (data) {
expect(data).toEqual({foo: 'var'});
});

controller.on('hello', function (data) {
expect(data).toEqual({foo: 'var'});
done();
});
controller.trigger('hello', [{foo: 'var'}]);

});

});
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit b8c2d06

Please sign in to comment.