Skip to content

Commit 1a12884

Browse files
committed
Add test for [param]
1 parent c7e8892 commit 1a12884

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,20 @@ describe('remote-input', function() {
3838
input.focus()
3939
})
4040

41+
it('repects param attribute', function(done) {
42+
const remoteInput = document.querySelector('remote-input')
43+
const input = document.querySelector('input')
44+
const results = document.querySelector('#results')
45+
remoteInput.setAttribute('param', 'robot')
46+
assert.equal(results.innerHTML, '')
47+
remoteInput.addEventListener('loadend', function() {
48+
assert.equal(results.querySelector('ol').getAttribute('data-src'), '/results?robot=test')
49+
done()
50+
})
51+
input.value = 'test'
52+
input.focus()
53+
})
54+
4155
it('loads content again after src is changed', function(done) {
4256
const remoteInput = document.querySelector('remote-input')
4357
const input = document.querySelector('input')

0 commit comments

Comments
 (0)