@@ -26,12 +26,8 @@ vi.mock('@/hooks/useInstrument', () => ({
2626} ) ) ;
2727
2828const mockStore = {
29- useAppStore : vi . fn ( ( ) => ( {
30- store : {
31- currentGroup : 'testGroup' ,
32- currentUser : 'testUser'
33- }
34- } ) )
29+ currentGroup : { id : 'testGroupId' } ,
30+ currentUser : { username : 'testUser' }
3531} ;
3632
3733const mockBasicIsoString = '2025-04-30' ;
@@ -54,7 +50,7 @@ const mockInstrumentRecords = {
5450} ;
5551
5652vi . mock ( '@/store' , ( ) => ( {
57- useAppStore : ( ) => mockStore
53+ useAppStore : vi . fn ( ( selector ) => selector ( mockStore ) )
5854} ) ) ;
5955
6056vi . mock ( '@douglasneuroinformatics/libui/hooks' , ( ) => ( {
@@ -92,7 +88,6 @@ describe('useInstrumentVisualization tests', () => {
9288
9389 describe ( 'CSV' , ( ) => {
9490 it ( 'Should download' , ( ) => {
95- vi . spyOn ( React , 'useEffect' ) . mockImplementation ( ( fn ) => fn ( ) ) ;
9691 const { dl, records } = useInstrumentVisualization ( {
9792 params : { subjectId : 'testId' }
9893 } ) ;
@@ -108,7 +103,6 @@ describe('useInstrumentVisualization tests', () => {
108103 } ) ;
109104 describe ( 'TSV' , ( ) => {
110105 it ( 'Should download' , ( ) => {
111- vi . spyOn ( React , 'useEffect' ) . mockImplementation ( ( fn ) => fn ( ) ) ;
112106 const { dl, records } = useInstrumentVisualization ( {
113107 params : { subjectId : 'testId' }
114108 } ) ;
@@ -124,7 +118,6 @@ describe('useInstrumentVisualization tests', () => {
124118 } ) ;
125119 describe ( 'CSV Long' , ( ) => {
126120 it ( 'Should download' , ( ) => {
127- vi . spyOn ( React , 'useEffect' ) . mockImplementation ( ( fn ) => fn ( ) ) ;
128121 const { dl, records } = useInstrumentVisualization ( {
129122 params : { subjectId : 'testId' }
130123 } ) ;
@@ -140,7 +133,6 @@ describe('useInstrumentVisualization tests', () => {
140133 } ) ;
141134 describe ( 'TSV Long' , ( ) => {
142135 it ( 'Should download' , ( ) => {
143- vi . spyOn ( React , 'useEffect' ) . mockImplementation ( ( fn ) => fn ( ) ) ;
144136 const { dl, records } = useInstrumentVisualization ( {
145137 params : { subjectId : 'testId' }
146138 } ) ;
@@ -156,7 +148,6 @@ describe('useInstrumentVisualization tests', () => {
156148 } ) ;
157149 describe ( 'JSON' , ( ) => {
158150 it ( 'Should download' , async ( ) => {
159- vi . spyOn ( React , 'useEffect' ) . mockImplementation ( ( fn ) => fn ( ) ) ;
160151 const { dl, records } = useInstrumentVisualization ( {
161152 params : { subjectId : 'testId' }
162153 } ) ;
0 commit comments