@@ -9,21 +9,22 @@ describe('Action Logs Unit Tests', () => {
99 let sandbox ;
1010 let ipc ;
1111 let ipcRenderer ;
12-
13- const RNFS = {
14- DocumentDirectoryPath : '/foo/bar' ,
15- readFile : ( ) => Promise . resolve ( 'logs' ) ,
16- } ;
17- const Share = {
18- share : ( ) => Promise . resolve ( true ) ,
19- } ;
12+ let RNFS ;
13+ let Share ;
2014
2115 beforeEach ( ( ) => {
2216 sandbox = sinon . createSandbox ( { } ) ;
2317 ipcRenderer = {
2418 send : sinon . stub ( ) ,
2519 on : sinon . stub ( ) . yields ( 'some-event' , 'some-arg' ) ,
2620 } ;
21+ RNFS = {
22+ DocumentDirectoryPath : '/foo/bar' ,
23+ readFile : sinon . stub ( ) . resolves ( 'logs' ) ,
24+ } ;
25+ Share = {
26+ share : sinon . stub ( ) . resolves ( true ) ,
27+ } ;
2728 } ) ;
2829
2930 afterEach ( ( ) => {
@@ -143,6 +144,7 @@ describe('Action Logs Unit Tests', () => {
143144 it ( 'should return logs with an FS constructor argument' , async ( ) => {
144145 new LogAction ( store , ipc , false , RNFS ) ;
145146 expect ( await log . getLogs ( ) , 'to be a string' ) ;
147+ expect ( RNFS . readFile . called , 'to be true' ) ;
146148 } ) ;
147149 } ) ;
148150
@@ -154,6 +156,8 @@ describe('Action Logs Unit Tests', () => {
154156 it ( 'should share the logs with a Share and FS constructor argument' , async ( ) => {
155157 new LogAction ( store , ipc , false , RNFS , Share ) ;
156158 expect ( await log . shareLogs ( ) , 'to be ok' ) ;
159+ expect ( RNFS . readFile . called , 'to be true' ) ;
160+ expect ( Share . share . called , 'to be true' ) ;
157161 } ) ;
158162 } ) ;
159163 } ) ;
0 commit comments