@@ -23,7 +23,7 @@ describe('Browser notifications', () => {
2323 cy . visit ( 'index.html' , {
2424 onBeforeLoad ( win ) {
2525 // https://on.cypress.io/stub
26- cy . stub ( win . Notification , 'permission' , 'granted' )
26+ cy . stub ( win . Notification , 'permission' ) . value ( 'granted' )
2727 cy . stub ( win , 'Notification' ) . as ( 'Notification' )
2828 } ,
2929 } )
@@ -37,7 +37,7 @@ describe('Browser notifications', () => {
3737 it ( 'asks for permission first, then shows notification if granted' , ( ) => {
3838 cy . visit ( 'index.html' , {
3939 onBeforeLoad ( win ) {
40- cy . stub ( win . Notification , 'permission' , 'unknown' )
40+ cy . stub ( win . Notification , 'permission' ) . value ( 'unknown' )
4141 cy . stub ( win . Notification , 'requestPermission' ) . resolves ( 'granted' ) . as ( 'ask' )
4242 cy . stub ( win , 'Notification' ) . as ( 'Notification' )
4343 } ,
@@ -52,7 +52,7 @@ describe('Browser notifications', () => {
5252 it ( 'asks for permission first, does nothing if denied' , ( ) => {
5353 cy . visit ( 'index.html' , {
5454 onBeforeLoad ( win ) {
55- cy . stub ( win . Notification , 'permission' , 'unknown' )
55+ cy . stub ( win . Notification , 'permission' ) . value ( 'unknown' )
5656 cy . stub ( win . Notification , 'requestPermission' ) . resolves ( 'denied' ) . as ( 'ask' )
5757 cy . stub ( win , 'Notification' ) . as ( 'Notification' )
5858 } ,
@@ -66,7 +66,7 @@ describe('Browser notifications', () => {
6666 it ( 'does not show notification if permission was denied before' , ( ) => {
6767 cy . visit ( 'index.html' , {
6868 onBeforeLoad ( win ) {
69- cy . stub ( win . Notification , 'permission' , 'denied' )
69+ cy . stub ( win . Notification , 'permission' ) . value ( 'denied' )
7070 cy . stub ( win . Notification , 'requestPermission' ) . resolves ( 'denied' ) . as ( 'ask' )
7171 cy . stub ( win , 'Notification' ) . as ( 'Notification' )
7272 } ,
@@ -82,7 +82,7 @@ describe('Browser notifications', () => {
8282 // the application checks if the permission was granted
8383 // using the property Notification.permission === 'granted'
8484 // which Sinon still supports, although it is marked deprecated
85- cy . stub ( win . Notification , 'permission' , 'granted' )
85+ cy . stub ( win . Notification , 'permission' ) . value ( 'granted' )
8686 cy . spy ( win , 'Notification' ) . as ( 'Notification' )
8787 } ,
8888 } )
0 commit comments