| 1 | describe('__normalizeSwapStyle unit tests', function() { |
| 2 | |
| 3 | it('normalizes before to beforebegin', function () { |
| 4 | assert.equal(htmx.__normalizeSwapStyle('before'), 'beforebegin') |
| 5 | }) |
| 6 | |
| 7 | it('normalizes after to afterend', function () { |
| 8 | assert.equal(htmx.__normalizeSwapStyle('after'), 'afterend') |
| 9 | }) |
| 10 | |
| 11 | it('normalizes prepend to afterbegin', function () { |
| 12 | assert.equal(htmx.__normalizeSwapStyle('prepend'), 'afterbegin') |
| 13 | }) |
| 14 | |
| 15 | it('normalizes append to beforeend', function () { |
| 16 | assert.equal(htmx.__normalizeSwapStyle('append'), 'beforeend') |
| 17 | }) |
| 18 | |
| 19 | it('passes through innerHTML unchanged', function () { |
| 20 | assert.equal(htmx.__normalizeSwapStyle('innerHTML'), 'innerHTML') |
| 21 | }) |
| 22 | |
| 23 | it('passes through outerHTML unchanged', function () { |
| 24 | assert.equal(htmx.__normalizeSwapStyle('outerHTML'), 'outerHTML') |
| 25 | }) |
| 26 | |
| 27 | it('passes through beforebegin unchanged', function () { |
| 28 | assert.equal(htmx.__normalizeSwapStyle('beforebegin'), 'beforebegin') |
| 29 | }) |
| 30 | |
| 31 | it('passes through afterbegin unchanged', function () { |
| 32 | assert.equal(htmx.__normalizeSwapStyle('afterbegin'), 'afterbegin') |
| 33 | }) |
| 34 | |
| 35 | it('passes through beforeend unchanged', function () { |
| 36 | assert.equal(htmx.__normalizeSwapStyle('beforeend'), 'beforeend') |
| 37 | }) |
| 38 | |
| 39 | it('passes through afterend unchanged', function () { |
| 40 | assert.equal(htmx.__normalizeSwapStyle('afterend'), 'afterend') |
| 41 | }) |
| 42 | |
| 43 | it('passes through delete unchanged', function () { |
| 44 | assert.equal(htmx.__normalizeSwapStyle('delete'), 'delete') |
| 45 | }) |
| 46 | |
| 47 | it('passes through none unchanged', function () { |
| 48 | assert.equal(htmx.__normalizeSwapStyle('none'), 'none') |
| 49 | }) |
| 50 | |
| 51 | it('passes through innerMorph unchanged', function () { |
| 52 | assert.equal(htmx.__normalizeSwapStyle('innerMorph'), 'innerMorph') |
| 53 | }) |
| 54 | |
| 55 | it('passes through outerMorph unchanged', function () { |
| 56 | assert.equal(htmx.__normalizeSwapStyle('outerMorph'), 'outerMorph') |
| 57 | }) |
| 58 | |
| 59 | it('passes through unknown values unchanged', function () { |
| 60 | assert.equal(htmx.__normalizeSwapStyle('unknown'), 'unknown') |
| 61 | assert.equal(htmx.__normalizeSwapStyle('custom'), 'custom') |
| 62 | }) |
| 63 | |
| 64 | }); |