We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 20e402b commit 488da47Copy full SHA for 488da47
test/indexTest.js
@@ -1,16 +1,15 @@
1
+const sinon = require('sinon');
2
3
+describe("index.js", () => {
4
+ let input;
5
-describe("index.html", () => {
- it("includes div", () => {
- expect(document.querySelector('body').innerHTML).to.include('<div>')
6
+ beforeEach(function() {
7
+ input = document.getElementById('input');
8
+ sinon.spy(input, 'addEventListener');
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
+ it("binds an event listener in addingEventListener()", () => {
+ addingEventListener();
+ expect(input.addEventListener.called).to.be.true;
15
16
0 commit comments