mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-19 20:19:15 +00:00
add method
This commit is contained in:
@@ -12,8 +12,7 @@
|
|||||||
- [x] addAnswer
|
- [x] addAnswer
|
||||||
- [x] addKeyword: Opciones
|
- [x] addKeyword: Opciones
|
||||||
- [x] addAnswer: Opciones, media, buttons
|
- [x] addAnswer: Opciones, media, buttons
|
||||||
- [ ] Retornar SQL
|
- [x] Retornar JSON (options)
|
||||||
- [ ] Retornar JSON (options)
|
|
||||||
- [ ] Recibir JSON
|
- [ ] Recibir JSON
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
|||||||
@@ -112,4 +112,19 @@ test('addAnswer toJson con IMG', () => {
|
|||||||
assert.is(ctxC.options.media, 'http://mock.img/file-b.png')
|
assert.is(ctxC.options.media, 'http://mock.img/file-b.png')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('addAnswer toJson con BUTTONS', () => {
|
||||||
|
const [, ctxB] = addKeyword('hola')
|
||||||
|
.addAnswer('mis opciones!', {
|
||||||
|
buttons: [{ body: 'BTN_1' }, { body: 'BTN_2' }],
|
||||||
|
})
|
||||||
|
.toJson()
|
||||||
|
|
||||||
|
assert.is(ctxB.options.buttons.length, 2)
|
||||||
|
|
||||||
|
const [btnA, btnB] = ctxB.options.buttons
|
||||||
|
|
||||||
|
assert.is(btnA.body, 'BTN_1')
|
||||||
|
assert.is(btnB.body, 'BTN_2')
|
||||||
|
})
|
||||||
|
|
||||||
test.run()
|
test.run()
|
||||||
|
|||||||
Reference in New Issue
Block a user