summaryrefslogtreecommitdiff
path: root/spec/admonition_spec.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2020-08-28 23:44:11 -0600
committerDan Allen <dan.j.allen@gmail.com>2020-08-29 04:14:21 -0600
commitbcf23f55c4dc83ff187c7dcf96e058acb52929e8 (patch)
tree8818f19096ebfaa129af8fd05931cd257830bf94 /spec/admonition_spec.rb
parente35cbe6e53f9cc138bc5bd3886774f75e5d33abd (diff)
resize admonition label to fit if height exceeds height of content box
Diffstat (limited to 'spec/admonition_spec.rb')
-rw-r--r--spec/admonition_spec.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/spec/admonition_spec.rb b/spec/admonition_spec.rb
index f18b9ce2..1e34c581 100644
--- a/spec/admonition_spec.rb
+++ b/spec/admonition_spec.rb
@@ -121,14 +121,15 @@ describe 'Asciidoctor::PDF::Converter - Admonition' do
(expect label_text[:string]).to eql '⏻ TIP'
end
- # NOTE: this is a negative test until the defect is addressed
- it 'should not show label if it overflows available space' do
+ it 'should resize label text to fit if it overflows available space' do
pdf = to_pdf <<~'EOS', pdf_theme: { admonition_label_font_size: 18 }, analyze: true
[IMPORTANT]
Make sure the device is powered off before servicing it.
EOS
- (expect pdf.find_unique_text 'IMPORTANT').to be_nil
+ label_text = pdf.find_unique_text 'IMPORTANT'
+ (expect label_text).not_to be_nil
+ (expect label_text[:font_size]).to be < 18
end
it 'should allow padding to be specified for label and content using single value' do