Skip to content

Commit e38c9c2

Browse files
committed
Fix tests for new tooltip method.
1 parent 676aa2c commit e38c9c2

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

test/functional/editor.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,17 @@ describe('Editor', function() {
6969
}
7070
});
7171

72-
it('Should display a tooltip with a human readable ' +
73-
'date on claim hover', async function() {
72+
it('Should display a tooltip for a claim', async function() {
7473
await this.page.select('#algorithm-select', 'HS384');
75-
74+
7675
await this.page.mouse.move(0, 0);
76+
77+
function tippyVisible(element) {
78+
return element._tippy.state.visible;
79+
}
7780

78-
expect(await this.page.$eval('#js-payload-tooltip', isVisible)).to.be.false;
81+
expect(await this.page.$eval('#decoded-jwt .output', tippyVisible)).
82+
to.be.false;
7983

8084
const iatPos = await this.page.evaluate(() => {
8185
return window.test.payloadEditor.charCoords({
@@ -86,7 +90,11 @@ describe('Editor', function() {
8690

8791
await this.page.mouse.move(iatPos.left, iatPos.top);
8892

89-
expect(await this.page.$eval('#js-payload-tooltip', isVisible)).to.be.true;
93+
// Wait for animation
94+
await this.page.waitFor(2000);
95+
96+
expect(await this.page.$eval('#decoded-jwt .output', tippyVisible))
97+
.to.be.true;
9098
});
9199

92100
it('Displays a valid token by default', async function() {

0 commit comments

Comments
 (0)