add method

This commit is contained in:
Leifer Mendez
2022-11-05 11:32:08 +01:00
parent 0a9b1907d7
commit 1c01e27a65
2 changed files with 16 additions and 2 deletions

View File

@@ -12,8 +12,7 @@
- [x] addAnswer
- [x] addKeyword: Opciones
- [x] addAnswer: Opciones, media, buttons
- [ ] Retornar SQL
- [ ] Retornar JSON (options)
- [x] Retornar JSON (options)
- [ ] Recibir JSON
```js

View File

@@ -112,4 +112,19 @@ test('addAnswer toJson con IMG', () => {
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()