summaryrefslogtreecommitdiff
path: root/excelize_test.go
diff options
context:
space:
mode:
authorJames Allen <24575899+jrdallen97@users.noreply.github.com>2021-03-03 12:30:31 +0000
committerGitHub <noreply@github.com>2021-03-03 20:30:31 +0800
commita12dfd3ce6402f22baeb6415af271d8545c74f71 (patch)
tree51e13b1013a75a7c63adf786c945bb2adbac44bc /excelize_test.go
parent7ef1892f320879670c4e9a8536a70281d782625e (diff)
Add support for setting hyperlink display & tooltip (closes #790) (#794)
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 ""`)