feat(lib): 💄 Better chat widget icon
This commit is contained in:
@ -23,9 +23,7 @@ describe('initBubble', () => {
|
||||
Typebot.initBubble({ url: 'https://typebot.io/typebot-id2' })
|
||||
const frames = document.getElementsByTagName('iframe')
|
||||
expect(frames).toHaveLength(1)
|
||||
expect(frames[0].dataset.src).toBe(
|
||||
'https://typebot.io/typebot-id2?hn=localhost'
|
||||
)
|
||||
expect(frames[0].dataset.src).toBe('https://typebot.io/typebot-id2')
|
||||
})
|
||||
|
||||
it('show open after the corresponding delay', async () => {
|
||||
@ -36,7 +34,7 @@ describe('initBubble', () => {
|
||||
})
|
||||
const bubble = document.querySelector('#typebot-bubble') as HTMLDivElement
|
||||
expect(bubble.classList.contains('iframe-opened')).toBe(false)
|
||||
await new Promise((r) => setTimeout(r, 1050))
|
||||
await new Promise((r) => setTimeout(r, 1100))
|
||||
expect(bubble.classList.contains('iframe-opened')).toBe(true)
|
||||
const rememberCloseDecisionFromStorage = localStorage.getItem(
|
||||
Typebot.localStorageKeys.rememberClose
|
||||
|
@ -11,7 +11,7 @@ describe('createIframe', () => {
|
||||
'https://typebot.io/typebot-id'
|
||||
)
|
||||
expect(iframeElement.getAttribute('src')).toBe(
|
||||
'https://typebot.io/typebot-id?hn=localhost'
|
||||
'https://typebot.io/typebot-id'
|
||||
)
|
||||
})
|
||||
|
||||
@ -24,7 +24,7 @@ describe('createIframe', () => {
|
||||
}),
|
||||
]
|
||||
expect(iframes[0].getAttribute('src')).toBe(
|
||||
'https://typebot.io/typebot-id?hn=localhost&var1=value1&var2=value2'
|
||||
'https://typebot.io/typebot-id?var1=value1&var2=value2'
|
||||
)
|
||||
})
|
||||
|
||||
@ -44,7 +44,7 @@ describe('createIframe', () => {
|
||||
loadWhenVisible: true,
|
||||
})
|
||||
expect(iframeElement.getAttribute('data-src')).toBe(
|
||||
'https://typebot.io/typebot-id?hn=localhost'
|
||||
'https://typebot.io/typebot-id'
|
||||
)
|
||||
expect(iframeElement.getAttribute('src')).toBeFalsy()
|
||||
})
|
||||
|
@ -23,9 +23,7 @@ describe('initPopup', () => {
|
||||
initPopup({ url: 'https://typebot.io/typebot-id2' })
|
||||
const elements = document.getElementsByTagName('iframe')
|
||||
expect(elements).toHaveLength(1)
|
||||
expect(elements[0].dataset.src).toBe(
|
||||
'https://typebot.io/typebot-id2?hn=localhost'
|
||||
)
|
||||
expect(elements[0].dataset.src).toBe('https://typebot.io/typebot-id2')
|
||||
})
|
||||
|
||||
it("shouldn't have opened classname if no delay", () => {
|
||||
|
Reference in New Issue
Block a user