Skip to content

Commit

Permalink
fix: fix test middlewares
Browse files Browse the repository at this point in the history
add greetings dialog because when user says hello, replay return greetings Intent since many other test bots have hello as greetings intent
  • Loading branch information
tcnguyen committed May 17, 2018
1 parent 13140ed commit 49861c5
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/test-middlewares/src/dialogs/greetings-dialog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Copyright (c) 2017 - present, Botfuel (https://www.botfuel.io).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

const { BaseDialog } = require('botfuel-dialog');

class GreetingsDialog extends BaseDialog {}

module.exports = GreetingsDialog;
25 changes: 25 additions & 0 deletions packages/test-middlewares/src/views/greetings-view.en.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Copyright (c) 2017 - present, Botfuel (https://www.botfuel.io).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

const { View, BotTextMessage } = require('botfuel-dialog');

class GreetingsView extends View {
render() {
return [new BotTextMessage('Hello human!')];
}
}

module.exports = GreetingsView;

0 comments on commit 49861c5

Please sign in to comment.