|
@@ -0,0 +1,39 @@
|
|
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
|
+ Dimensions,
|
|
11
|
+ Image,
|
|
12
|
+} from 'react-native';
|
|
13
|
+const { Assert, Comparer, Info, prop } = RNTest
|
|
14
|
+const describe = RNTest.config({
|
|
15
|
+ group : 'fs',
|
|
16
|
+ expand : false,
|
|
17
|
+ run : true
|
|
18
|
+})
|
|
19
|
+
|
|
20
|
+let { TEST_SERVER_URL, FILENAME, DROPBOX_TOKEN, styles, image } = prop()
|
|
21
|
+
|
|
22
|
+describe('Get storage folders', (report, done) => {
|
|
23
|
+
|
|
24
|
+ RNFetchBlob.getSystemDirs().then((dirs) => {
|
|
25
|
+ report(
|
|
26
|
+ <Assert key="system folders should exists" expect={dirs} comparer={Comparer.exists} />,
|
|
27
|
+ <Assert key="check properties"
|
|
28
|
+ expect={dirs}
|
|
29
|
+ comparer={Comparer.hasProperties}
|
|
30
|
+ actual={['DocumentDir', 'CacheDir', 'DCIMDir', 'DownloadDir']}
|
|
31
|
+ />,
|
|
32
|
+ <Info key="System Folders">
|
|
33
|
+ <Text>{`${JSON.stringify(dirs)}`}</Text>
|
|
34
|
+ </Info>
|
|
35
|
+ )
|
|
36
|
+ done()
|
|
37
|
+ })
|
|
38
|
+
|
|
39
|
+})
|