summaryrefslogtreecommitdiff
path: root/excelize_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'excelize_test.go')
-rw-r--r--excelize_test.go7
1 files changed, 7 insertions, 0 deletions
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 ""`)