Skip to content

Commit 8504110

Browse files
committed
New test: all libraries should have valid images.
1 parent e19af3f commit 8504110

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

package-lock.json

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"mocha": "^5.0.0",
4444
"pug": "^2.0.0-rc.4",
4545
"puppeteer": "^1.0.0",
46+
"request-promise-native": "^1.0.5",
4647
"sinon": "^4.2.2",
4748
"sinon-chai": "^2.14.0",
4849
"source-map-support": "^0.5.3",

test/functional/libraries.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ const chai = require('chai');
22
const chaiAsPromised = require('chai-as-promised');
33
const chaiArrays = require('chai-arrays');
44

5+
const request = require('request-promise-native');
6+
57
const utils = require('./utils.js');
68

79
const isVisible = utils.isVisible;
@@ -36,6 +38,21 @@ describe('Libraries', function() {
3638
expect(libraries).to.be.sorted;
3739
});
3840

41+
it('Should all have a valid logo', async function() {
42+
const imgs = await this.page.$$eval('.panel-heading img', imgs => {
43+
return Array.prototype.map.call(imgs, img => img.src);
44+
});
45+
46+
const uniqueImgs = new Set(imgs);
47+
48+
const promises = [];
49+
for(src of uniqueImgs) {
50+
promises.push(request(src));
51+
}
52+
53+
return expect(Promise.all(promises)).to.be.fulfilled;
54+
});
55+
3956
it('Hides and displays libraries using filters', async function() {
4057
await this.page.select('#libraries-select', '.php');
4158
// Wait for animation

0 commit comments

Comments
 (0)