File: __normalizeSwapStyle.js

package info (click to toggle)
htmx 4.0.0-alpha6-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 117,328 kB
  • sloc: javascript: 49,403; sh: 29; makefile: 7
file content (64 lines) | stat: -rw-r--r-- 2,209 bytes parent folder | download | duplicates (2)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
describe('__normalizeSwapStyle unit tests', function() {

    it('normalizes before to beforebegin', function () {
        assert.equal(htmx.__normalizeSwapStyle('before'), 'beforebegin')
    })

    it('normalizes after to afterend', function () {
        assert.equal(htmx.__normalizeSwapStyle('after'), 'afterend')
    })

    it('normalizes prepend to afterbegin', function () {
        assert.equal(htmx.__normalizeSwapStyle('prepend'), 'afterbegin')
    })

    it('normalizes append to beforeend', function () {
        assert.equal(htmx.__normalizeSwapStyle('append'), 'beforeend')
    })

    it('passes through innerHTML unchanged', function () {
        assert.equal(htmx.__normalizeSwapStyle('innerHTML'), 'innerHTML')
    })

    it('passes through outerHTML unchanged', function () {
        assert.equal(htmx.__normalizeSwapStyle('outerHTML'), 'outerHTML')
    })

    it('passes through beforebegin unchanged', function () {
        assert.equal(htmx.__normalizeSwapStyle('beforebegin'), 'beforebegin')
    })

    it('passes through afterbegin unchanged', function () {
        assert.equal(htmx.__normalizeSwapStyle('afterbegin'), 'afterbegin')
    })

    it('passes through beforeend unchanged', function () {
        assert.equal(htmx.__normalizeSwapStyle('beforeend'), 'beforeend')
    })

    it('passes through afterend unchanged', function () {
        assert.equal(htmx.__normalizeSwapStyle('afterend'), 'afterend')
    })

    it('passes through delete unchanged', function () {
        assert.equal(htmx.__normalizeSwapStyle('delete'), 'delete')
    })

    it('passes through none unchanged', function () {
        assert.equal(htmx.__normalizeSwapStyle('none'), 'none')
    })

    it('passes through innerMorph unchanged', function () {
        assert.equal(htmx.__normalizeSwapStyle('innerMorph'), 'innerMorph')
    })

    it('passes through outerMorph unchanged', function () {
        assert.equal(htmx.__normalizeSwapStyle('outerMorph'), 'outerMorph')
    })

    it('passes through unknown values unchanged', function () {
        assert.equal(htmx.__normalizeSwapStyle('unknown'), 'unknown')
        assert.equal(htmx.__normalizeSwapStyle('custom'), 'custom')
    })

});