Skip to content

Commit 488da47

Browse files
author
Steven G. Harms
committed
Update indexTest
1 parent 20e402b commit 488da47

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

test/indexTest.js

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1+
const sinon = require('sinon');
12

3+
describe("index.js", () => {
4+
let input;
25

3-
describe("index.html", () => {
4-
it("includes div", () => {
5-
expect(document.querySelector('body').innerHTML).to.include('<div>')
6+
beforeEach(function() {
7+
input = document.getElementById('input');
8+
sinon.spy(input, 'addEventListener');
69
})
7-
})
810

9-
10-
describe("index.js", () => {
11-
it("has each codealong function", () => {
12-
expect(addingEventListener).to.exist
13-
expect(preventingDefault).to.exist
14-
expect(stoppingPropagation).to.exist
11+
it("binds an event listener in addingEventListener()", () => {
12+
addingEventListener();
13+
expect(input.addEventListener.called).to.be.true;
1514
})
1615
})

0 commit comments

Comments
 (0)