Skip to content

Commit 94fcb62

Browse files
committed
More functional tests.
1 parent 5d0384b commit 94fcb62

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

test/functional/libraries.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,44 @@ describe('Libraries', function() {
6666
visible: true
6767
});
6868
});
69+
70+
it('Shows a repo link for each library', async function() {
71+
expect(await this.page.$$eval('.repository a', elements => {
72+
return Array.prototype.every.call(elements, e => {
73+
return !!e.href;
74+
});
75+
})).to.be.true;
76+
});
77+
78+
it('Displays libraries stacked on top of each other ' +
79+
'for small screens', async function() {
80+
try {
81+
await this.page.setViewport({
82+
width: 375,
83+
height: 1080
84+
});
85+
86+
const libraries = await this.page.$$('article.accordion');
87+
88+
let last = await libraries[0].boundingBox();
89+
const result = await Promise.all(libraries.slice(1).map(async element => {
90+
const box = await element.boundingBox();
91+
const result = box.x === last.x && box.y > last.y;
92+
last = box;
93+
return result;
94+
}));
95+
96+
expect(result.every(value => value)).to.be.true;
97+
} finally {
98+
await this.page.setViewport({
99+
width: 1920,
100+
height: 1080
101+
});
102+
}
103+
});
104+
105+
it('Sets the right classes when the vulnerability is and ' +
106+
'is not displayed ', async function() {
107+
108+
});
69109
});

0 commit comments

Comments
 (0)