2023-05-02 06:42:31 +00:00
describe ( 'WorkerNotificationsManager' , ( ) => {
beforeEach ( ( ) => {
const workerId = 1110 ;
cy . viewport ( 1280 , 720 ) ;
cy . login ( 'salesBoss' ) ;
cy . visit ( ` /#/worker/ ${ workerId } /notifications ` ) ;
} ) ;
2023-05-15 08:57:17 +00:00
it ( 'should unsubscribe 2 notifications, check the unsubscription has been saved, subscribe to other one and should check the data has been saved' , ( ) => {
2023-05-02 06:42:31 +00:00
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 ( ) ;
2023-05-15 08:57:17 +00:00
cy . reload ( ) ;
2023-05-02 06:42:31 +00:00
cy . get ( '.q-chip' ) . should ( 'have.length' , 1 ) ;
2023-05-10 12:24:47 +00:00
cy . get ( '.q-toggle__thumb' ) . should ( 'have.length' , 3 ) . eq ( 0 ) . click ( ) ;
2023-05-02 06:42:31 +00:00
cy . get ( '.q-notification__message' ) . should ( 'have.text' , 'Subscribed to the notification' ) ;
2023-05-10 12:24:47 +00:00
cy . get ( '.q-toggle__thumb' ) . should ( 'have.length' , 3 ) . eq ( 1 ) . click ( ) ;
2023-05-02 06:42:31 +00:00
cy . get ( '.q-notification__message' ) . should ( 'have.text' , 'Subscribed to the notification' ) ;
2023-05-15 08:57:17 +00:00
cy . reload ( ) ;
2023-05-02 06:42:31 +00:00
cy . get ( '.q-chip' ) . should ( 'have.length' , 3 ) ;
} ) ;
} ) ;