File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -7,18 +7,17 @@ const chai = require('chai');
77chai . should ( ) ;
88chai . use ( chaiAsPromised ) ;
99
10- function containsString ( app : Application , str : string ) {
11- it ( `Contains ${ str } ` ,
10+ function containsString ( app : Application , text : string , url : string ) {
11+ it ( `Contains ${ text } ` ,
1212 ( ) => {
13- return app . client . waitForExist ( 'ul li h2 a' ) . then ( ( ) => app . client . getText ( 'ul li h2 a' ) . then ( list => {
14- const index = list . indexOf ( str ) ;
15- return index > - 1 ? list [ index ] : '' ;
16- } ) . should . eventually . equal ( str ) ) ;
17- }
18- ) ;
13+ return app . client . waitForExist ( 'ul li h2 a' ) . then ( ( ) => Promise . all ( [
14+ app . client . getText ( 'ul li h2 a' ) . should . eventually . include ( text ) ,
15+ app . client . getAttribute ( 'ul li h2 a' , 'href' ) . should . eventually . include ( url )
16+ ] ) ) ;
17+ } ) ;
1918}
2019
2120SpectronUtils . describe ( 'Native strings' , app => {
22- containsString ( app , 'The link is provided by Node addon (using nan)' ) ;
23- containsString ( app , 'The link is provided by precompiled native library (using ffi)' ) ;
21+ containsString ( app , 'The link is provided by Node addon (using nan)' , 'https://github.com/nodejs/nan' ) ;
22+ containsString ( app , 'The link is provided by precompiled native library (using ffi)' , 'https://github.com/node-ffi/node-ffi' ) ;
2423} ) ;
You can’t perform that action at this time.
0 commit comments