@@ -26,6 +26,12 @@ const mockOrderService = {
2626 getOrders : vi . fn ( ) ,
2727} ;
2828
29+ const mockNotificationsService = {
30+ setHandlerProvider : vi . fn ( ) ,
31+ start : vi . fn ( ) . mockResolvedValue ( undefined ) ,
32+ stop : vi . fn ( ) . mockResolvedValue ( undefined ) ,
33+ } ;
34+
2935// Helper functions to generate test data with faker
3036const generateJudge = ( ) : PersonSearchItem => ( {
3137 personId : faker . number . int ( ) ,
@@ -112,6 +118,7 @@ describe('AppBar.vue', () => {
112118 provide : {
113119 orderService : mockOrderService ,
114120 judgeService : mockJudgeService ,
121+ notificationsService : mockNotificationsService ,
115122 } ,
116123 } ,
117124 ...options ,
@@ -406,6 +413,7 @@ describe('AppBar.vue', () => {
406413 provide : {
407414 orderService : undefined ,
408415 judgeService : mockJudgeService ,
416+ notificationsService : mockNotificationsService ,
409417 } ,
410418 stubs : {
411419 VAppBar : false ,
@@ -431,6 +439,33 @@ describe('AppBar.vue', () => {
431439 provide : {
432440 orderService : mockOrderService ,
433441 judgeService : undefined ,
442+ notificationsService : mockNotificationsService ,
443+ } ,
444+ stubs : {
445+ VAppBar : false ,
446+ VAppBarTitle : false ,
447+ VTabs : false ,
448+ VTab : false ,
449+ VBtn : false ,
450+ VSpacer : false ,
451+ VBadge : false ,
452+ VIcon : false ,
453+ JudgeSelector : { template : '<div></div>' } ,
454+ } ,
455+ } ,
456+ } ) ;
457+ } ) . toThrow ( 'Service is not available!' ) ;
458+ } ) ;
459+
460+ it ( 'should throw error if notificationsService is not provided' , ( ) => {
461+ expect ( ( ) => {
462+ mount ( AppBar , {
463+ global : {
464+ plugins : [ router ] ,
465+ provide : {
466+ orderService : mockOrderService ,
467+ judgeService : mockJudgeService ,
468+ notificationsService : undefined ,
434469 } ,
435470 stubs : {
436471 VAppBar : false ,
0 commit comments