Skip to content

Commit 4a00b4e

Browse files
committed
add test for toast click event
1 parent 6a66850 commit 4a00b4e

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

cypress.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default defineConfig({
3131

3232
e2e: {
3333
baseUrl: "http://localhost:5173",
34-
specPattern: 'src/components/**/*.spec.ts',
34+
specPattern: "src/components/**/*.spec.ts",
3535
experimentalRunAllSpecs: true,
3636

3737
setupNodeEvents(on, config) {

src/components/toast/toast.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@ describe("template spec", () => {
1414
.contains("FYI")
1515
})
1616

17+
it("toasts with click event", () => {
18+
cy.visit("/components/toast")
19+
20+
cy.get('[data-cy="toast"]')
21+
.click()
22+
.get("[data-radix-vue-collection-item]")
23+
.click()
24+
.then(($el) => Cypress.dom.isVisible($el))
25+
.get("[data-radix-vue-collection-item]")
26+
.eq(1)
27+
.contains("You clicked on a toast")
28+
})
29+
1730
it("toasts with icon", () => {
1831
cy.visit("/components/toast")
1932

0 commit comments

Comments
 (0)