File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,31 @@ describe('Libraries', function() {
104
104
105
105
it ( 'Sets the right classes when the vulnerability is and ' +
106
106
'is not displayed ' , async function ( ) {
107
+ expect ( await this . page . $$eval ( '.panel-wrap' , elements => {
108
+ function getLibraryName ( panelWrapElement ) {
109
+ return panelWrapElement . parentNode
110
+ . querySelector ( 'h3' )
111
+ . firstChild
112
+ . textContent ;
113
+ }
107
114
115
+ const result = [ ] ;
116
+
117
+ Array . prototype . forEach . call ( elements , el => {
118
+ const versionPresent = ! ! el . querySelector ( '.version' ) ;
119
+ const panelBodyElement = el . querySelector ( '.panel-body' ) ;
120
+ const mversionPresent = panelBodyElement . classList . contains ( 'mversion' ) ;
121
+
122
+ if ( ( versionPresent && mversionPresent ) ||
123
+ ( ! versionPresent && ! mversionPresent ) ) {
124
+ // All good
125
+ return ;
126
+ }
127
+
128
+ result . push ( getLibraryName ( el ) ) ;
129
+ } ) ;
130
+
131
+ return result ;
132
+ } ) ) . to . be . empty ;
108
133
} ) ;
109
134
} ) ;
You can’t perform that action at this time.
0 commit comments