fixes #4797 Seccion Worker/Notification #51

Merged
alexandre merged 23 commits from 4797-worker-notification-selector into dev 2023-05-15 09:42:17 +00:00
2 changed files with 7 additions and 7 deletions
Showing only changes of commit ecb83f24dc - Show all commits

View File

@ -83,7 +83,7 @@ async function toggleNotification(notification) {
v-show="
notifications.filter(
(notification) => notification.active == true
).length > 0
).length
"
>
<QItemLabel header class="text-h6">
@ -108,7 +108,7 @@ async function toggleNotification(notification) {
</div>
</QItem>
</div>
<div v-show="notifications.length > 0">
<div v-show="notifications.length">
<QItemLabel header class="text-h6">
{{ t('worker.notificationsManager.availableNotifications') }}
</QItemLabel>

View File

@ -6,22 +6,22 @@ describe('WorkerNotificationsManager', () => {
cy.visit(`/#/worker/${workerId}/notifications`);
});
it('should unsubscribe 2 notifications', () => {
it('should unsubscribe 2 notifications, check the unsubscription has been saved, subscribe to other one and should check the data has been saved', () => {
cy.get('.q-chip').should('have.length', 3);
cy.get('.q-toggle__thumb').eq(0).click();
cy.get('.q-notification__message').should('have.text', 'Unsubscribed from the notification');
cy.get('.q-chip > .q-icon').eq(0).click();
});
it('should check the unsubscription has been saved and subscribe to other one', () => {
cy.reload();
cy.get('.q-chip').should('have.length', 1);
cy.get('.q-toggle__thumb').should('have.length', 3).eq(0).click();
cy.get('.q-notification__message').should('have.text', 'Subscribed to the notification');
cy.get('.q-toggle__thumb').should('have.length', 3).eq(1).click();
cy.get('.q-notification__message').should('have.text', 'Subscribed to the notification');
});
it('should check the data has been saved', () => {
cy.reload();
cy.get('.q-chip').should('have.length', 3);
});
});