Skip to content

Commit 8cdc007

Browse files
committed
Add custom component reactivity test
1 parent f0e02c1 commit 8cdc007

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

cypress/e2e/test.cy.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,11 @@ describe('Integration Tests', () => {
168168
.invoke('toast.pop', 0)
169169
})
170170

171-
it('Uses component', () => {
171+
it('Renders custom component and is reactive', () => {
172172
cy.get('[data-btn=sendComponentAsAMessage]')
173173
.click()
174-
.get('._toastItem')
175-
.contains('A Dummy Cookie Component')
174+
.get('._toastItem h1')
175+
.should('have.text', 'Test Reactivity')
176176
.get('[data-btn=default]')
177177
.click()
178178
.get('[data-btn=dummyAccept')

docs/App.svelte

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ toast.pop(0)`,
264264
}
265265
})`,
266266
run: () => {
267-
toast.push({
267+
const id = toast.push({
268268
component: {
269269
src: DummyComponent,
270270
props: { title: 'A Dummy Cookie Component' },
@@ -281,6 +281,16 @@ toast.pop(0)`,
281281
'--toastBorderRadius': '1rem'
282282
}
283283
})
284+
// @ts-ignore
285+
if (window.Cypress) {
286+
toast.set(id, {
287+
component: {
288+
src: DummyComponent,
289+
props: { title: 'Test Reactivity' },
290+
sendIdTo: 'toastId'
291+
}
292+
})
293+
}
284294
}
285295
},
286296
{

0 commit comments

Comments
 (0)