|
@@ -13,9 +13,9 @@ import {
|
13
|
13
|
Image,
|
14
|
14
|
} from 'react-native';
|
15
|
15
|
|
16
|
|
-const FILENAME = `${Platform.OS}-0.4.0-${Date.now()}.png`
|
|
16
|
+const FILENAME = `${Platform.OS}-0.4.2-${Date.now()}.png`
|
17
|
17
|
// paste your test config here
|
18
|
|
-const TEST_SERVER_URL = 'http://192.168.0.14:8123'
|
|
18
|
+const TEST_SERVER_URL = 'http://192.168.17.193:8123'
|
19
|
19
|
const DROPBOX_TOKEN = 'fsXcpmKPrHgAAAAAAAAAoXZhcXYWdgLpQMan6Tb_bzJ237DXhgQSev12hA-gUXt4'
|
20
|
20
|
|
21
|
21
|
const ctx = new RNTest.TestContext()
|
|
@@ -100,18 +100,20 @@ ctx.describe('Compare uploaded multipart image', async function(report) {
|
100
|
100
|
})
|
101
|
101
|
|
102
|
102
|
ctx.describe('Progress report test', (report) => new Promise((resolve) => {
|
103
|
|
-
|
|
103
|
+ let received = 0
|
104
|
104
|
let p1 = RNFetchBlob.fetch('GET', `${TEST_SERVER_URL}/public/22mb-dummy`, {
|
105
|
105
|
Authorization : 'Bearer abde123eqweje'
|
106
|
106
|
})
|
107
|
|
- let log = []
|
108
|
|
-
|
109
|
|
- p1.onProgress = (written, total) => {
|
110
|
|
- report(<Info key={`progress = ${written} bytes / ${total} bytes`}/>)
|
111
|
|
- if(written === total)
|
112
|
|
- report(<Assert key="progress goes to 100%" expect={written} actual={total}/>)
|
113
|
|
- resolve()
|
114
|
|
- }
|
|
107
|
+ // .progress((written, total) => {
|
|
108
|
+ // // report(<Info key={`progress = ${written} bytes / ${total} bytes`}/>)
|
|
109
|
+ // if(written === total)
|
|
110
|
+ // report(<Assert key="progress goes to 100%" expect={written} actual={total}/>)
|
|
111
|
+ // })
|
|
112
|
+ .then((resp) => {
|
|
113
|
+ report(<Assert key="response data should be correct event with progress listener"
|
|
114
|
+ expect={resp.text().substr(0,10)} actual={"1234567890"}/>)
|
|
115
|
+ resolve()
|
|
116
|
+ })
|
115
|
117
|
|
116
|
118
|
}))
|
117
|
119
|
|