|
@@ -0,0 +1,50 @@
|
|
1
|
+import RNTest from './react-native-testkit/'
|
|
2
|
+import React from 'react'
|
|
3
|
+import RNFetchBlob from 'react-native-fetch-blob'
|
|
4
|
+
|
|
5
|
+import {
|
|
6
|
+ StyleSheet,
|
|
7
|
+ Text,
|
|
8
|
+ View,
|
|
9
|
+ ScrollView,
|
|
10
|
+ CameraRoll,
|
|
11
|
+ Platform,
|
|
12
|
+ Dimensions,
|
|
13
|
+ Image,
|
|
14
|
+} from 'react-native';
|
|
15
|
+
|
|
16
|
+const fs = RNFetchBlob.fs
|
|
17
|
+const { Assert, Comparer, Info, prop } = RNTest
|
|
18
|
+const describe = RNTest.config({
|
|
19
|
+ group : '0.6.2',
|
|
20
|
+ run : true,
|
|
21
|
+ expand : true,
|
|
22
|
+ timeout : 12000,
|
|
23
|
+})
|
|
24
|
+const { TEST_SERVER_URL_SSL, FILENAME, DROPBOX_TOKEN, styles } = prop()
|
|
25
|
+const dirs = RNFetchBlob.fs.dirs
|
|
26
|
+
|
|
27
|
+let prefix = ((Platform.OS === 'android') ? 'file://' : '')
|
|
28
|
+
|
|
29
|
+CameraRoll.getPhotos({first : 10}, function(resp){console.log(resp)}, (err)=>{console.log(err)})
|
|
30
|
+ // .then((resp) => {
|
|
31
|
+ // console.log(resp)
|
|
32
|
+ // })
|
|
33
|
+ // .catch((err) => {
|
|
34
|
+ // console.log(err)
|
|
35
|
+ // })
|
|
36
|
+
|
|
37
|
+describe('access file in assets', (report, done) => {
|
|
38
|
+ CameraRoll.getPhotos({first : 10})
|
|
39
|
+ .then((resp) => {
|
|
40
|
+ report(<Info key="items">
|
|
41
|
+ <Text>{JSON.stringify(resp)}</Text>
|
|
42
|
+ </Info>)
|
|
43
|
+ })
|
|
44
|
+ .catch((err) => {
|
|
45
|
+ console.log(err)
|
|
46
|
+ report(<Info key="err">
|
|
47
|
+ <Text>{JSON.stringify(err)}</Text>
|
|
48
|
+ </Info>)
|
|
49
|
+ })
|
|
50
|
+})
|