@@ -39,6 +39,11 @@ describe('Compass #spectron', function() {
39
39
40
40
context ( 'when working with the application' , function ( ) {
41
41
before ( require ( 'mongodb-runner/mocha/before' ) ( { port : 27018 } ) ) ;
42
+
43
+ before ( function ( done ) {
44
+ CrudSupport . insertMany ( CONNECTION , COLLECTION , DOCUMENTS , done ) ;
45
+ } ) ;
46
+
42
47
after ( require ( 'mongodb-runner/mocha/after' ) ( ) ) ;
43
48
44
49
context ( 'when opening the application' , function ( ) {
@@ -56,20 +61,12 @@ describe('Compass #spectron', function() {
56
61
. fillOutForm ( { hostname : 'localhost' , port : 27018 } )
57
62
. clickConnect ( )
58
63
. waitForSchemaWindow ( )
59
- . getTitle ( ) . should . eventually . be . equal ( 'MongoDB Compass' ) ;
64
+ . getTitle ( ) . should . eventually . be . equal ( 'MongoDB Compass - localhost:27018 ' ) ;
60
65
} ) ;
61
66
} ) ;
62
67
} ) ;
63
68
64
69
context ( 'when working with collections' , function ( ) {
65
- before ( function ( done ) {
66
- CrudSupport . insertMany ( CONNECTION , COLLECTION , DOCUMENTS , done ) ;
67
- } ) ;
68
-
69
- after ( function ( done ) {
70
- CrudSupport . removeAll ( CONNECTION , COLLECTION , done ) ;
71
- } ) ;
72
-
73
70
context ( 'when selecting a collection' , function ( ) {
74
71
it ( 'renders the sample collection in the title' , function ( ) {
75
72
return client
@@ -80,6 +77,17 @@ describe('Compass #spectron', function() {
80
77
) ;
81
78
} ) ;
82
79
80
+ it ( 'renders the schema tab' , function ( ) {
81
+ return client
82
+ . waitForStatusBar ( )
83
+ . gotoSchemaTab ( )
84
+ . getText ( 'li.bubble code.selectable' )
85
+ . should
86
+ . eventually
87
+ . include
88
+ . members ( [ 'Arca' , 'Bonobo' , 'Aphex Twin' , 'Beacon' ] ) ;
89
+ } ) ;
90
+
83
91
context ( 'when applying a filter' , function ( ) {
84
92
it ( 'samples the matching documents' , function ( ) {
85
93
return client
@@ -88,6 +96,32 @@ describe('Compass #spectron', function() {
88
96
. waitForStatusBar ( )
89
97
. getText ( 'div.sampling-message b' ) . should . eventually . include ( '1' ) ;
90
98
} ) ;
99
+
100
+ it ( 'updates the schema view' , function ( ) {
101
+ return client
102
+ . getText ( 'li.bubble code.selectable' )
103
+ . should
104
+ . eventually
105
+ . equal ( 'Arca' ) ;
106
+ } ) ;
107
+
108
+ it ( 'filters out non-matches from the document list' , function ( ) {
109
+ return client
110
+ . gotoDocumentsTab ( )
111
+ . getText ( 'div.element-value-is-string' )
112
+ . should
113
+ . not
114
+ . eventually
115
+ . include ( 'Aphex Twin' ) ;
116
+ } ) ;
117
+
118
+ it ( 'includes documents that match the filter' , function ( ) {
119
+ return client
120
+ . getText ( 'div.element-value-is-string' )
121
+ . should
122
+ . eventually
123
+ . include ( 'Arca' ) ;
124
+ } ) ;
91
125
} ) ;
92
126
93
127
context ( 'when resetting the filter' , function ( ) {
@@ -112,6 +146,32 @@ describe('Compass #spectron', function() {
112
146
} ) ;
113
147
} ) ;
114
148
} ) ;
149
+
150
+ context ( 'when working in the explain tab' , function ( ) {
151
+ context ( 'when viewing the explain tab' , function ( ) {
152
+ it ( 'renders the stages' , function ( ) {
153
+ return client
154
+ . gotoExplainPlanTab ( )
155
+ . getText ( 'h3.stage-header' )
156
+ . should
157
+ . eventually
158
+ . include ( 'COLLSCAN' ) ;
159
+ } ) ;
160
+ } ) ;
161
+ } ) ;
162
+
163
+ context ( 'when working in the indexes tab' , function ( ) {
164
+ context ( 'when viewing the indexes tab' , function ( ) {
165
+ it ( 'renders the indexes' , function ( ) {
166
+ return client
167
+ . gotoIndexesTab ( )
168
+ . getText ( 'div.index-definition div.name' )
169
+ . should
170
+ . eventually
171
+ . include ( '_id_' ) ;
172
+ } ) ;
173
+ } ) ;
174
+ } ) ;
115
175
} ) ;
116
176
} ) ;
117
177
} ) ;
0 commit comments