-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix runDialog helper, fix callerId (#1896)
- Loading branch information
Showing
3 changed files
with
68 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
const { strictEqual } = require('assert'); | ||
const { runDialog } = require('../'); | ||
|
||
describe('runDialog()', function() { | ||
this.timeout(300); | ||
|
||
describe('parameter validation', () => { | ||
it('should throw if missing dialog parameter', (done) => { | ||
runDialog().then( | ||
() => done(new Error('should have throw error')), | ||
(err) => { | ||
done(strictEqual(err.message, 'runDialog(): missing dialog')); | ||
}); | ||
}); | ||
|
||
it('should throw if missing context parameter', (done) => { | ||
runDialog({}).then( | ||
() => done(new Error('should have throw error')), | ||
(err) => { | ||
done(strictEqual(err.message, 'runDialog(): missing context')); | ||
}); | ||
}); | ||
|
||
it('should throw if missing context.activity', (done) => { | ||
runDialog({}, {}).then( | ||
() => done(new Error('should have throw error')), | ||
(err) => { | ||
done(strictEqual(err.message, 'runDialog(): missing context.activity')); | ||
}); | ||
}); | ||
|
||
it('should throw if missing accessor parameter', (done) => { | ||
runDialog({}, { activity: {} }).then( | ||
() => done(new Error('should have throw error')), | ||
(err) => { | ||
done(strictEqual(err.message, 'runDialog(): missing accessor')); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters