Browse Source

Add test case #165

Ben Hsieh 8 years ago
parent
commit
3d27ac0143
1 changed files with 28 additions and 6 deletions
  1. 28
    6
      test/test-0.10.0.js

+ 28
- 6
test/test-0.10.0.js View File

9
   Linking,
9
   Linking,
10
   Platform,
10
   Platform,
11
   Dimensions,
11
   Dimensions,
12
+  BackAndroid,
12
   AsyncStorage,
13
   AsyncStorage,
13
   Image,
14
   Image,
14
 } from 'react-native';
15
 } from 'react-native';
105
 //
106
 //
106
 //   RNFetchBlob.fetch('GET', `${TEST_SERVER_URL}/cookie`)
107
 //   RNFetchBlob.fetch('GET', `${TEST_SERVER_URL}/cookie`)
107
 //   .then((res) => {
108
 //   .then((res) => {
108
-//     return RNFetchBlob.fetch('GET', `${TEST_SERVER_URL}/xhr-header`)
109
+//     return RNFetchBlotesb.fetch('GET', `${TEST_SERVER_URL}/xhr-header`)
109
 //   })
110
 //   })
110
 //   .then((res) => {
111
 //   .then((res) => {
111
 //     console.log(res)
112
 //     console.log(res)
133
 //     })
134
 //     })
134
 // })
135
 // })
135
 
136
 
136
-describe('#162 get free disk space', (report, done) => {
137
+// describe('#162 get free disk space', (report, done) => {
138
+//
139
+//   fs.df().then((stat) => {
140
+//     console.log(stat);
141
+//     done();
142
+//   })
143
+//
144
+// })
137
 
145
 
138
-  fs.df().then((stat) => {
139
-    console.log(stat);
140
-    done();
141
-  })
142
 
146
 
147
+describe('action view intent get callback', (report, done) => {
148
+  let isActionViewVisible = false
149
+
150
+  RNFetchBlob.config({
151
+    fileCache : true,
152
+    appendExt : 'png',
153
+    trusty : true
154
+  })
155
+  .fetch('GET', `${TEST_SERVER_URL}/public/github.png`)
156
+  .then(res => {
157
+    console.log(res.data);
158
+    console.log(res.info())
159
+    RNFetchBlob.android.actionViewIntent(res.path(), 'image/png')
160
+    .then(() => {
161
+        console.log('action-view removed')
162
+      isActionViewVisible = true
163
+    });
164
+  })
143
 })
165
 })