-
-
Notifications
You must be signed in to change notification settings - Fork 430
/
Copy pathplaybackSpeedElements.test.js
46 lines (35 loc) · 1.09 KB
/
playbackSpeedElements.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
const Amplitude = require("../../src/index.js");
const config = require("../../src/config.js");
const Setup = require("../setup.js");
beforeEach(() => {
buildPlaybackSpeedElements();
Setup.initializeTestingElement();
Setup.initializeAmplitude();
});
afterEach(() => {
Setup.resetConfig();
});
function buildPlaybackSpeedElements() {
document.body.innerHTML =
'<div class="amplitude-playback-speed" id="playback-speed-button"></div>';
}
test("AmplitudeJS Playback Speed Elements Get Proper Classes", () => {
document.getElementById("playback-speed-button").click();
expect(
document
.getElementById("playback-speed-button")
.classList.contains("amplitude-playback-speed-15")
);
document.getElementById("playback-speed-button").click();
expect(
document
.getElementById("playback-speed-button")
.classList.contains("amplitude-playback-speed-20")
);
document.getElementById("playback-speed-button").click();
expect(
document
.getElementById("playback-speed-button")
.classList.contains("amplitude-playback-speed-10")
);
});