This repository has been archived by the owner on Jun 7, 2024. It is now read-only.
forked from speced/respec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
inlines-spec.js
42 lines (42 loc) · 1.54 KB
/
inlines-spec.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
"use strict";
describe("Core - Inlines", function() {
afterAll(function(done) {
flushIframes();
done();
});
it("should process all in-line content", function(done) {
var ops = {
config: makeBasicConfig(),
body: makeDefaultBody() +
"<section id='inlines'>" +
" <p><acronym title='ACRO-TIT'>ACRO</acronym> ACRO</p>" +
" <p><abbr title='ABBR-TIT'>ABBR</abbr> ABBR</p>" +
" <p>MUST and NOT RECOMMENDED</p>" +
" <p>[[!DAHU]] [[REX]]</p>" +
"</section>",
};
ops.config.localBiblio = {
"DAHU": {
title: "One short leg. How I learned to overcome.",
publisher: "Publishers Inc."
},
"REX": {
title: "Am I a dinosaur or a failed technology?",
publisher: "Publishers Inc."
},
};
makeRSDoc(ops, function(doc) {
var $inl = $("#inlines", doc);
var $nr = $("#normative-references", doc);
var $ir = $("#informative-references", doc);
expect($inl.find("acronym[title='ACRO-TIT']:contains('ACRO')").length).toEqual(2);
expect($inl.find("abbr[title='ABBR-TIT']:contains('ABBR')").length).toEqual(2);
expect($inl.find("cite a:contains('DAHU')").attr("href")).toEqual("#bib-DAHU");
expect($inl.find("cite a:contains('REX')").attr("href")).toEqual("#bib-REX");
expect($nr.find("dl dt").length).toEqual(1);
expect($nr.find("dl dt:contains('[DAHU]')").length).toEqual(1);
expect($ir.find("dl dt").length).toEqual(1);
expect($ir.find("dl dt:contains('[REX]')").length).toEqual(1);
}).then(done);
});
});