Skip to content

Commit 78d2b71

Browse files
committed
Section 32: Displaying the Autocomplete
1 parent eca57eb commit 78d2b71

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
it('Shows an autocomplete', () => {
2+
createAutoComplete({
3+
root: document.querySelector('#target'),
4+
fetchData() {
5+
return [
6+
{ Title: 'Blade Runner' },
7+
{ Title: 'Redemption of the Ghost' },
8+
{ Title: 'Die hard' },
9+
]
10+
},
11+
renderOption(movie) {
12+
return movie.Title
13+
}
14+
})
15+
})

32-The-Basics-of-Testing/06-movies/test/test.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
</head>
99
<body>
1010
<div id="mocha"></div>
11+
<div id="target"></div>
1112

1213
<script src="https://unpkg.com/chai/chai.js"></script>
1314
<script src="https://unpkg.com/mocha/mocha.js"></script>
@@ -16,9 +17,9 @@
1617
mocha.setup('bdd')
1718
mocha.checkLeaks()
1819
</script>
19-
<script src="test.array.js"></script>
20-
<script src="test.object.js"></script>
21-
<script src="test.xhr.js"></script>
20+
<script src="../utils.js"></script>
21+
<script src="../autocomplete.js"></script>
22+
<script src="autocomplete.test.js"></script>
2223
<script class="mocha-exec">
2324
mocha.run()
2425
</script>

0 commit comments

Comments
 (0)