forked from prismicio/javascript-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunit.js
More file actions
37 lines (34 loc) · 993 Bytes
/
unit.js
File metadata and controls
37 lines (34 loc) · 993 Bytes
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
(function(Prismic) {
var structuredText = {
type: 'StructuredText',
value: [{
type: 'paragraph',
text: 'Hi everyone, I am an awesome text!',
spans: [{
start: 0,
end: 11,
type: 'strong'
},{
start: 3,
end: 11,
type: 'em'
},{
start: 13,
end: 17,
type: 'strong'
},{
start: 17,
end: 28,
type: 'em'
}]
}]
};
module('Prismic.io', {
setup: function() {}
});
test('should init and render StructuredText', function () {
var html = '<p><strong>Hi <em>everyone</em></strong>, <strong>I am</strong><em> an awesome</em> text!</p>';
var fragment = Prismic.Fragments.initField(structuredText);
equal(html, fragment.asHtml());
});
})(window.Prismic);