Skip to content

Commit 98ba6a9

Browse files
author
Thomas Leconte
committed
Feat: Add TU for HTML notification
1 parent 5d55934 commit 98ba6a9

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

cypress/e2e/notify.cy.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,19 @@ it('error notification', () => {
1919
cy.get('div.v-snackbar__wrapper').should('have.class', 'bg-error')
2020
})
2121

22+
it('Html notification', () => {
23+
cy.get('button#html-notification').click()
24+
cy.get('div.v-snackbar--active').should('exist')
25+
cy.get('div.v-snackbar__wrapper').should('exist')
26+
cy.get('div.v-snackbar__content b').should('exist')
27+
cy.get('div.v-snackbar__content b').should('contain', 'HTML content')
28+
cy.get('div.v-snackbar__wrapper').should('have.class', 'bg-info')
29+
})
30+
2231
it('create sfc notification', () => {
2332
cy.get('button#sfc-create-notification').click()
2433
cy.get('div.v-snackbar--active').should('exist')
2534
cy.get('div.v-snackbar__wrapper').should('exist')
2635
cy.get('div.v-snackbar__content').should('contain', 'My SFC notification!')
2736
cy.get('div.v-snackbar__wrapper').should('have.class', 'bg-success')
28-
})
37+
})

cypress/test-server/src/components/HelloWorld.vue

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<div class="mt-5">
2929
<v-btn id="create-notification" @click="createNotification()">Create notification</v-btn>
3030
<v-btn id="error-notification" @click="errorNotification()" color="error">Error notification</v-btn>
31+
<v-btn id="html-notification" @click="createNotificationWithHTML()" color="error">Html notification</v-btn>
3132
</div>
3233
</div>
3334

@@ -127,6 +128,16 @@ export default defineComponent({
127128
errorNotification(){
128129
this.$notify.error("Hello error!\nLorem ipsum dolor sit amet, consectetur!", {timeout: 3000, location: 'bottom right'})
129130
},
131+
createNotificationWithHTML(){
132+
this.$notify.create({
133+
text: "Hello world!",
134+
htmlContent: "<b>HTML content</b>",
135+
notifyOptions: {
136+
timeout: 3000,
137+
location: 'top right'
138+
}
139+
})
140+
},
130141
createBottomsheet(){
131142
this.$bottomSheet.create({
132143
bottomSheetOptions: { inset: true },

0 commit comments

Comments
 (0)