summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2021-11-06 23:55:17 -0600
committerDan Allen <dan.j.allen@gmail.com>2021-11-07 02:55:39 -0700
commit19d03c41096e7ad8383428d03ce7f79e6fb428be (patch)
treea34d63f62c40a24af321f8329a22d4a48ecedec5 /test
parent510bf8d5decdc1512363dedd07d73222744ae02c (diff)
add test to verify partintro can be defined using special section
Diffstat (limited to 'test')
-rw-r--r--test/sections_test.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/sections_test.rb b/test/sections_test.rb
index 305ad163..feb141ff 100644
--- a/test/sections_test.rb
+++ b/test/sections_test.rb
@@ -3707,6 +3707,31 @@ context 'Sections' do
assert_equal 'section', (doc.find_by id: 'appendix-section-title')[0].sectname
end
+ test 'should allow part intro to be defined using special section' do
+ input = <<~'EOS'
+ = Book
+ :doctype: book
+
+ = Part 1
+
+ [partintro]
+ == Part Intro
+
+ Part intro content
+
+ == Chapter 1
+
+ Chapter content
+ EOS
+
+ output = convert_string input, backend: 'docbook'
+ assert_xpath '/book/part[@xml:id="_part_1"]', output, 1
+ assert_xpath '/book/part[@xml:id="_part_1"]/partintro', output, 1
+ assert_xpath '/book/part[@xml:id="_part_1"]/partintro[@xml:id="_part_intro"]', output, 1
+ assert_xpath '/book/part[@xml:id="_part_1"]/partintro[@xml:id="_part_intro"]/title[text()="Part Intro"]', output, 1
+ assert_xpath '/book/part[@xml:id="_part_1"]/partintro[@xml:id="_part_intro"]/following-sibling::chapter[@xml:id="_chapter_1"]', output, 1
+ end
+
test 'should add partintro style to child paragraph of part' do
input = <<~'EOS'
= Book