mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-20 04:29:16 +00:00
test: 🔥 a lot test e2e
This commit is contained in:
@@ -59,6 +59,37 @@ class FlowClass {
|
||||
findBySerialize = (refSerialize) => this.flowSerialize.find((r) => r.refSerialize === refSerialize)
|
||||
|
||||
findIndexByRef = (ref) => this.flowSerialize.findIndex((r) => r.ref === ref)
|
||||
|
||||
getRefToContinueChild = (keyword) => {
|
||||
try {
|
||||
const flowChilds = this.flowSerialize
|
||||
.reduce((acc, cur) => {
|
||||
const merge = [...acc, cur?.options?.nested].flat(2)
|
||||
return merge
|
||||
}, [])
|
||||
.filter((i) => !!i && i?.refSerialize === keyword)
|
||||
.shift()
|
||||
|
||||
return flowChilds
|
||||
} catch (e) {
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
|
||||
getFlowsChild = () => {
|
||||
try {
|
||||
const flowChilds = this.flowSerialize
|
||||
.reduce((acc, cur) => {
|
||||
const merge = [...acc, cur?.options?.nested].flat(2)
|
||||
return merge
|
||||
}, [])
|
||||
.filter((i) => !!i)
|
||||
|
||||
return flowChilds
|
||||
} catch (e) {
|
||||
return []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = FlowClass
|
||||
|
||||
Reference in New Issue
Block a user