File tree Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 63
63
"react-dnd-html5-backend" : " ~2.0.0" ,
64
64
"react-dom" : " ^15.0.1" ,
65
65
"react-router" : " ^2.6.0" ,
66
+ "request-promise" : " ^4.1.1" ,
66
67
"sass-loader" : " ~3.1.2" ,
67
68
"style-loader" : " ~0.12.3" ,
68
69
"svg-prep" : " ~1.0.0" ,
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2016-present, Parse, LLC
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the license found in the LICENSE file in
6
+ * the root directory of this source tree.
7
+ */
8
+
9
+ jest . disableAutomock ( ) ;
10
+
11
+ var express = require ( 'express' ) ;
12
+ var app = express ( ) ;
13
+ var rp = require ( 'request-promise' ) ;
14
+ var ParseDashboard = require ( '../../../Parse-Dashboard/app' ) ;
15
+
16
+ var dashboard = ParseDashboard ( {
17
+ "apps" : [
18
+ {
19
+ "serverURL" : "http://localhost:5051/parse" ,
20
+ "appId" : "appId" ,
21
+ "masterKey" : "masterKey" ,
22
+ "appName" : "MyApp"
23
+ }
24
+ ]
25
+ } ) ;
26
+
27
+ app . use ( '/dashboard' , dashboard ) ;
28
+
29
+ var p = new Promise ( resolve => {
30
+ app . listen ( 5051 , resolve ) ;
31
+ } ) ;
32
+
33
+ describe ( 'e2e' , ( ) => {
34
+ it ( 'loads the dashboard' , ( ) => {
35
+ return p . then ( ( ) => {
36
+ return rp ( 'http://localhost:5051/dashboard' ) ;
37
+ } )
38
+ . then ( result => {
39
+ let bundleLocation = result . match ( / < s c r i p t s r c = \" ( [ ^ \" ] * ) \" > / ) [ 1 ]
40
+ return rp ( 'http://localhost:5051' + bundleLocation ) ;
41
+ } )
42
+ . then ( bundleText => {
43
+ expect ( bundleText . length ) . toBeGreaterThan ( 1000000 ) ;
44
+ } ) ;
45
+ } ) ;
46
+ } ) ;
You can’t perform that action at this time.
0 commit comments