From a12dfd3ce6402f22baeb6415af271d8545c74f71 Mon Sep 17 00:00:00 2001 From: James Allen <24575899+jrdallen97@users.noreply.github.com> Date: Wed, 3 Mar 2021 12:30:31 +0000 Subject: Add support for setting hyperlink display & tooltip (closes #790) (#794) --- excelize_test.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'excelize_test.go') diff --git a/excelize_test.go b/excelize_test.go index 8bce6d1..0d0d587 100644 --- a/excelize_test.go +++ b/excelize_test.go @@ -326,6 +326,13 @@ func TestSetCellHyperLink(t *testing.T) { assert.NoError(t, f.SetCellHyperLink("Sheet2", "C1", "https://github.com/360EntSecGroup-Skylar/excelize", "External")) // Test add Location hyperlink in a work sheet. assert.NoError(t, f.SetCellHyperLink("Sheet2", "D6", "Sheet1!D8", "Location")) + // Test add Location hyperlink with display & tooltip in a work sheet. + display := "Display value" + tooltip := "Hover text" + assert.NoError(t, f.SetCellHyperLink("Sheet2", "D7", "Sheet1!D9", "Location", HyperlinkOpts{ + Display: &display, + Tooltip: &tooltip, + })) assert.EqualError(t, f.SetCellHyperLink("Sheet2", "C3", "Sheet1!D8", ""), `invalid link type ""`) -- cgit v1.2.1