blob: da20faab98361189d5e54e49f082eab10cf4ad16 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
describe('Core htmx AJAX Verbs', function() {
beforeEach(function() {
this.server = makeServer()
clearWorkArea()
})
afterEach(function() {
this.server.restore()
clearWorkArea()
})
it('handles basic posts properly', function() {
this.server.respondWith('POST', '/test', 'post')
var div = make('<div hx-post="/test">click me</div>')
div.click()
this.server.respond()
div.innerHTML.should.equal('post')
})
it('handles basic put properly', function() {
this.server.respondWith('PUT', '/test', 'put')
var div = make('<div hx-put="/test">click me</div>')
div.click()
this.server.respond()
div.innerHTML.should.equal('put')
})
it('handles basic patch properly', function() {
this.server.respondWith('PATCH', '/test', 'patch')
var div = make('<div hx-patch="/test">click me</div>')
div.click()
this.server.respond()
div.innerHTML.should.equal('patch')
})
it('handles basic delete properly', function() {
this.server.respondWith('DELETE', '/test', 'delete')
var div = make('<div hx-delete="/test">click me</div>')
div.click()
this.server.respond()
div.innerHTML.should.equal('delete')
})
})
|