Skip to content

Commit 02de738

Browse files
committed
update tests to use correct html fragment mimetype
1 parent 585ef48 commit 02de738

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ const responses = {
4141
})
4242
},
4343
'/fragment': function(request) {
44-
if (request.headers.get('Accept') === 'text/html; fragment') {
44+
if (request.headers.get('Accept') === 'text/fragment+html') {
4545
return new Response('<div id="fragment">fragment</div>', {
4646
status: 200,
4747
headers: {
48-
'Content-Type': 'text/html; fragment'
48+
'Content-Type': 'text/fragment+html'
4949
}
5050
})
5151
} else {
@@ -197,15 +197,15 @@ suite('include-fragment-element', function() {
197197

198198
test('throws on non-matching Content-Type', function() {
199199
const el = document.createElement('include-fragment')
200-
el.setAttribute('accept', 'text/html; fragment')
200+
el.setAttribute('accept', 'text/fragment+html')
201201
el.setAttribute('src', '/hello')
202202

203203
return el.data.then(
204204
() => {
205205
assert.ok(false)
206206
},
207207
error => {
208-
assert.match(error, /expected text\/html; fragment but was text\/html; charset=utf-8/)
208+
assert.match(error, /expected text\/fragment\+html but was text\/html; charset=utf-8/)
209209
}
210210
)
211211
})
@@ -309,7 +309,7 @@ suite('include-fragment-element', function() {
309309

310310
test('replaces with response with the right accept header', function() {
311311
const div = document.createElement('div')
312-
div.innerHTML = '<include-fragment src="/fragment" accept="text/html; fragment">loading</include-fragment>'
312+
div.innerHTML = '<include-fragment src="/fragment" accept="text/fragment+html">loading</include-fragment>'
313313
document.body.appendChild(div)
314314

315315
return when(div.firstChild, 'load').then(() => {

0 commit comments

Comments
 (0)