Yeldaai / chat-plugin

Yelda Chat Plugin
MIT License
0 stars 0 forks source link

unloadChat() should not only remove the created element, but restore initial state #89

Closed meelie closed 3 years ago

meelie commented 3 years ago

Repro link http://demoselfcare.greenbureau.com/best-western/yelda.html in mobile mode (in desktop, yeldaChat is not added to the dom because the targetted bubbleContainerChildId element does not exist => expected behavior

When i load the page i see a bubble at the bottom right side. click on it, you'll see yelda bubble + yelda text image

open the console and enter yeldaChat.unLoadChat() image

Expected behavior : yelda bubble and text are removed, an element with bubbleContainerChildId id is added back Current behavior : yelda bubble is removed, but not the text + the element with bubbleContainerChildId id is not added back

=> to be fixed with appropriate tests

Bonus validation : if i re init yelda chat, we should see yelda again

yeldaChat.unLoadChat()
window.yeldaChat.setupChat({
                assistantSlug: 'best_western_chaine',
                assistantId: '5ced0ae83c7d710f22da0ba1',
                assistantUrl: 'https://app.yelda.ai',
                chatPath: '/chat',
                locale: 'fr_FR',
                bubbleContainerChildId: 'id_yelda'
              })