11// Mock controllers directly
2- jest . mock ( '@/controllers/TestController ' , ( ) => {
2+ jest . mock ( '@/controllers/StudyController ' , ( ) => {
33 return jest . fn ( ) . mockImplementation ( ( ) => ( {
4- updateTest : jest . fn ( ) ,
5- acceptTestCollaboration : jest . fn ( )
4+ updateStudy : jest . fn ( ) ,
5+ acceptStudyCollaboration : jest . fn ( )
66 } ) )
77} )
88
9- jest . mock ( '@/controllers/AuthController' , ( ) => {
9+ jest . mock ( '@/features/auth/ controllers/AuthController' , ( ) => {
1010 return jest . fn ( ) . mockImplementation ( ( ) => ( {
1111 signOut : jest . fn ( ) ,
1212 autoSignIn : jest . fn ( )
1313 } ) )
1414} )
1515
16- jest . mock ( '@/controllers/UserController' , ( ) => {
16+ jest . mock ( '@/features/auth/ controllers/UserController' , ( ) => {
1717 return jest . fn ( ) . mockImplementation ( ( ) => ( {
1818 getById : jest . fn ( )
1919 } ) )
@@ -31,10 +31,10 @@ import AuthController from '@/features/auth/controllers/AuthController'
3131 */
3232describe ( 'Store Modules Error Handling Structure' , ( ) => {
3333 describe ( 'Test Module Actions' , ( ) => {
34- it ( 'has error handling in updateTest action' , ( ) => {
35- expect ( typeof TestModule . actions . updateTest ) . toBe ( 'function' )
34+ it ( 'has error handling in updateStudy action' , ( ) => {
35+ expect ( typeof TestModule . actions . updateStudy ) . toBe ( 'function' )
3636
37- const actionStr = TestModule . actions . updateTest . toString ( )
37+ const actionStr = TestModule . actions . updateStudy . toString ( )
3838 expect ( actionStr ) . toContain ( 'try' )
3939 expect ( actionStr ) . toContain ( 'catch' )
4040 expect ( actionStr ) . toContain ( 'finally' )
@@ -44,10 +44,10 @@ describe('Store Modules Error Handling Structure', () => {
4444 expect ( actionStr ) . toContain ( 'setLoading' )
4545 } )
4646
47- it ( 'has error handling in acceptTestCollaboration action' , ( ) => {
48- expect ( typeof TestModule . actions . acceptTestCollaboration ) . toBe ( 'function' )
47+ it ( 'has error handling in acceptStudyCollaboration action' , ( ) => {
48+ expect ( typeof TestModule . actions . acceptStudyCollaboration ) . toBe ( 'function' )
4949
50- const actionStr = TestModule . actions . acceptTestCollaboration . toString ( )
50+ const actionStr = TestModule . actions . acceptStudyCollaboration . toString ( )
5151 expect ( actionStr ) . toContain ( 'try' )
5252 expect ( actionStr ) . toContain ( 'catch' )
5353 expect ( actionStr ) . toContain ( 'finally' )
@@ -68,7 +68,7 @@ describe('Store Modules Error Handling Structure', () => {
6868 expect ( actionStr ) . toContain ( 'finally' )
6969
7070 expect ( actionStr ) . toContain ( 'catch (err)' )
71- expect ( actionStr ) . toContain ( 'setError ' )
71+ expect ( actionStr ) . toContain ( 'SET_TOAST ' )
7272 expect ( actionStr ) . toContain ( 'setLoading' )
7373 } )
7474
@@ -80,7 +80,7 @@ describe('Store Modules Error Handling Structure', () => {
8080 expect ( actionStr ) . toContain ( 'catch' )
8181
8282 expect ( actionStr ) . toContain ( 'catch (e)' )
83- expect ( actionStr ) . toContain ( 'setError ' )
83+ expect ( actionStr ) . toContain ( 'SET_TOAST ' )
8484 } )
8585 } )
8686} )
0 commit comments