diff options
| author | Randy Morgan <[email protected]> | 2013-03-16 11:40:54 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2013-03-16 11:40:54 +0900 |
| commit | 38e1638fa715398429797276058f2c18e9e21e9b (patch) | |
| tree | 30fd423d54033d2a525ebd6092f6da7a1342efbd /test/drawing | |
| parent | 0cb6eec06b6e13df28a6ce9e0b90e4e1ed8d5b28 (diff) | |
| download | caxlsx-38e1638fa715398429797276058f2c18e9e21e9b.tar.gz caxlsx-38e1638fa715398429797276058f2c18e9e21e9b.zip | |
First run at 'hidden' comments WIP
The xml is genrated correcty, but the comment still shows until it is
selected once in the excel ui - so I must be missing something.
Diffstat (limited to 'test/drawing')
| -rw-r--r-- | test/drawing/tc_vml_shape.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test/drawing/tc_vml_shape.rb b/test/drawing/tc_vml_shape.rb index 719beca7..94ad6e9f 100644 --- a/test/drawing/tc_vml_shape.rb +++ b/test/drawing/tc_vml_shape.rb @@ -6,8 +6,8 @@ class TestVmlShape < Test::Unit::TestCase p = Axlsx::Package.new wb = p.workbook @ws = wb.add_worksheet - @ws.add_comment :ref => 'A1', :text => 'penut machine', :author => 'crank' - @ws.add_comment :ref => 'C3', :text => 'rust bucket', :author => 'PO' + @ws.add_comment :ref => 'A1', :text => 'penut machine', :author => 'crank', :visible => true + @ws.add_comment :ref => 'C3', :text => 'rust bucket', :author => 'PO', :visible => false @comments = @ws.comments end @@ -84,11 +84,17 @@ class TestVmlShape < Test::Unit::TestCase assert(shape.top_row == 3) assert_raise(ArgumentError) { shape.top_row = [] } end - + def test_visible + shape = @comments.first.vml_shape + shape.visible = false + assert(shape.visible == false) + assert_raise(ArgumentError) { shape.visible = 'foo' } + end def test_to_xml_string str = @comments.vml_drawing.to_xml_string() doc = Nokogiri::XML(str) assert_equal(doc.xpath("//v:shape").size, 2) + assert_equal(1, doc.xpath("//x:Visible").size, 'ClientData/x:Visible element rendering') @comments.each do |comment| shape = comment.vml_shape assert(doc.xpath("//v:shape/x:ClientData/x:Row[text()='#{shape.row}']").size == 1) |
