-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathui-logic-tests.js
83 lines (58 loc) · 2.35 KB
/
ui-logic-tests.js
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
var assert = require('assert');
var mod = require('./ui-logic.js');
describe('RCSIdiomaticLogicFormatMarkdown', function test_RCSIdiomaticLogicFormatMarkdown() {
it('returns constant', function () {
assert.strictEqual(mod.RCSIdiomaticLogicFormatMarkdown(), 'kRCSIdiomaticLogicFormatMarkdown');
});
});
describe('RCSIdiomaticLogicFormatHTML', function test_RCSIdiomaticLogicFormatHTML() {
it('returns constant', function () {
assert.strictEqual(mod.RCSIdiomaticLogicFormatHTML(), 'kRCSIdiomaticLogicFormatHTML');
});
});
describe('RCSIdiomaticLogicFormatRTF', function test_RCSIdiomaticLogicFormatRTF() {
it('returns constant', function () {
assert.strictEqual(mod.RCSIdiomaticLogicFormatRTF(), 'kRCSIdiomaticLogicFormatRTF');
});
});
describe('RCSIdiomaticLogicFormatsArray', function test_RCSIdiomaticLogicFormatsArray() {
it('returns constant', function () {
assert.deepEqual(mod.RCSIdiomaticLogicFormatsArray(), [
mod.RCSIdiomaticLogicFormatMarkdown(),
mod.RCSIdiomaticLogicFormatHTML(),
mod.RCSIdiomaticLogicFormatRTF()
]);
});
});
describe('RCSIdiomaticLogicHTMLForMarkdown', function test_RCSIdiomaticLogicHTMLForMarkdown() {
it('throws if not string', function () {
assert.throws(function () {
mod.RCSIdiomaticLogicHTMLForMarkdown(null);
}, /RCSErrorInputNotValid/);
});
it('returns string', function () {
assert.strictEqual(mod.RCSIdiomaticLogicHTMLForMarkdown('alfa'), '<p>alfa</p>');
});
it('returns html if markdown', function () {
assert.strictEqual(mod.RCSIdiomaticLogicHTMLForMarkdown('_alfa_'), '<p><em>alfa</em></p>');
});
});
describe('RCSIdiomaticLogicMarkdownForHTML', function test_RCSIdiomaticLogicMarkdownForHTML() {
it('throws if not string', function () {
assert.throws(function () {
mod.RCSIdiomaticLogicMarkdownForHTML(null);
}, /RCSErrorInputNotValid/);
});
it('returns string', function () {
assert.strictEqual(mod.RCSIdiomaticLogicMarkdownForHTML('alfa'), 'alfa');
});
it('returns markdown if html', function () {
assert.strictEqual(mod.RCSIdiomaticLogicMarkdownForHTML('<em>alfa</em>'), '_alfa_');
});
it('uses pound heading style', function () {
assert.strictEqual(mod.RCSIdiomaticLogicMarkdownForHTML('<h1>alfa</h1>'), '# alfa');
});
it('uses hyphen bullet style', function () {
assert.strictEqual(mod.RCSIdiomaticLogicMarkdownForHTML('<ul><li>alfa</li></ul>'), '- alfa');
});
});