Skip to content

Commit ddefdc2

Browse files
Evgeny BarabanovEvgeny Barabanov
authored andcommitted
Closes #29
1 parent 43ceda9 commit ddefdc2

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

e2e/native-strings.e2e-spec.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,17 @@ const chai = require('chai');
77
chai.should();
88
chai.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

2120
SpectronUtils.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
});

0 commit comments

Comments
 (0)